public function __construct(Client $client) { if (!extension_loaded('curl')) { $error = 'The cURL IO handler requires the cURL extension to be enabled'; $client->getLogger()->critical($error); throw new Exception($error); } parent::__construct($client); $this->disableProxyWorkaround = $this->client->getClassConfig('Curl', 'disable_proxy_workaround'); }
/** * @visible for testing. * @param Request $request * @return Request|bool Returns the cached object or * false if the operation was unsuccessful. */ public function getCachedRequest(Request $request) { if (false === CacheParser::isRequestCacheable($request)) { return false; } return $this->client->getCache()->get($request->getCacheKey()); }