本文整理汇总了PHP中Zend_Gdata::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata::get方法的具体用法?PHP Zend_Gdata::get怎么用?PHP Zend_Gdata::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata
的用法示例。
在下文中一共展示了Zend_Gdata::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get($uri, $extraHeaders = array())
{
try {
return parent::get($uri, $extraHeaders);
} catch (Zend_Gdata_App_HttpException $e) {
self::throwServiceExceptionIfDetected($e);
}
}
示例2: GoogleContactPhoto
function GoogleContactPhoto($GoogleContactsClient)
{
$data = array();
$lnkPhotoGet = 'http://google.com/m8/feeds/contacts/jayanth.bagare%40gmail.com/full';
$gdata = new Zend_Gdata($GoogleContactsClient);
$query = new Zend_Gdata_Query($lnkPhotoGet);
$query->setMaxResults(10000);
$feed = $gdata->getFeed($query);
foreach ($feed as $entry) {
array_push($data, $entry);
}
$contacts[] = $data;
foreach ($contacts as $entry) {
if ($entry['link_photo']) {
Zend_Loader::loadClass('Zend_Http_Response');
$http_response = $gdata->get($entry['link_photo']);
$rawImage = $http_response->getBody();
$headers = $http_response->getHeaders();
$contentType = $headers["Content-type"];
header("Content-type: " . $contentType);
var_dump($rawImage);
}
}
}
示例3: 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!" );
示例4: get
/**
* GET a uri using client object.
* This method overrides the default behavior of Zend_Gdata_App,
* providing support for Zend_Gdata_Gapps_ServiceException.
*
* @param string $uri
* @throws Zend_Gdata_App_HttpException
* @throws Zend_Gdata_Gapps_ServiceException
* @return Zend_Http_Response
*/
public function get($uri)
{
try {
return parent::get($uri);
} catch (Zend_Gdata_App_HttpException $e) {
self::throwServiceExceptionIfDetected($e);
}
}