コード例 #1
0
ファイル: OntologyUpdater.php プロジェクト: nagyist/tao-core
 protected static function logDiff(\helpers_RdfDiff $diff)
 {
     $folder = FILES_PATH . 'updates' . DIRECTORY_SEPARATOR;
     $updateId = time();
     while (file_exists($folder . $updateId)) {
         $count = isset($count) ? $count + 1 : 0;
         $updateId = time() . '_' . $count;
     }
     $path = $folder . $updateId;
     if (!mkdir($path, 0700, true)) {
         throw new \common_exception_Error('Unable to log update to ' . $path);
     }
     FileModel::toFile($path . DIRECTORY_SEPARATOR . 'add.rdf', $diff->getTriplesToAdd());
     FileModel::toFile($path . DIRECTORY_SEPARATOR . 'remove.rdf', $diff->getTriplesToRemove());
 }