Exemplo n.º 1
0
 /**
  * Set the Zend_Http_Client object used for communication
  *
  * @param \Zend\Http\Client $client The client to use for communication
  * @throws \Zend\GData\App\HttpException
  * @return \Zend\GData\App Provides a fluent interface
  */
 public function setHttpClient($client, $applicationId = 'MyCompany-MyApp-1.0', $clientId = null, $developerKey = null)
 {
     if ($client === null) {
         $client = new Http\Client();
     }
     if (!$client instanceof Http\Client) {
         throw new App\HttpException('Argument is not an instance of Zend_Http_Client.');
     }
     if ($clientId != null) {
         $client->getRequest()->headers()->addHeaderLine('X-GData-Client', $clientId);
     }
     if ($developerKey != null) {
         $client->getRequest()->headers()->addHeaderLine('X-GData-Key', 'key=' . $developerKey);
     }
     return parent::setHttpClient($client, $applicationId);
 }
Exemplo n.º 2
0
 /**
  * Set the Zend_Http_Client object used for communication
  *
  * @param \Zend\Http\Client $client The client to use for communication
  * @return \Zend\GData\App Provides a fluent interface
  */
 public function setHttpClient(Http\Client $client = null, $applicationId = 'MyCompany-MyApp-1.0', $clientId = null, $developerKey = null)
 {
     if ($client === null) {
         $client = new Http\Client();
     }
     if ($clientId != null) {
         $client->getRequest()->getHeaders()->addHeaderLine('X-GData-Client', $clientId);
     }
     if ($developerKey != null) {
         $client->getRequest()->getHeaders()->addHeaderLine('X-GData-Key', 'key=' . $developerKey);
     }
     return parent::setHttpClient($client, $applicationId);
 }