new DefaultCacheStorage( new DoctrineCacheAdapter( new FilesystemCache(CACHE_PATH) ) ) )); // Add the cache plugin to the client object $guzzle->addSubscriber($cachePlugin); $connect = new Connect($guzzle); $cache = radar_cache(); $connect->setCache(new Cache($cache)); $connect->debug = FALSE; return $connect; } /** * Helper function: create a doctrine file system cache. * * Re-uses the same cache as set in radar_client() for * guzzle, adding a namespace. * * @return Doctrine\Common\Cache\FilesystemCache * Doctrine file system cache. */ function radar_cache() { static $cache = NULL; if (is_null($cache)) { $cache = new FilesystemCache(CACHE_PATH); $cache->setNamespace('radar_'); } return $cache; }