public function testUnRegister()
 {
     EasyRdf_Format::unregister('my');
     $this->assertFalse(EasyRdf_Format::formatExists('my'));
 }
예제 #2
0
파일: Model.php 프로젝트: jneubert/Skosmos
 public function getResourceFromUri($uri)
 {
     EasyRdf_Format::unregister('json');
     // prevent parsing errors for sources which return invalid JSON
     // using apc cache for the resource if available
     if (function_exists('apc_store') && function_exists('apc_fetch')) {
         $key = 'fetch: ' . EasyRdf_Utils::removeFragmentFromUri($uri);
         $resource = apc_fetch($key);
         if ($resource === null || $resource === false) {
             // was not found in cache, or previous request failed
             $resource = $this->fetchResourceFromUri($uri);
             apc_store($key, $resource, $this->URI_FETCH_TTL);
         }
     } else {
         // APC not available, parse on every request
         $resource = $this->fetchResourceFromUri($uri);
     }
     return $resource;
 }
 public function testUnRegister()
 {
     EasyRdf_Format::unregister('my');
     assert(!EasyRdf_Format::formatExists('my'));
 }