Пример #1
0
 }
 if ((bool) $job->getParam('onlyNewConcepts')) {
     $arguments[] = '--onlyNewConcepts';
 }
 if ((bool) $job->getParam('useUriAsIdentifier')) {
     $arguments[] = '--useUriAsIdentifier';
 }
 $arguments[] = '--commit';
 $duplicateConceptSchemes = array();
 $notImportedNotations = array();
 foreach ($importFiles as $filePath) {
     $parserOpts = new Zend_Console_Getopt(OpenSKOS_Rdf_Parser::$get_opts);
     $parserOpts->setArguments(array_merge($arguments, array($filePath)));
     // The last argument must be the file path.
     try {
         $parser = OpenSKOS_Rdf_Parser::factory($parserOpts);
         $parser->process($job['user']);
         $duplicateConceptSchemes = array_merge($duplicateConceptSchemes, $parser->getDuplicateConceptSchemes());
         $notImportedNotations = array_merge($notImportedNotations, $parser->getNotImportedNotations());
     } catch (Exception $e) {
         $model = new OpenSKOS_Db_Table_Jobs();
         // Gets new DB object to prevent connection time out.
         $job = $model->find($job->id)->current();
         // Gets new DB object to prevent connection time out.
         fwrite(STDERR, $job->id . ': ' . $e->getMessage() . "\n");
         $job->error($e->getMessage())->finish()->save();
         exit($e->getCode());
     }
 }
 // Delete extracted files when done.
 $job->cleanFiles();