示例#1
0
 /**
  * @param string $url
  * @return array|false
  */
 public function load($url)
 {
     $data = Setup::getInstance()->cacheImplementation->getItem($this->urlToKey($url));
     if ($data->isHit()) {
         return $data->get();
     }
     return false;
 }
示例#2
0
 /**
  * @param string $url
  * @param string $representation
  * @throws \Exception
  * @return Response
  */
 protected static function doGetRequest($url, $representation)
 {
     // use configured fetcher
     return Setup::getInstance()->fetcher->doGetRequest($url, $representation);
 }
示例#3
0
 public function testFileCache()
 {
     Setup::getInstance()->cacheImplementation = new FilePool("/tmp");
     $this->assertTrue(CacheManager::getInstance()->save("mockurl", ['test' => 'something']));
     $this->assertEquals(['test' => 'something'], CacheManager::getInstance()->load("mockurl"));
 }