adoSchema::SchemaFileVersion PHP Method

SchemaFileVersion() public method

Call this method to obtain the AXMLS DTD version of the requested XML schema file.
See also: SchemaStringVersion()
public SchemaFileVersion ( string $filename ) : string
$filename string AXMLS schema file
return string Schema version number or FALSE on error
    function SchemaFileVersion($filename)
    {
        // Open the file
        if (!($fp = fopen($filename, 'r'))) {
            // die( 'Unable to open file' );
            return FALSE;
        }
        // Process the file
        while ($data = fread($fp, 4096)) {
            if (preg_match($this->versionRegex, $data, $matches)) {
                return !empty($matches[2]) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
            }
        }
        return FALSE;
    }