/**
  * Check schema
  *
  * @return bool
  */
 function checkSchema()
 {
     if (!is_dir($this->schemapath)) {
         $msg = "HPRIMXML schemas are missing. Please extract them from archive in '{$this->schemapath}/' directory";
         trigger_error($msg, E_USER_WARNING);
         return false;
     }
     if (!is_file($this->schemafilename)) {
         $schema = new CHPrimXMLSchema();
         $schema->importSchemaPackage($this->schemapath);
         $schema->purgeIncludes();
         $schema->purgeImportedNamespaces();
         $schema->save($this->schemafilename);
     }
     return true;
 }