/** * {@inheritdoc} */ public function createClient(array $config = []) { if (!class_exists('Http\\Adapter\\Buzz\\Client')) { throw new \LogicException('To use the Buzz adapter you need to install the "php-http/buzz-adapter" package.'); } $client = new FileGetContents(); $options = $this->getOptions($config); $client->setTimeout($options['timeout']); $client->setVerifyPeer($options['verify_peer']); $client->setVerifyHost($options['verify_host']); $client->setProxy($options['proxy']); return new Adapter($client, $this->messageFactory); }
/** * @return Curl|FileGetContents */ public static function getClient() { if (in_array('curl', get_loaded_extensions())) { $client = new Curl(); } else { $client = new FileGetContents(); } $client->setVerifyPeer(false); $client->setVerifyHost(false); return $client; }