function ConvertSchemaString($schema, $newVersion = NULL, $newFile = NULL)
{
// grab current version
if (!($version = $this->SchemaStringVersion($schema))) {
return FALSE;
}
if (!isset($newVersion)) {
$newVersion = $this->schemaVersion;
}
if ($version == $newVersion) {
$result = $schema;
} else {
$result = $this->TransformSchema($schema, 'convert-' . $version . '-' . $newVersion);
}
if (is_string($result) and is_string($newFile) and $fp = fopen($newFile, 'w')) {
fwrite($fp, $result);
fclose($fp);
}
return $result;
}