当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Gdata::getHttpClient方法代码示例

本文整理汇总了PHP中Zend_Gdata::getHttpClient方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata::getHttpClient方法的具体用法?PHP Zend_Gdata::getHttpClient怎么用?PHP Zend_Gdata::getHttpClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Gdata的用法示例。


在下文中一共展示了Zend_Gdata::getHttpClient方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSpecificHttpClient

 public function testSpecificHttpClient()
 {
     $client = new Zend_Http_Client();
     $gdata = new Zend_Gdata($client);
     $client2 = $gdata->getHttpClient();
     $this->assertTrue($client2 instanceof Zend_Http_Client, 'Expecting object of type Zend_Http_Client, got ' . (gettype($client) == 'object' ? get_class($client) : gettype($client)));
     $this->assertSame($client, $client2);
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:8,代码来源:GdataTest.php

示例2: testSpecificHttpClient

 public function testSpecificHttpClient()
 {
     $client = new Zend_Http_Client();
     $gdata = new Zend_Gdata($client);
     $this->assertSame($client, $gdata->getHttpClient());
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:6,代码来源:GdataTest.php

示例3: storeGmailEmailsTemprorily

 /**
  * retrieves email ids for all the contacts from Gmail and stores in Ofuz DB temprorily.
  *
  * @return void
  * @see Gdata
  */
 function storeGmailEmailsTemprorily()
 {
     global $_SESSION, $_GET;
     $client = $this->client;
     $useremailid = urlencode($_SESSION["uEmail"]);
     // Create a Gdata object using the authenticated Http Client
     $gdata = new Zend_Gdata($client);
     //$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/'.$_SESSION["uEmail"].'%40gmail.com/full');
     $query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/' . $useremailid . '/full');
     $query->setMaxResults(1000);
     try {
         $feed = $gdata->getFeed($query);
         if ($feed) {
             $q_email = new sqlQuery($this->getDbCon());
             foreach ($feed as $entry) {
                 // retrieving emails
                 $extensionElements = $entry->getExtensionElements();
                 foreach ($extensionElements as $extensionElement) {
                     //emails
                     if ($extensionElement->rootNamespaceURI == "http://schemas.google.com/g/2005" && $extensionElement->rootElement == "email") {
                         $attributes = $extensionElement->getExtensionAttributes();
                         if (array_key_exists('address', $attributes)) {
                             if ($attributes['rel']['value'] == "http://schemas.google.com/g/2005#home") {
                                 //$data['em_home'] = $attributes['address']['value'];
                                 $sql_email_ins = "INSERT INTO \n                                                              temp_gmail_emails(email_address)\n                                                              VALUES('" . $attributes['address']['value'] . "')\n                                                            ";
                                 $q_email->query($sql_email_ins);
                             }
                             if ($attributes['rel']['value'] == "http://schemas.google.com/g/2005#work") {
                                 $sql_email_ins = "INSERT INTO \n                                                              temp_gmail_emails(email_address)\n                                                              VALUES('" . $attributes['address']['value'] . "')\n                                                            ";
                                 $q_email->query($sql_email_ins);
                             }
                             if ($attributes['rel']['value'] == "http://schemas.google.com/g/2005#other") {
                                 $sql_email_ins = "INSERT INTO \n                                                              temp_gmail_emails(email_address)\n                                                              VALUES('" . $attributes['address']['value'] . "')\n                                                            ";
                                 $q_email->query($sql_email_ins);
                             }
                         }
                     }
                 }
             }
             $q_email->free();
         }
     } catch (Exception $e) {
         $status_code = $gdata->getHttpClient()->getLastResponse()->getStatus();
         $this->status_code_desc = $this->getStatusDescription($status_code);
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:52,代码来源:GoogleContactImport.class.php


注:本文中的Zend_Gdata::getHttpClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。