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


PHP Zend_Gdata::put方法代码示例

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


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

示例1: put

 public function put($data, $uri = null, $remainingRedirects = null, $contentType = null, $extraHeaders = null)
 {
     try {
         return parent::put($data, $uri, $remainingRedirects, $contentType, $extraHeaders);
     } catch (Zend_Gdata_App_HttpException $e) {
         self::throwServiceExceptionIfDetected($e);
     }
 }
开发者ID:hackingman,项目名称:TubeX,代码行数:8,代码来源:Gapps.php

示例2: array

		// People without a photo will have this link but no "etag" attribute
		if ( empty( $link->extensionAttributes['http://schemas.google.com/g/2005:etag'] ) )
			continue 2;

		$image_url = $link->href;
	}
	if ( !$image_url )
		continue;

	// Find the photo update URL
	$update_url = false;
	foreach ( $response->link as $link ) {
		if ( 'http://schemas.google.com/contacts/2008/rel#photo' !== $link->rel )
			continue;

		$update_url = $link->href;
	}
	if ( !$update_url )
		continue;

	// Fetch the source image
	$image_request = $source_gdata->get( $image_url );
	$image = $image_request->getBody();

	// Save the image to the destination contact
	$dest_gdata->put( $image, $update_url, null, 'image/*', array( 'If-Match' => '*' ) );

	message( '  Created ' . $entry->title );
}

message( "\nAll done!" );
开发者ID:ninnypants,项目名称:Gmail-Contact-Sync,代码行数:31,代码来源:sync.php

示例3: updateOfuzContactInGmail

 /**
  * Updates user's contact in Gmail while exporting from Ofuz to Gmail.
  * @param array, array : $row (existing contact in Gmail), $entry (contact details to be updated)
  * @return void : sets the status
  */
 function updateOfuzContactInGmail($row, $entry)
 {
     global $_SESSION, $_GET;
     $client = $this->client;
     $gdata = new Zend_Gdata($client);
     $xml = "<?xml version='1.0' encoding='UTF-8' ?>";
     $xml .= "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>";
     $xml .= "<id>" . $row['id'] . "</id>";
     //$xml .= "<updated>".$this->updated."</updated>";
     $xml .= "<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact' />";
     $xml .= "<title type='text'>" . htmlentities($entry['name'], ENT_QUOTES) . "</title>";
     // $xml .= "<content type='text'>".$this->content."</content>";
     $xml .= "<link rel='self' type='application/atom+xml' href='" . $row['link_self'] . "' />";
     $xml .= "<link rel='edit' type='application/atom+xml' href='" . $row['link_edit'] . "' />";
     if ($entry['email_Home']) {
         $xml .= '<gd:email rel="http://schemas.google.com/g/2005#home" address="' . $entry['email_Home'] . '"></gd:email>';
     }
     if ($entry['email_Work']) {
         $xml .= '<gd:email rel="http://schemas.google.com/g/2005#work" address="' . $entry['email_Work'] . '"></gd:email>';
     }
     if ($entry['email_Other']) {
         $xml .= '<gd:email rel="http://schemas.google.com/g/2005#other" address="' . $entry['email_Other'] . '"></gd:email>';
     }
     if ($entry['phone_Mobile'] != "") {
         $xml .= "<gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile' >" . $entry['phone_Mobile'] . "</gd:phoneNumber>";
     }
     if ($entry['phone_Home'] != "") {
         $xml .= "<gd:phoneNumber rel='http://schemas.google.com/g/2005#home' >" . $entry['phone_Home'] . "</gd:phoneNumber>";
     }
     if ($entry['phone_Work'] != "") {
         $xml .= "<gd:phoneNumber rel='http://schemas.google.com/g/2005#work' >" . $entry['phone_Work'] . "</gd:phoneNumber>";
     }
     if ($entry['addr_Work']) {
         $xml .= "<gd:postalAddress rel='http://schemas.google.com/g/2005#work' primary='true'>" . htmlentities($entry['addr_Work'], ENT_QUOTES) . "</gd:postalAddress>";
     }
     if ($entry['addr_Home']) {
         $xml .= "<gd:postalAddress rel='http://schemas.google.com/g/2005#home' >" . htmlentities($entry['addr_Home'], ENT_QUOTES) . "</gd:postalAddress>";
     }
     if ($entry['addr_Other']) {
         $xml .= "<gd:postalAddress rel='http://schemas.google.com/g/2005#other' >" . htmlentities($entry['addr_Other'], ENT_QUOTES) . "</gd:postalAddress>";
     }
     if ($entry['company']) {
         $xml .= "<gd:organization rel='http://schemas.google.com/g/2005#other'>";
         $xml .= "<gd:orgName>" . htmlentities($entry['company'], ENT_QUOTES) . "</gd:orgName>";
         if ($entry['position']) {
             $xml .= "<gd:orgTitle>" . htmlentities($entry['position'], ENT_QUOTES) . "</gd:orgTitle>";
         }
         $xml .= "</gd:organization>";
     }
     $xml .= "</entry>";
     try {
         $retVal = $gdata->put($xml, $row['link_edit']);
         if ($retVal) {
             return true;
         }
     } catch (Exception $e) {
         $status_code = $gdata->getHttpClient()->getLastResponse()->getStatus();
         $this->status_code_desc = $this->getStatusDescription($status_code);
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:65,代码来源:GoogleContactImport.class.php


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