Validation of SCORM-XML Files. More...
Public Member Functions | |
| validateXML ($file) | |
| searchDir ($dir) | |
| ilObjSCORMValidator ($directory) | |
| validate () | |
| getSummary () | |
Data Fields | |
| $dir | |
| $flag | |
| $summary | |
Validation of SCORM-XML Files.
Definition at line 33 of file class.ilObjSCORMValidator.php.
| ilObjSCORMValidator::getSummary | ( | ) |
| ilObjSCORMValidator::ilObjSCORMValidator | ( | $ | directory | ) |
Definition at line 72 of file class.ilObjSCORMValidator.php.
{
$this->dir = $directory.'/';
}
| ilObjSCORMValidator::searchDir | ( | $ | dir | ) |
Definition at line 52 of file class.ilObjSCORMValidator.php.
References $dir, $file, and validateXML().
Referenced by validate().
{
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (!eregi("^[\.]{1,2}",$file)) {
//2DO FIXME regex machen dass nur . und .. erkannt werden und nicht .lala. oder so
if (is_dir($dir.$file)) {
// This is commented because subdirecories of my scromexamples contain xml files which aren't valid!
//$this->searchDir($dir.$file."/");
}
if (eregi("(\.xml)$",$file)) {
$this->validateXML($dir.$file);
}
}
}
}
closedir($dh);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjSCORMValidator::validate | ( | ) |
Definition at line 76 of file class.ilObjSCORMValidator.php.
References searchDir().
{
$this->summary = array();
$this->searchDir($this->dir);
if(count($this->summary) == 0)
{
return true;
}
else
{
return false;
}
}
Here is the call graph for this function:| ilObjSCORMValidator::validateXML | ( | $ | file | ) |
Definition at line 36 of file class.ilObjSCORMValidator.php.
References $file, and ilUtil::getJavaPath().
Referenced by searchDir().
{
//echo "<br>".ilUtil::getJavaPath()." -jar ".ILIAS_ABSOLUTE_PATH."/java/vali.jar ".$file." 2>&1";
exec(ilUtil::getJavaPath()." -jar ".ILIAS_ABSOLUTE_PATH."/java/vali.jar ".$file." 2>&1", $error);
if (count($error) != 0)
{
$this->summary[] = "";
$this->summary[] = "<b>File: $file</b>";
foreach($error as $line)
{
$this->summary[] = $line;
//echo "<br><b>".$line."</b>";
}
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjSCORMValidator::$dir |
Definition at line 34 of file class.ilObjSCORMValidator.php.
Referenced by searchDir().
| ilObjSCORMValidator::$flag |
Definition at line 34 of file class.ilObjSCORMValidator.php.
| ilObjSCORMValidator::$summary |
Definition at line 34 of file class.ilObjSCORMValidator.php.
Referenced by getSummary().
1.7.1