/** * @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; }
/** * @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); }
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")); }