function ParseSchemaFile($filename, $returnSchema = FALSE)
{
// Open the file
if (!($fp = fopen($filename, 'r'))) {
// die( 'Unable to open file' );
return FALSE;
}
// do version detection here
if ($this->SchemaFileVersion($filename) != $this->schemaVersion) {
return FALSE;
}
if ($returnSchema) {
$xmlstring = '';
while ($data = fread($fp, 100000)) {
$xmlstring .= $data;
}
return $xmlstring;
}
$this->success = 2;
$xmlParser = $this->create_parser();
// Process the file
while ($data = fread($fp, 4096)) {
if (!xml_parse($xmlParser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xmlParser)), xml_get_current_line_number($xmlParser)));
}
}
xml_parser_free($xmlParser);
return $this->sqlArray;
}