protected function getCurlClient() { $client = new \Buzz\Client\Curl(); $client->setTimeout(5); $client->setVerifyPeer(false); $client->setMaxRedirects(0); $client->setOption(\CURLOPT_CONNECTTIMEOUT, 3); $client->setOption(\CURLOPT_USERAGENT, "baidu-apiclient-php-2.0"); $client->setOption(\CURLOPT_HTTP_VERSION, \CURL_HTTP_VERSION_1_1); $client->setOption(\CURLOPT_POST, false); return $client; }
/** * Gets the 'sonata.media.buzz.connector.curl' service. * * This service is shared. * This method always returns the same instance of the service. * * @return Buzz\Client\Curl A Buzz\Client\Curl instance. */ protected function getSonata_Media_Buzz_Connector_CurlService() { $this->services['sonata.media.buzz.connector.curl'] = $instance = new \Buzz\Client\Curl(); $instance->setIgnoreErrors(true); $instance->setMaxRedirects(5); $instance->setTimeout(5); $instance->setVerifyPeer(true); $instance->setProxy(NULL); return $instance; }
/** * Gets the 'hwi_oauth.http_client' service. * * This service is shared. * This method always returns the same instance of the service. * * @return \Buzz\Client\Curl A Buzz\Client\Curl instance. */ protected function getHwiOauth_HttpClientService() { $this->services['hwi_oauth.http_client'] = $instance = new \Buzz\Client\Curl(); $instance->setVerifyPeer(true); $instance->setTimeout(5); $instance->setMaxRedirects(5); $instance->setIgnoreErrors(true); return $instance; }