import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -16,7 +16,7 @@
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -47,24 +47,25 @@ require_once 'Zend/Gdata/App/MediaSource.php';
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @subpackage App
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_App
{
/** Default major protocol version.
*
*
* @see _majorProtocolVersion
*/
const DEFAULT_MAJOR_PROTOCOL_VERSION = 1;
/** Default minor protocol version.
*
* @see _minorProtocolVersion
*/
const DEFAULT_MINOR_PROTOCOL_VERSION = null;
/**
* Client object used to communicate
*
@ -128,7 +129,7 @@ class Zend_Gdata_App
* Indicates the major protocol version that should be used.
* At present, recognized values are either 1 or 2. However, any integer
* value >= 1 is considered valid.
*
*
* Under most circumtances, this will be automatically set by
* Zend_Gdata_App subclasses.
*
@ -141,10 +142,10 @@ class Zend_Gdata_App
* Indicates the minor protocol version that should be used. Can be set
* to either an integer >= 0, or NULL if no minor version should be sent
* to the server.
*
*
* At present, this field is not used by any Google services, but may be
* used in the future.
*
*
* Under most circumtances, this will be automatically set by
* Zend_Gdata_App subclasses.
*
@ -153,6 +154,13 @@ class Zend_Gdata_App
*/
protected $_minorProtocolVersion;
/**
* Whether we want to use XML to object mapping when fetching data.
*
* @var boolean
*/
protected $_useObjectMapping = true;
/**
* Create Gdata object
*
@ -182,27 +190,33 @@ class Zend_Gdata_App
}
/**
* Retreive feed object
* Retrieve feed as string or object
*
* @param string $uri The uri from which to retrieve the feed
* @param string $className The class which is used as the return type
* @return Zend_Gdata_App_Feed
* @return string|Zend_Gdata_App_Feed Returns string only if the object
* mapping has been disabled explicitly
* by passing false to the
* useObjectMapping() function.
*/
public function getFeed($uri, $className='Zend_Gdata_App_Feed')
{
return $this->importUrl($uri, $className);
return $this->importUrl($uri, $className, null);
}
/**
* Retreive entry object
* Retrieve entry as string or object
*
* @param string $uri
* @param string $className The class which is used as the return type
* @return Zend_Gdata_App_Entry
* @return string|Zend_Gdata_App_Entry Returns string only if the object
* mapping has been disabled explicitly
* by passing false to the
* useObjectMapping() function.
*/
public function getEntry($uri, $className='Zend_Gdata_App_Entry')
{
return $this->importUrl($uri, $className);
return $this->importUrl($uri, $className, null);
}
/**
@ -222,16 +236,19 @@ class Zend_Gdata_App
* @throws Zend_Gdata_App_HttpException
* @return Zend_Gdata_App Provides a fluent interface
*/
public function setHttpClient($client, $applicationId = 'MyCompany-MyApp-1.0')
public function setHttpClient($client,
$applicationId = 'MyCompany-MyApp-1.0')
{
if ($client === null) {
$client = new Zend_Http_Client();
}
if (!$client instanceof Zend_Http_Client) {
require_once 'Zend/Gdata/App/HttpException.php';
throw new Zend_Gdata_App_HttpException('Argument is not an instance of Zend_Http_Client.');
throw new Zend_Gdata_App_HttpException(
'Argument is not an instance of Zend_Http_Client.');
}
$userAgent = $applicationId . ' Zend_Framework_Gdata/' . Zend_Version::VERSION;
$userAgent = $applicationId . ' Zend_Framework_Gdata/' .
Zend_Version::VERSION;
$client->setHeaders('User-Agent', $userAgent);
$client->setConfig(array(
'strictredirects' => true
@ -382,7 +399,7 @@ class Zend_Gdata_App
/**
* Set the major protocol version that should be used. Values < 1 will
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
*
*
* @see _majorProtocolVersion
* @param int $value The major protocol version to use.
* @throws Zend_Gdata_App_InvalidArgumentException
@ -399,7 +416,7 @@ class Zend_Gdata_App
/**
* Get the major protocol version that is in use.
*
*
* @see _majorProtocolVersion
* @return int The major protocol version in use.
*/
@ -407,12 +424,12 @@ class Zend_Gdata_App
{
return $this->_majorProtocolVersion;
}
/**
* Set the minor protocol version that should be used. If set to NULL, no
* minor protocol version will be sent to the server. Values < 0 will
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
*
*
* @see _minorProtocolVersion
* @param (int|NULL) $value The minor protocol version to use.
* @throws Zend_Gdata_App_InvalidArgumentException
@ -426,10 +443,10 @@ class Zend_Gdata_App
}
$this->_minorProtocolVersion = $value;
}
/**
* Get the minor protocol version that is in use.
*
*
* @see _minorProtocolVersion
* @return (int|NULL) The major protocol version in use, or NULL if no
* minor version is specified.
@ -438,9 +455,9 @@ class Zend_Gdata_App
{
return $this->_minorProtocolVersion;
}
/**
* Provides pre-processing for HTTP requests to APP services.
* Provides pre-processing for HTTP requests to APP services.
*
* 1. Checks the $data element and, if it's an entry, extracts the XML,
* multipart data, edit link (PUT,DELETE), etc.
@ -470,10 +487,10 @@ class Zend_Gdata_App
{
// As a convenience, if $headers is null, we'll convert it back to
// an empty array.
if (is_null($headers)) {
if ($headers === null) {
$headers = array();
}
$rawData = null;
$finalContentType = null;
if ($url == null) {
@ -488,7 +505,7 @@ class Zend_Gdata_App
} elseif ($data instanceof Zend_Gdata_App_MediaEntry) {
$rawData = $data->encode();
if ($data->getMediaSource() !== null) {
$finalContentType = 'multipart/related; boundary="' . $data->getBoundary() . '"';
$finalContentType = $rawData->getContentType();
$headers['MIME-version'] = '1.0';
$headers['Slug'] = $data->getMediaSource()->getSlug();
} else {
@ -496,7 +513,7 @@ class Zend_Gdata_App
}
if ($method == 'PUT' || $method == 'DELETE') {
$editLink = $data->getEditLink();
if ($editLink != null) {
if ($editLink != null && $url == null) {
$url = $editLink->getHref();
}
}
@ -516,18 +533,18 @@ class Zend_Gdata_App
}
$finalContentType = $data->getContentType();
}
if ($method == 'DELETE') {
$rawData = null;
}
// Set an If-Match header if:
// - This isn't a DELETE
// - If this isn't a GET, the Etag isn't weak
// - A similar header (If-Match/If-None-Match) hasn't already been
// - A similar header (If-Match/If-None-Match) hasn't already been
// set.
if ($method != 'DELETE' && (
!array_key_exists('If-Match', $headers) &&
!array_key_exists('If-Match', $headers) &&
!array_key_exists('If-None-Match', $headers)
) ) {
$allowWeak = $method == 'GET';
@ -536,7 +553,7 @@ class Zend_Gdata_App
$headers['If-Match'] = $ifMatchHeader;
}
}
if ($method != 'POST' && $method != 'GET' && Zend_Gdata_App::getHttpMethodOverride()) {
$headers['x-http-method-override'] = $method;
$method = 'POST';
@ -547,8 +564,10 @@ class Zend_Gdata_App
if ($contentTypeOverride != null) {
$finalContentType = $contentTypeOverride;
}
return array('method' => $method, 'url' => $url, 'data' => $rawData, 'headers' => $headers, 'contentType' => $finalContentType);
return array('method' => $method, 'url' => $url,
'data' => $rawData, 'headers' => $headers,
'contentType' => $finalContentType);
}
/**
@ -566,7 +585,8 @@ class Zend_Gdata_App
* s results in one
* @return Zend_Http_Response The response object
*/
public function performHttpRequest($method, $url, $headers = null, $body = null, $contentType = null, $remainingRedirects = null)
public function performHttpRequest($method, $url, $headers = null,
$body = null, $contentType = null, $remainingRedirects = null)
{
require_once 'Zend/Http/Client/Exception.php';
if ($remainingRedirects === null) {
@ -581,11 +601,12 @@ class Zend_Gdata_App
$minor = $this->getMinorProtocolVersion();
if ($major >= 2) {
$headers['GData-Version'] = $major +
(is_null($minor) ? '.' + $minor : '');
(($minor === null) ? '.' + $minor : '');
}
// check the overridden method
if (($method == 'POST' || $method == 'PUT') && $body === null && $headers['x-http-method-override'] != 'DELETE') {
if (($method == 'POST' || $method == 'PUT') && $body === null &&
$headers['x-http-method-override'] != 'DELETE') {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'You must specify the data to post as either a ' .
@ -593,14 +614,17 @@ class Zend_Gdata_App
}
if ($url === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException('You must specify an URI to which to post.');
throw new Zend_Gdata_App_InvalidArgumentException(
'You must specify an URI to which to post.');
}
$headers['Content-Type'] = $contentType;
if (Zend_Gdata_App::getGzipEnabled()) {
// some services require the word 'gzip' to be in the user-agent header
// in addition to the accept-encoding header
if (strpos($this->_httpClient->getHeader('User-Agent'), 'gzip') === false) {
$headers['User-Agent'] = $this->_httpClient->getHeader('User-Agent') . ' (gzip)';
// some services require the word 'gzip' to be in the user-agent
// header in addition to the accept-encoding header
if (strpos($this->_httpClient->getHeader('User-Agent'),
'gzip') === false) {
$headers['User-Agent'] =
$this->_httpClient->getHeader('User-Agent') . ' (gzip)';
}
$headers['Accept-encoding'] = 'gzip, deflate';
} else {
@ -617,17 +641,48 @@ class Zend_Gdata_App
$this->_httpClient->setHeaders($headers);
$this->_httpClient->setUri($url);
$this->_httpClient->setConfig(array('maxredirects' => 0));
$this->_httpClient->setRawData($body, $contentType);
// Set the proper adapter if we are handling a streaming upload
$usingMimeStream = false;
$oldHttpAdapter = null;
if ($body instanceof Zend_Gdata_MediaMimeStream) {
$usingMimeStream = true;
$this->_httpClient->setRawDataStream($body, $contentType);
$oldHttpAdapter = $this->_httpClient->getAdapter();
if ($oldHttpAdapter instanceof Zend_Http_Client_Adapter_Proxy) {
require_once 'Zend/Gdata/HttpAdapterStreamingProxy.php';
$newAdapter = new Zend_Gdata_HttpAdapterStreamingProxy();
} else {
require_once 'Zend/Gdata/HttpAdapterStreamingSocket.php';
$newAdapter = new Zend_Gdata_HttpAdapterStreamingSocket();
}
$this->_httpClient->setAdapter($newAdapter);
} else {
$this->_httpClient->setRawData($body, $contentType);
}
try {
$response = $this->_httpClient->request($method);
// reset adapter
if ($usingMimeStream) {
$this->_httpClient->setAdapter($oldHttpAdapter);
}
} catch (Zend_Http_Client_Exception $e) {
// reset adapter
if ($usingMimeStream) {
$this->_httpClient->setAdapter($oldHttpAdapter);
}
require_once 'Zend/Gdata/App/HttpException.php';
throw new Zend_Gdata_App_HttpException($e->getMessage(), $e);
}
if ($response->isRedirect() && $response->getStatus() != '304') {
if ($remainingRedirects > 0) {
$newUrl = $response->getHeader('Location');
$response = $this->performHttpRequest($method, $newUrl, $headers, $body, $contentType, $remainingRedirects);
$response = $this->performHttpRequest(
$method, $newUrl, $headers, $body,
$contentType, $remainingRedirects);
} else {
require_once 'Zend/Gdata/App/HttpException.php';
throw new Zend_Gdata_App_HttpException(
@ -636,7 +691,8 @@ class Zend_Gdata_App
}
if (!$response->isSuccessful()) {
require_once 'Zend/Gdata/App/HttpException.php';
$exceptionMessage = 'Expected response code 200, got ' . $response->getStatus();
$exceptionMessage = 'Expected response code 200, got ' .
$response->getStatus();
if (self::getVerboseExceptionMessages()) {
$exceptionMessage .= "\n" . $response->getBody();
}
@ -654,15 +710,23 @@ class Zend_Gdata_App
* @param Zend_Http_Client $client The client used for communication
* @param string $className The class which is used as the return type
* @throws Zend_Gdata_App_Exception
* @return Zend_Gdata_App_Feed
* @return string|Zend_Gdata_App_Feed Returns string only if the object
* mapping has been disabled explicitly
* by passing false to the
* useObjectMapping() function.
*/
public static function import($uri, $client = null, $className='Zend_Gdata_App_Feed')
public static function import($uri, $client = null,
$className='Zend_Gdata_App_Feed')
{
$app = new Zend_Gdata_App($client);
$requestData = $app->prepareRequest('GET', $uri);
$response = $app->performHttpRequest($requestData['method'], $requestData['url']);
$response = $app->performHttpRequest(
$requestData['method'], $requestData['url']);
$feedContent = $response->getBody();
if (!$this->_useObjectMapping) {
return $feedContent;
}
$feed = self::importString($feedContent, $className);
if ($client != null) {
$feed->setHttpClient($client);
@ -678,23 +742,43 @@ class Zend_Gdata_App
* @param array $extraHeaders Extra headers to add to the request, as an
* array of string-based key/value pairs.
* @throws Zend_Gdata_App_Exception
* @return Zend_Gdata_App_Feed
* @return string|Zend_Gdata_App_Feed Returns string only if the object
* mapping has been disabled explicitly
* by passing false to the
* useObjectMapping() function.
*/
public function importUrl($url, $className='Zend_Gdata_App_Feed', $extraHeaders = array())
public function importUrl($url, $className='Zend_Gdata_App_Feed',
$extraHeaders = array())
{
$response = $this->get($url, $extraHeaders);
$feedContent = $response->getBody();
$feed = self::importString($feedContent, $className);
$etag = $response->getHeader('ETag');
if (!is_null($etag)) {
$feed->setEtag($etag);
if (!$this->_useObjectMapping) {
return $feedContent;
}
$protocolVersionStr = $response->getHeader('GData-Version');
$majorProtocolVersion = null;
$minorProtocolVersion = null;
if ($protocolVersionStr !== null) {
// Extract protocol major and minor version from header
$delimiterPos = strpos($protocolVersionStr, '.');
$length = strlen($protocolVersionStr);
$major = substr($protocolVersionStr, 0, $delimiterPos);
$minor = substr($protocolVersionStr, $delimiterPos + 1, $length);
$majorProtocolVersion = $major;
$minorProtocolVersion = $minor;
}
$feed = self::importString($feedContent, $className,
$majorProtocolVersion, $minorProtocolVersion);
if ($this->getHttpClient() != null) {
$feed->setHttpClient($this->getHttpClient());
}
$etag = $response->getHeader('ETag');
if ($etag !== null) {
$feed->setEtag($etag);
}
return $feed;
}
@ -702,12 +786,18 @@ class Zend_Gdata_App
/**
* Imports a feed represented by $string.
*
* @param string $string
* @param string $className The class which is used as the return type
* @param string $string
* @param string $className The class which is used as the return type
* @param integer $majorProcolVersion (optional) The major protocol version
* of the data model object that is to be created.
* @param integer $minorProcolVersion (optional) The minor protocol version
* of the data model object that is to be created.
* @throws Zend_Gdata_App_Exception
* @return Zend_Gdata_App_Feed
*/
public static function importString($string, $className='Zend_Gdata_App_Feed')
public static function importString($string,
$className='Zend_Gdata_App_Feed', $majorProtocolVersion = null,
$minorProtocolVersion = null)
{
// Load the feed as an XML DOMDocument object
@ini_set('track_errors', 1);
@ -717,9 +807,14 @@ class Zend_Gdata_App
if (!$success) {
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception("DOMDocument cannot parse XML: $php_errormsg");
throw new Zend_Gdata_App_Exception(
"DOMDocument cannot parse XML: $php_errormsg");
}
$feed = new $className($string);
$feed = new $className();
$feed->setMajorProtocolVersion($majorProtocolVersion);
$feed->setMinorProtocolVersion($minorProtocolVersion);
$feed->transferFromXML($string);
$feed->setHttpClient(self::getstaticHttpClient());
return $feed;
}
@ -742,7 +837,8 @@ class Zend_Gdata_App
@ini_restore('track_errors');
if ($feed === false) {
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception("File could not be loaded: $php_errormsg");
throw new Zend_Gdata_App_Exception(
"File could not be loaded: $php_errormsg");
}
return self::importString($feed, $className);
}
@ -759,7 +855,9 @@ class Zend_Gdata_App
public function get($uri, $extraHeaders = array())
{
$requestData = $this->prepareRequest('GET', $uri, $extraHeaders);
return $this->performHttpRequest($requestData['method'], $requestData['url'], $requestData['headers']);
return $this->performHttpRequest(
$requestData['method'], $requestData['url'],
$requestData['headers']);
}
/**
@ -779,8 +877,8 @@ class Zend_Gdata_App
public function post($data, $uri = null, $remainingRedirects = null,
$contentType = null, $extraHeaders = null)
{
$requestData = $this->prepareRequest('POST', $uri, $extraHeaders,
$data, $contentType);
$requestData = $this->prepareRequest(
'POST', $uri, $extraHeaders, $data, $contentType);
return $this->performHttpRequest(
$requestData['method'], $requestData['url'],
$requestData['headers'], $requestData['data'],
@ -804,7 +902,8 @@ class Zend_Gdata_App
public function put($data, $uri = null, $remainingRedirects = null,
$contentType = null, $extraHeaders = null)
{
$requestData = $this->prepareRequest('PUT', $uri, $extraHeaders, $data, $contentType);
$requestData = $this->prepareRequest(
'PUT', $uri, $extraHeaders, $data, $contentType);
return $this->performHttpRequest(
$requestData['method'], $requestData['url'],
$requestData['headers'], $requestData['data'],
@ -826,11 +925,12 @@ class Zend_Gdata_App
$requestData = $this->prepareRequest('DELETE', $data);
} else {
$headers = array();
$requestData = $this->prepareRequest('DELETE', null, $headers, $data);
$requestData = $this->prepareRequest(
'DELETE', null, $headers, $data);
}
return $this->performHttpRequest($requestData['method'],
$requestData['url'],
$requestData['url'],
$requestData['headers'],
'',
$requestData['contentType'],
@ -838,26 +938,30 @@ class Zend_Gdata_App
}
/**
* Inserts an entry to a given URI and returns the response as a fully formed Entry.
* Inserts an entry to a given URI and returns the response as a
* fully formed Entry.
*
* @param mixed $data The Zend_Gdata_App_Entry or XML to post
* @param string $uri POST URI
* @param string $className The class of entry to be returned.
* @param array $extraHeaders Extra headers to add to the request, as an
* array of string-based key/value pairs.
* @return Zend_Gdata_App_Entry The entry returned by the service after insertion.
* @return Zend_Gdata_App_Entry The entry returned by the service after
* insertion.
*/
public function insertEntry($data, $uri, $className='Zend_Gdata_App_Entry', $extraHeaders = array())
public function insertEntry($data, $uri, $className='Zend_Gdata_App_Entry',
$extraHeaders = array())
{
$response = $this->post($data, $uri, null, null, $extraHeaders);
$returnEntry = new $className($response->getBody());
$returnEntry->setHttpClient(self::getstaticHttpClient());
$etag = $response->getHeader('ETag');
if (!is_null($etag)) {
if ($etag !== null) {
$returnEntry->setEtag($etag);
}
return $returnEntry;
}
@ -875,7 +979,8 @@ class Zend_Gdata_App
* @return Zend_Gdata_App_Entry The entry returned from the server
* @throws Zend_Gdata_App_Exception
*/
public function updateEntry($data, $uri = null, $className = null, $extraHeaders = array())
public function updateEntry($data, $uri = null, $className = null,
$extraHeaders = array())
{
if ($className === null && $data instanceof Zend_Gdata_App_Entry) {
$className = get_class($data);
@ -886,12 +991,12 @@ class Zend_Gdata_App
$response = $this->put($data, $uri, null, null, $extraHeaders);
$returnEntry = new $className($response->getBody());
$returnEntry->setHttpClient(self::getstaticHttpClient());
$etag = $response->getHeader('ETag');
if (!is_null($etag)) {
if ($etag !== null) {
$returnEntry->setEtag($etag);
}
return $returnEntry;
}
@ -915,8 +1020,11 @@ class Zend_Gdata_App
$foundClassName = null;
foreach ($this->_registeredPackages as $name) {
try {
@Zend_Loader::loadClass("${name}_${class}");
$foundClassName = "${name}_${class}";
if (!class_exists($name . '_' . $class)) {
require_once 'Zend/Loader.php';
@Zend_Loader::loadClass($name . '_' . $class);
}
$foundClassName = $name . '_' . $class;
break;
} catch (Zend_Exception $e) {
// package wasn't here- continue searching
@ -927,6 +1035,12 @@ class Zend_Gdata_App
$instance = $reflectionObj->newInstanceArgs($args);
if ($instance instanceof Zend_Gdata_App_FeedEntryParent) {
$instance->setHttpClient($this->_httpClient);
// Propogate version data
$instance->setMajorProtocolVersion(
$this->_majorProtocolVersion);
$instance->setMinorProtocolVersion(
$this->_minorProtocolVersion);
}
return $instance;
} else {
@ -1006,7 +1120,7 @@ class Zend_Gdata_App
}
$nextLinkHref = $nextLink->getHref();
if (is_null($className)) {
if ($className === null) {
$className = get_class($feed);
}
@ -1033,7 +1147,7 @@ class Zend_Gdata_App
}
$previousLinkHref = $previousLink->getHref();
if (is_null($className)) {
if ($className === null) {
$className = get_class($feed);
}
@ -1056,12 +1170,39 @@ class Zend_Gdata_App
if ($this->_majorProtocolVersion >= 2 &&
$data instanceof Zend_Gdata_App_Entry) {
$etag = $data->getEtag();
if (!is_null($etag) &&
if (($etag !== null) &&
($allowWeek || substr($etag, 0, 2) != 'W/')) {
$result = $data->getEtag();
}
}
return $result;
}
/**
* Determine whether service object is using XML to object mapping.
*
* @return boolean True if service object is using XML to object mapping,
* false otherwise.
*/
public function usingObjectMapping()
{
return $this->_useObjectMapping;
}
/**
* Enable/disable the use of XML to object mapping.
*
* @param boolean $value Pass in true to use the XML to object mapping.
* Pass in false or null to disable it.
* @return void
*/
public function useObjectMapping($value)
{
if ($value === True) {
$this->_useObjectMapping = true;
} else {
$this->_useObjectMapping = false;
}
}
}

View File

@ -31,7 +31,7 @@ require_once 'Zend/Gdata/App/Exception.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Zend_Gdata_App
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -32,6 +32,7 @@ require_once 'Zend/Gdata/App/Exception.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -20,12 +20,17 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_App_Util
*/
require_once 'Zend/Gdata/App/Util.php';
/**
* Abstract class for all XML elements
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -63,6 +68,14 @@ abstract class Zend_Gdata_App_Base
*/
protected $_text = null;
/**
* @var array Memoized results from calls to lookupNamespace() to avoid
* expensive calls to getGreatestBoundedValue(). The key is in the
* form 'prefix-majorVersion-minorVersion', and the value is the
* output from getGreatestBoundedValue().
*/
protected static $_namespaceLookupCache = array();
/**
* List of namespaces, as a three-dimensional array. The first dimension
* represents the namespace prefix, the second dimension represents the
@ -75,9 +88,10 @@ abstract class Zend_Gdata_App_Base
*
* @see lookupNamespace()
* @see registerNamespace()
* @see registerAllNamespaces()
* @var array
*/
protected $_namespaces = array(
protected $_namespaces = array(
'atom' => array(
1 => array(
0 => 'http://www.w3.org/2005/Atom'
@ -91,7 +105,7 @@ abstract class Zend_Gdata_App_Base
0 => 'http://www.w3.org/2007/app'
)
)
);
);
public function __construct()
{
@ -152,8 +166,8 @@ abstract class Zend_Gdata_App_Base
/**
* Returns an array of all extension attributes not transformed into data
* model properties during parsing of the XML. Each element of the array
* is a hashed array of the format:
* model properties during parsing of the XML. Each element of the array
* is a hashed array of the format:
* array('namespaceUri' => string, 'name' => string, 'value' => string);
*
* @return array All extension attributes
@ -165,8 +179,8 @@ abstract class Zend_Gdata_App_Base
/**
* Sets an array of all extension attributes not transformed into data
* model properties during parsing of the XML. Each element of the array
* is a hashed array of the format:
* model properties during parsing of the XML. Each element of the array
* is a hashed array of the format:
* array('namespaceUri' => string, 'name' => string, 'value' => string);
* This can be used to add arbitrary attributes to any data model element
*
@ -191,7 +205,7 @@ abstract class Zend_Gdata_App_Base
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
if (is_null($doc)) {
if ($doc === null) {
$doc = new DOMDocument('1.0', 'utf-8');
}
if ($this->_rootNamespaceURI != null) {
@ -325,7 +339,7 @@ abstract class Zend_Gdata_App_Base
{
return $this->saveXML();
}
/**
* Alias for saveXML()
*
@ -358,9 +372,15 @@ abstract class Zend_Gdata_App_Base
$majorVersion = 1,
$minorVersion = null)
{
// Check for a memoized result
$key = $prefix . ' ' .
(is_null($majorVersion) ? 'NULL' : $majorVersion) .
' '. (is_null($minorVersion) ? 'NULL' : $minorVersion);
if (array_key_exists($key, self::$_namespaceLookupCache))
return self::$_namespaceLookupCache[$key];
// If no match, return the prefix by default
$result = $prefix;
// Find tuple of keys that correspond to the namespace we should use
if (isset($this->_namespaces[$prefix])) {
// Major version search
@ -374,7 +394,10 @@ abstract class Zend_Gdata_App_Base
// Extract NS
$result = $nsData[$foundMinorV];
}
// Memoize result
self::$_namespaceLookupCache[$key] = $result;
return $result;
}
@ -385,6 +408,12 @@ abstract class Zend_Gdata_App_Base
* list of registered namespaces for use by
* $this->lookupNamespace().
*
* WARNING: Currently, registering a namespace will NOT invalidate any
* memoized data stored in $_namespaceLookupCache. Under normal
* use, this behavior is acceptable. If you are adding
* contradictory data to the namespace lookup table, you must
* call flushNamespaceLookupCache().
*
* @param string $prefix The namespace prefix
* @param string $namespaceUri The full namespace URI
* @param integer $majorVersion The major protocol version in effect.
@ -396,12 +425,43 @@ abstract class Zend_Gdata_App_Base
public function registerNamespace($prefix,
$namespaceUri,
$majorVersion = 1,
$minorVersion = null)
$minorVersion = 0)
{
$this->_namespaces[$prefix][$majorVersion][$minorVersion] =
$namespaceUri;
$namespaceUri;
}
/**
* Flush namespace lookup cache.
*
* Empties the namespace lookup cache. Call this function if you have
* added data to the namespace lookup table that contradicts values that
* may have been cached during a previous call to lookupNamespace().
*/
public static function flushNamespaceLookupCache()
{
self::$_namespaceLookupCache = array();
}
/**
* Add an array of namespaces to the registered list.
*
* Takes an array in the format of:
* namespace prefix, namespace URI, major protocol version,
* minor protocol version and adds them with calls to ->registerNamespace()
*
* @param array $namespaceArray An array of namespaces.
* @return void
*/
public function registerAllNamespaces($namespaceArray)
{
foreach($namespaceArray as $namespace) {
$this->registerNamespace(
$namespace[0], $namespace[1], $namespace[2], $namespace[3]);
}
}
/**
* Magic getter to allow access like $entry->foo to call $entry->getFoo()
* Alternatively, if no getFoo() is defined, but a $_foo protected variable
@ -442,7 +502,7 @@ abstract class Zend_Gdata_App_Base
$method = 'set'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method), $val);
} else if (isset($this->{'_' . $name}) || is_null($this->{'_' . $name})) {
} else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
$this->{'_' . $name} = $val;
} else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/MediaSource.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -51,8 +52,8 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
* @var string
*/
protected $_slug = null;
/**
/**
* The content type for the attached file (example image/png)
*
* @return string The content type
@ -62,7 +63,7 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
return $this->_contentType;
}
/**
/**
* Set the content type for the file attached (example image/png)
*
* @param string $value The content type
@ -75,7 +76,7 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
}
/**
* Returns the Slug header value. Used by some services to determine the
* Returns the Slug header value. Used by some services to determine the
* title for the uploaded file. Returns null if no slug should be used.
*
* @return string
@ -85,7 +86,7 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
}
/**
* Sets the Slug header value. Used by some services to determine the
* Sets the Slug header value. Used by some services to determine the
* title for the uploaded file. A null value indicates no slug header.
*
* @var string The slug value
@ -135,7 +136,7 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
$method = 'set'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method), $val);
} else if (isset($this->{'_' . $name}) || is_null($this->{'_' . $name})) {
} else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
$this->{'_' . $name} = $val;
} else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
@ -173,5 +174,5 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
}
}
}
}

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/App/AuthException.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,11 @@ require_once 'Zend/Gdata/App/FeedEntryParent.php';
*/
require_once 'Zend/Gdata/App/Extension/Content.php';
/**
* @see Zend_Gdata_App_Extension_Edited
*/
require_once 'Zend/Gdata/App/Extension/Edited.php';
/**
* @see Zend_Gdata_App_Extension_Published
*/
@ -55,6 +60,7 @@ require_once 'Zend/Gdata/App/Extension/Control.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -110,6 +116,13 @@ class Zend_Gdata_App_Entry extends Zend_Gdata_App_FeedEntryParent
*/
protected $_control = null;
/**
* app:edited element
*
* @var Zend_Gdata_App_Extension_Edited
*/
protected $_edited = null;
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
@ -128,6 +141,9 @@ class Zend_Gdata_App_Entry extends Zend_Gdata_App_FeedEntryParent
if ($this->_control != null) {
$element->appendChild($this->_control->getDOM($element->ownerDocument));
}
if ($this->_edited != null) {
$element->appendChild($this->_edited->getDOM($element->ownerDocument));
}
return $element;
}
@ -160,6 +176,11 @@ class Zend_Gdata_App_Entry extends Zend_Gdata_App_FeedEntryParent
$control->transferFromDOM($child);
$this->_control = $control;
break;
case $this->lookupNamespace('app') . ':' . 'edited':
$edited = new Zend_Gdata_App_Extension_Edited();
$edited->transferFromDOM($child);
$this->_edited = $edited;
break;
default:
parent::takeChildFromDOM($child);
break;
@ -220,15 +241,15 @@ class Zend_Gdata_App_Entry extends Zend_Gdata_App_FeedEntryParent
{
// Get URI
$editLink = $this->getEditLink();
if (is_null($uri) && $editLink != null) {
if (($uri === null) && $editLink != null) {
$uri = $editLink->getHref();
}
// Set classname to current class, if not otherwise set
if (is_null($className)) {
if ($className === null) {
$className = get_class($this);
}
// Append ETag, if present (Gdata v2 and above, only) and doesn't
// conflict with existing headers
if ($this->_etag != null
@ -236,7 +257,7 @@ class Zend_Gdata_App_Entry extends Zend_Gdata_App_FeedEntryParent
&& !array_key_exists('If-None-Match', $extraHeaders)) {
$extraHeaders['If-None-Match'] = $this->_etag;
}
// If an HTTP 304 status (Not Modified)is returned, then we return
// null.
$result = null;
@ -246,7 +267,7 @@ class Zend_Gdata_App_Entry extends Zend_Gdata_App_FeedEntryParent
if ($e->getResponse()->getStatus() != '304')
throw $e;
}
return $result;
}

View File

@ -33,6 +33,7 @@ require_once 'Zend/Exception.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Base.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension/Person.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension/Text.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -66,7 +67,7 @@ class Zend_Gdata_App_Extension_Content extends Zend_Gdata_App_Extension_Text
}
/**
* @return Zend_Gdata_App_Extension_Src
* @return string
*/
public function getSrc()
{
@ -74,7 +75,7 @@ class Zend_Gdata_App_Extension_Content extends Zend_Gdata_App_Extension_Text
}
/**
* @param Zend_Gdata_App_Extension_Src $value
* @param string $value
* @return Zend_Gdata_App_Entry Provides a fluent interface
*/
public function setSrc($value)

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension/Person.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/App/Extension/Draft.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -0,0 +1,48 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_App_Extension
*/
require_once 'Zend/Gdata/App/Extension.php';
/**
* Represents the app:edited element
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_App_Extension_Edited extends Zend_Gdata_App_Extension
{
protected $_rootElement = 'edited';
public function __construct($text = null)
{
parent::__construct();
$this->_text = $text;
}
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -45,6 +45,7 @@ require_once 'Zend/Gdata/App/Extension/Uri.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension/Text.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -33,6 +33,7 @@ require_once 'Zend/Gdata/App/FeedSourceParent.php';
/**
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension/Text.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension/Text.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension/Text.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/App/FeedSourceParent.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -112,6 +113,8 @@ class Zend_Gdata_App_Feed extends Zend_Gdata_App_FeedSourceParent
case $this->lookupNamespace('atom') . ':' . 'entry':
$newEntry = new $this->_entryClassName($child);
$newEntry->setHttpClient($this->getHttpClient());
$newEntry->setMajorProtocolVersion($this->getMajorProtocolVersion());
$newEntry->setMinorProtocolVersion($this->getMinorProtocolVersion());
$this->_entry[] = $newEntry;
break;
default:
@ -308,4 +311,41 @@ class Zend_Gdata_App_Feed extends Zend_Gdata_App_FeedSourceParent
return $service->getFeed($previousLinkHref, get_class($this));
}
/**
* Set the major protocol version that should be used. Values < 1 will
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
*
* This value will be propogated to all child entries.
*
* @see _majorProtocolVersion
* @param (int|NULL) $value The major protocol version to use.
* @throws Zend_Gdata_App_InvalidArgumentException
*/
public function setMajorProtocolVersion($value)
{
parent::setMajorProtocolVersion($value);
foreach ($this->entries as $entry) {
$entry->setMajorProtocolVersion($value);
}
}
/**
* Set the minor protocol version that should be used. If set to NULL, no
* minor protocol version will be sent to the server. Values < 0 will
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
*
* This value will be propogated to all child entries.
*
* @see _minorProtocolVersion
* @param (int|NULL) $value The minor protocol version to use.
* @throws Zend_Gdata_App_InvalidArgumentException
*/
public function setMinorProtocolVersion($value)
{
parent::setMinorProtocolVersion($value);
foreach ($this->entries as $entry) {
$entry->setMinorProtocolVersion($value);
}
}
}

View File

@ -75,6 +75,7 @@ require_once 'Zend/Version.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -87,7 +88,7 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
*/
protected $_service = null;
/**
/**
* The HTTP ETag associated with this entry. Used for optimistic
* concurrency in protoco v2 or greater.
*
@ -104,6 +105,26 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
protected $_title = null;
protected $_updated = null;
/**
* Indicates the major protocol version that should be used.
* At present, recognized values are either 1 or 2. However, any integer
* value >= 1 is considered valid.
*
* @see setMajorProtocolVersion()
* @see getMajorProtocolVersion()
*/
protected $_majorProtocolVersion = 1;
/**
* Indicates the minor protocol version that should be used. Can be set
* to either an integer >= 0, or NULL if no minor version should be sent
* to the server.
*
* @see setMinorProtocolVersion()
* @see getMinorProtocolVersion()
*/
protected $_minorProtocolVersion = null;
/**
* Constructs a Feed or Entry
*/
@ -111,25 +132,11 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
{
if (!($element instanceof DOMElement)) {
if ($element) {
// Load the feed as an XML DOMDocument object
@ini_set('track_errors', 1);
$doc = new DOMDocument();
$success = @$doc->loadXML($element);
@ini_restore('track_errors');
if (!$success) {
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception("DOMDocument cannot parse XML: $php_errormsg");
}
$element = $doc->getElementsByTagName($this->_rootElement)->item(0);
if (!$element) {
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception('No root <' . $this->_rootElement . '> element found, cannot parse feed.');
}
$this->transferFromDOM($element);
$this->transferFromXML($element);
}
} else {
$this->transferFromDOM($element);
}
}
}
/**
@ -180,7 +187,7 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
$this->_service = $instance;
return $this;
}
/**
* Get the active service instance for this object. This will be used to
* perform network requests, such as when calling save() and delete().
@ -362,8 +369,8 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
/**
* Given a particular 'rel' value, this method returns a matching
* Zend_Gdata_App_Extension_Link element. If the 'rel' value
* is not provided, the full array of Zend_Gdata_App_Extension_Link
* Zend_Gdata_App_Extension_Link element. If the 'rel' value
* is not provided, the full array of Zend_Gdata_App_Extension_Link
* elements is returned. In an atom feed, each link is represented
* by an atom:link element. The 'rel' value passed to this function
* is the atom:link/@rel attribute. Example rel values include 'self',
@ -392,7 +399,7 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
/**
* Returns the Zend_Gdata_App_Extension_Link element which represents
* the URL used to edit this resource. This link is in the atom feed/entry
* as an atom:link with a rel attribute value of 'edit'.
* as an atom:link with a rel attribute value of 'edit'.
*
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
*/
@ -404,8 +411,8 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
/**
* Returns the Zend_Gdata_App_Extension_Link element which represents
* the URL used to retrieve the next chunk of results when paging through
* a feed. This link is in the atom feed as an atom:link with a
* rel attribute value of 'next'.
* a feed. This link is in the atom feed as an atom:link with a
* rel attribute value of 'next'.
*
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
*/
@ -416,9 +423,9 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
/**
* Returns the Zend_Gdata_App_Extension_Link element which represents
* the URL used to retrieve the previous chunk of results when paging
* through a feed. This link is in the atom feed as an atom:link with a
* rel attribute value of 'previous'.
* the URL used to retrieve the previous chunk of results when paging
* through a feed. This link is in the atom feed as an atom:link with a
* rel attribute value of 'previous'.
*
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
*/
@ -438,8 +445,8 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
/**
* Returns the Zend_Gdata_App_Extension_Link element which represents
* the URL used to retrieve the entry or feed represented by this object
* This link is in the atom feed/entry as an atom:link with a
* rel attribute value of 'self'.
* This link is in the atom feed/entry as an atom:link with a
* rel attribute value of 'self'.
*
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
*/
@ -451,11 +458,11 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
/**
* Returns the Zend_Gdata_App_Extension_Link element which represents
* the URL for an alternate view of the data represented by this feed or
* entry. This alternate view is commonly a user-facing webpage, blog
* entry. This alternate view is commonly a user-facing webpage, blog
* post, etc. The MIME type for the data at the URL is available from the
* returned Zend_Gdata_App_Extension_Link element.
* This link is in the atom feed/entry as an atom:link with a
* rel attribute value of 'self'.
* returned Zend_Gdata_App_Extension_Link element.
* This link is in the atom feed/entry as an atom:link with a
* rel attribute value of 'self'.
*
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
*/
@ -505,8 +512,8 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
}
/**
* Returns a string representation of the title of this feed or entry.
* The title is an extremely short textual representation of this
* Returns a string representation of the title of this feed or entry.
* The title is an extremely short textual representation of this
* resource and is found as an atom:title element in a feed or entry
*
* @return string
@ -555,7 +562,7 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
/**
* Set the Etag for the current entry to $value. Setting $value to null
* unsets the Etag.
*
*
* @param string|null $value
* @return Zend_Gdata_App_Entry Provides a fluent interface
*/
@ -573,4 +580,101 @@ abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
return $this->_etag;
}
/**
* Set the major protocol version that should be used. Values < 1
* (excluding NULL) will cause a Zend_Gdata_App_InvalidArgumentException
* to be thrown.
*
* @see _majorProtocolVersion
* @param (int|NULL) $value The major protocol version to use.
* @throws Zend_Gdata_App_InvalidArgumentException
*/
public function setMajorProtocolVersion($value)
{
if (!($value >= 1) && ($value !== null)) {
require_once('Zend/Gdata/App/InvalidArgumentException.php');
throw new Zend_Gdata_App_InvalidArgumentException(
'Major protocol version must be >= 1');
}
$this->_majorProtocolVersion = $value;
}
/**
* Get the major protocol version that is in use.
*
* @see _majorProtocolVersion
* @return (int|NULL) The major protocol version in use.
*/
public function getMajorProtocolVersion()
{
return $this->_majorProtocolVersion;
}
/**
* Set the minor protocol version that should be used. If set to NULL, no
* minor protocol version will be sent to the server. Values < 0 will
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
*
* @see _minorProtocolVersion
* @param (int|NULL) $value The minor protocol version to use.
* @throws Zend_Gdata_App_InvalidArgumentException
*/
public function setMinorProtocolVersion($value)
{
if (!($value >= 0)) {
require_once('Zend/Gdata/App/InvalidArgumentException.php');
throw new Zend_Gdata_App_InvalidArgumentException(
'Minor protocol version must be >= 0 or null');
}
$this->_minorProtocolVersion = $value;
}
/**
* Get the minor protocol version that is in use.
*
* @see _minorProtocolVersion
* @return (int|NULL) The major protocol version in use, or NULL if no
* minor version is specified.
*/
public function getMinorProtocolVersion()
{
return $this->_minorProtocolVersion;
}
/**
* Get the full version of a namespace prefix
*
* Looks up a prefix (atom:, etc.) in the list of registered
* namespaces and returns the full namespace URI if
* available. Returns the prefix, unmodified, if it's not
* registered.
*
* The current entry or feed's version will be used when performing the
* namespace lookup unless overridden using $majorVersion and
* $minorVersion. If the entry/fee has a null version, then the latest
* protocol version will be used by default.
*
* @param string $prefix The namespace prefix to lookup.
* @param integer $majorVersion The major protocol version in effect.
* Defaults to null (auto-select).
* @param integer $minorVersion The minor protocol version in effect.
* Defaults to null (auto-select).
* @return string
*/
public function lookupNamespace($prefix,
$majorVersion = null,
$minorVersion = null)
{
// Auto-select current version
if ($majorVersion === null) {
$majorVersion = $this->getMajorProtocolVersion();
}
if ($minorVersion === null) {
$minorVersion = $this->getMinorProtocolVersion();
}
// Perform lookup
return parent::lookupNamespace($prefix, $majorVersion, $minorVersion);
}
}

View File

@ -55,6 +55,7 @@ require_once 'Zend/Gdata/App/Extension/Subtitle.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -37,6 +37,7 @@ require_once 'Zend/Http/Client/Exception.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -33,6 +33,7 @@ require_once 'Zend/Gdata/App/Exception.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -32,6 +32,7 @@ require_once 'Zend/Gdata/App/Exception.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -16,7 +16,7 @@
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -31,22 +31,17 @@ require_once 'Zend/Gdata/App/Entry.php';
require_once 'Zend/Gdata/App/MediaSource.php';
/**
* @see Zend_Mime
* @see Zend_Gdata_MediaMimeStream
*/
require_once 'Zend/Mime.php';
/**
* @see Zend_Mime_Message
*/
require_once 'Zend/Mime/Message.php';
require_once 'Zend/Gdata/MediaMimeStream.php';
/**
* Concrete class for working with Atom entries containing multi-part data.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @subpackage App
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_App_MediaEntry extends Zend_Gdata_App_Entry
@ -54,17 +49,10 @@ class Zend_Gdata_App_MediaEntry extends Zend_Gdata_App_Entry
/**
* The attached MediaSource/file
*
* @var Zend_Gdata_App_MediaSource
* @var Zend_Gdata_App_MediaSource
*/
protected $_mediaSource = null;
/**
* The Zend_Mime object used to generate the boundary
*
* @var Zend_Mime
*/
protected $_mime = null;
/**
* Constructs a new MediaEntry, representing XML data and optional
* file to upload
@ -75,50 +63,29 @@ class Zend_Gdata_App_MediaEntry extends Zend_Gdata_App_Entry
public function __construct($element = null, $mediaSource = null)
{
parent::__construct($element);
$this->_mime = new Zend_Mime();
$this->_mediaSource = $mediaSource;
}
/**
* Return the Zend_Mime object associated with this MediaEntry. This
* object is used to generate the media boundaries.
*
* @return Zend_Mime The Zend_Mime object associated with this MediaEntry.
*/
public function getMime()
{
return $this->_mime;
}
/**
* Return the MIME multipart representation of this MediaEntry.
*
* @return string The MIME multipart representation of this MediaEntry
* @return string|Zend_Gdata_MediaMimeStream The MIME multipart
* representation of this MediaEntry. If the entry consisted only
* of XML, a string is returned.
*/
public function encode()
{
$xmlData = $this->saveXML();
if ($this->getMediaSource() === null) {
$mediaSource = $this->getMediaSource();
if ($mediaSource === null) {
// No attachment, just send XML for entry
return $xmlData;
} else {
$mimeMessage = new Zend_Mime_Message();
$mimeMessage->setMime($this->_mime);
$xmlPart = new Zend_Mime_Part($xmlData);
$xmlPart->type = 'application/atom+xml';
$xmlPart->encoding = null;
$mimeMessage->addPart($xmlPart);
$binaryPart = new Zend_Mime_Part($this->getMediaSource()->encode());
$binaryPart->type = $this->getMediaSource()->getContentType();
$binaryPart->encoding = null;
$mimeMessage->addPart($binaryPart);
return $mimeMessage->generateMessage();
return new Zend_Gdata_MediaMimeStream($xmlData,
$mediaSource->getFilename(), $mediaSource->getContentType());
}
}
/**
* Return the MediaSource object representing the file attached to this
* MediaEntry.
@ -147,15 +114,5 @@ class Zend_Gdata_App_MediaEntry extends Zend_Gdata_App_Entry
}
return $this;
}
/**
* Return the boundary used in the MIME multipart message
*
* @return string The boundary used in the MIME multipart message
*/
public function getBoundary()
{
return $this->_mime->boundary();
}
}

View File

@ -30,6 +30,7 @@ require_once 'Zend/Gdata/App/BaseMediaSource.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -25,6 +25,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -25,6 +25,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -79,7 +80,7 @@ class Zend_Gdata_App_Util
throw new Zend_Gdata_App_Exception("Empty namespace collection encountered.");
}
if (is_null($maximumKey)) {
if ($maximumKey === null) {
// If the key is null, then we return the maximum available
$keys = array_keys($collection);
sort($keys);

View File

@ -0,0 +1,41 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* Zend_Gdata_App_Exception
*/
require_once 'Zend/Gdata/App/Exception.php';
/**
* Gdata APP exceptions
*
* Class to represent version exceptions that occur during Gdata APP operations.
*
* @category Zend
* @package Zend_Gdata
* @subpackage App
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_App_VersionException extends Zend_Gdata_App_Exception
{
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -37,6 +38,7 @@ require_once 'Zend/Version.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -52,6 +52,7 @@ require_once 'Zend/Gdata/Books/VolumeFeed.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -62,9 +63,14 @@ class Zend_Gdata_Books extends Zend_Gdata
const MY_ANNOTATION_FEED_URI = 'http://books.google.com/books/feeds/users/me/volumes';
const AUTH_SERVICE_NAME = 'print';
/**
* Namespaces used for Zend_Gdata_Books
*
* @var array
*/
public static $namespaces = array(
'gbs' => 'http://schemas.google.com/books/2008',
'dc' => 'http://purl.org/dc/terms'
array('gbs', 'http://schemas.google.com/books/2008', 1, 0),
array('dc', 'http://purl.org/dc/terms', 1, 0)
);
/**
@ -144,7 +150,7 @@ class Zend_Gdata_Books extends Zend_Gdata
}
/**
* Retrieves a feed of volumes, by default the User annotation feed
* Retrieves a feed of volumes, by default the User annotation feed
*
* @param Zend_Gdata_Query|string|null $location (optional) The URL to
* query.
@ -181,7 +187,7 @@ class Zend_Gdata_Books extends Zend_Gdata
}
/**
* Delete a Volume
* Delete a Volume
*
* @param Zend_Gdata_Books_VolumeEntry $entry
* @return void

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Entry.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -47,9 +48,7 @@ class Zend_Gdata_Books_CollectionEntry extends Zend_Gdata_Entry
*/
public function __construct($element = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($element);
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Feed.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -47,12 +48,10 @@ class Zend_Gdata_Books_CollectionFeed extends Zend_Gdata_Feed
*/
public function __construct($element = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($element);
}
/**
* The classname for individual feed elements.
*

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -55,9 +56,7 @@ class Zend_Gdata_Books_Extension_AnnotationLink extends
public function __construct($href = null, $rel = null, $type = null,
$hrefLang = null, $title = null, $length = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
}

View File

@ -22,15 +22,16 @@
*/
/**
* @see Zend_Gdata_Atom_Extension_Category
* @see Zend_Gdata_App_Extension_Category
*/
require_once 'Zend/Gdata/Atom/Extension/Category.php';
require_once 'Zend/Gdata/App/Extension/Category.php';
/**
* Describes a books category
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -52,9 +53,7 @@ class Zend_Gdata_Books_Extension_BooksCategory extends
*/
public function __construct($term = null, $scheme = null, $label = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($term, $scheme, $label);
}

View File

@ -22,15 +22,16 @@
*/
/**
* @see Zend_Gdata_Extension_Link
* @see Zend_Gdata_App_Extension_Link
*/
require_once 'Zend/Gdata/Extension/Link.php';
require_once 'Zend/Gdata/App/Extension/Link.php';
/**
* Extends the base Link class with Books extensions
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -52,9 +53,7 @@ class Zend_Gdata_Books_Extension_BooksLink extends Zend_Gdata_App_Extension_Link
public function __construct($href = null, $rel = null, $type = null,
$hrefLang = null, $title = null, $length = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -51,9 +52,7 @@ class Zend_Gdata_Books_Extension_Embeddability extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -53,9 +54,7 @@ class Zend_Gdata_Books_Extension_InfoLink extends
public function __construct($href = null, $rel = null, $type = null,
$hrefLang = null, $title = null, $length = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -53,9 +54,7 @@ class Zend_Gdata_Books_Extension_PreviewLink extends
public function __construct($href = null, $rel = null, $type = null,
$hrefLang = null, $title = null, $length = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -54,9 +55,7 @@ class Zend_Gdata_Books_Extension_Review extends Zend_Gdata_Extension
*/
public function __construct($lang = null, $type = null, $value = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct();
$this->_lang = $lang;
$this->_type = $type;

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -53,9 +54,7 @@ class Zend_Gdata_Books_Extension_ThumbnailLink extends
public function __construct($href = null, $rel = null, $type = null,
$hrefLang = null, $title = null, $length = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -51,9 +52,7 @@ class Zend_Gdata_Books_Extension_Viewability extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct();
$this->_value = $value;
}
@ -109,7 +108,7 @@ class Zend_Gdata_Books_Extension_Viewability extends Zend_Gdata_Extension
* Sets the programmatic value that describes the viewability of a volume in
* Google Book Search
*
* @param string $value programmatic value that describes the viewability
* @param string $value programmatic value that describes the viewability
* of a volume in Googl eBook Search
* @return Zend_Gdata_Books_Extension_Viewability Provides a fluent
* interface

View File

@ -101,6 +101,7 @@ require_once 'Zend/Gdata/Books/Extension/Viewability.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -137,9 +138,7 @@ class Zend_Gdata_Books_VolumeEntry extends Zend_Gdata_Entry
*/
public function __construct($element = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($element);
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Feed.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -47,9 +48,7 @@ class Zend_Gdata_Books_VolumeFeed extends Zend_Gdata_Feed
*/
public function __construct($element = null)
{
foreach (Zend_Gdata_Books::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
parent::__construct($element);
}

View File

@ -35,6 +35,7 @@ require_once('Zend/Gdata/Query.php');
*
* @category Zend
* @package Zend_Gdata
* @subpackage Books
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -51,6 +51,7 @@ require_once 'Zend/Gdata/Calendar/ListEntry.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -63,8 +64,14 @@ class Zend_Gdata_Calendar extends Zend_Gdata
protected $_defaultPostUri = self::CALENDAR_EVENT_FEED_URI;
/**
* Namespaces used for Zend_Gdata_Calendar
*
* @var array
*/
public static $namespaces = array(
'gCal' => 'http://schemas.google.com/gCal/2005');
array('gCal', 'http://schemas.google.com/gCal/2005', 1, 0)
);
/**
* Create Gdata_Calendar object

View File

@ -45,12 +45,17 @@ require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
*/
require_once 'Zend/Gdata/Calendar/Extension/Link.php';
/**
* @see Zend_Gdata_Calendar_Extension_QuickAdd
*/
require_once 'Zend/Gdata/Calendar/Extension/QuickAdd.php';
/**
* Data model class for a Google Calendar Event Entry
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -64,9 +69,7 @@ class Zend_Gdata_Calendar_EventEntry extends Zend_Gdata_Kind_EventEntry
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct($element);
}

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -59,11 +60,8 @@ class Zend_Gdata_Calendar_EventFeed extends Zend_Gdata_Feed
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct($element);
}
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)

View File

@ -37,6 +37,7 @@ require_once('Zend/Gdata/Query.php');
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -341,7 +342,7 @@ class Zend_Gdata_Calendar_EventQuery extends Zend_Gdata_Query
*/
public function setSingleEvents($value)
{
if (!is_null($value)) {
if ($value !== null) {
if (is_bool($value)) {
$this->_params['singleevents'] = ($value?'true':'false');
} elseif ($value == 'true' | $value == 'false') {
@ -390,7 +391,7 @@ class Zend_Gdata_Calendar_EventQuery extends Zend_Gdata_Query
*/
public function setFutureEvents($value)
{
if (!is_null($value)) {
if ($value !== null) {
if (is_bool($value)) {
$this->_params['futureevents'] = ($value?'true':'false');
} elseif ($value == 'true' | $value == 'false') {

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -34,6 +35,7 @@ require_once 'Zend/Gdata/Calendar.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -50,9 +52,7 @@ class Zend_Gdata_Calendar_Extension_AccessLevel extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -30,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -46,9 +48,7 @@ class Zend_Gdata_Calendar_Extension_Color extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -29,6 +30,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -45,9 +47,7 @@ class Zend_Gdata_Calendar_Extension_Hidden extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -14,6 +14,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 3941 2007-03-14 21:36:13Z darby $
@ -35,6 +36,7 @@ require_once 'Zend/Gdata/Calendar/Extension/WebContent.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -51,9 +53,7 @@ class Zend_Gdata_Calendar_Extension_Link extends Zend_Gdata_App_Extension_Link
public function __construct($href = null, $rel = null, $type = null,
$hrefLang = null, $title = null, $length = null, $webContent = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
$this->_webContent = $webContent;
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -29,6 +30,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -45,9 +47,7 @@ class Zend_Gdata_Calendar_Extension_QuickAdd extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -29,6 +30,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -45,9 +47,7 @@ class Zend_Gdata_Calendar_Extension_Selected extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -29,6 +30,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -44,9 +46,7 @@ class Zend_Gdata_Calendar_Extension_SendEventNotifications extends Zend_Gdata_Ex
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -29,6 +30,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -45,9 +47,7 @@ class Zend_Gdata_Calendar_Extension_Timezone extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_value = $value;
}

View File

@ -15,6 +15,7 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -29,6 +30,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -49,9 +51,7 @@ class Zend_Gdata_Calendar_Extension_WebContent extends Zend_Gdata_App_Extension
*/
public function __construct($url = null, $height = null, $width = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct();
$this->_url = $url;
$this->_height = $height;

View File

@ -67,6 +67,7 @@ require_once 'Zend/Gdata/Extension/Where.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -82,9 +83,7 @@ class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct($element);
}

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -58,9 +59,7 @@ class Zend_Gdata_Calendar_ListFeed extends Zend_Gdata_Feed
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
parent::__construct($element);
}

View File

@ -15,7 +15,8 @@
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @subpackage Gdata
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -36,7 +37,8 @@ require_once 'Zend/Version.php';
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @subpackage Gdata
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_ClientLogin
@ -150,7 +152,6 @@ class Zend_Gdata_ClientLogin
}
if ($response->getStatus() == 200) {
$client = new Zend_Gdata_HttpClient();
$client->setClientLoginToken($goog_resp['Auth']);
$useragent = $source . ' Zend_Framework_Gdata/' . Zend_Version::VERSION;
$client->setConfig(array(

View File

@ -41,6 +41,7 @@ require_once 'Zend/Gdata/Docs/DocumentListEntry.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Docs
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Entry.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Docs
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -45,9 +46,7 @@ class Zend_Gdata_Docs_DocumentListEntry extends Zend_Gdata_Entry
*/
public function __construct($element = null)
{
foreach (Zend_Gdata_Docs::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Docs::$namespaces);
parent::__construct($element);
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Feed.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Docs
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -59,9 +60,7 @@ class Zend_Gdata_Docs_DocumentListFeed extends Zend_Gdata_Feed
*/
public function __construct($element = null)
{
foreach (Zend_Gdata_Docs::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Docs::$namespaces);
parent::__construct($element);
}

View File

@ -32,6 +32,7 @@ require_once('Zend/Gdata/Query.php');
*
* @category Zend
* @package Zend_Gdata
* @subpackage Docs
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

View File

@ -26,24 +26,30 @@
require_once 'Zend/Gdata.php';
/**
* Service class for interacting with the services which use the
* Service class for interacting with the services which use the
* DublinCore extensions.
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_DublinCore extends Zend_Gdata
{
/**
* Namespaces used for Zend_Gdata_DublinCore
*
* @var array
*/
public static $namespaces = array(
'dc' => 'http://purl.org/dc/terms'
array('dc', 'http://purl.org/dc/terms', 1, 0)
);
/**
* Create Zend_Gdata_DublinCore object
*
*
* @param Zend_Http_Client $client (optional) The HTTP client to use when
* when communicating with the Google servers.
* @param string $applicationId The identity of the app in the form of Company-AppName-Version

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Creator extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -32,6 +32,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -52,9 +53,7 @@ class Zend_Gdata_DublinCore_Extension_Date extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Description extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Format extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Identifier extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Language extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Publisher extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Rights extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Subject extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -31,6 +31,7 @@ require_once 'Zend/Gdata/Extension.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc.
* (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
@ -50,9 +51,7 @@ class Zend_Gdata_DublinCore_Extension_Title extends Zend_Gdata_Extension
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_DublinCore::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}

View File

@ -15,10 +15,16 @@
*
* @category Zend
* @package Zend_Gdata
* @subpackage Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata
*/
require_once 'Zend/Gdata.php';
/**
* @see Zend_Gdata_App_MediaEntry
*/
@ -29,6 +35,7 @@ require_once 'Zend/Gdata/App/MediaEntry.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -39,9 +46,7 @@ class Zend_Gdata_Entry extends Zend_Gdata_App_MediaEntry
public function __construct($element = null)
{
foreach (Zend_Gdata::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata::$namespaces);
parent::__construct($element);
}
@ -109,7 +114,7 @@ class Zend_Gdata_Entry extends Zend_Gdata_App_MediaEntry
// ETags are special, since they can be conveyed by either the
// HTTP ETag header or as an XML attribute.
$etag = $attribute->nodeValue;
if (is_null($this->_etag)) {
if ($this->_etag === null) {
$this->_etag = $etag;
}
elseif ($this->_etag != $etag) {

View File

@ -31,18 +31,25 @@ require_once 'Zend/Gdata.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Exif extends Zend_Gdata
{
/**
* Namespaces used for Zend_Gdata_Exif
*
* @var array
*/
public static $namespaces = array(
'exif' => 'http://schemas.google.com/photos/exif/2007');
array('exif', 'http://schemas.google.com/photos/exif/2007', 1, 0)
);
/**
* Create Zend_Gdata_Exif object
*
*
* @param Zend_Http_Client $client (optional) The HTTP client to use when
* when communicating with the Google servers.
* @param string $applicationId The identity of the app in the form of Company-AppName-Version

View File

@ -40,6 +40,7 @@ require_once 'Zend/Gdata/Exif/Extension/Tags.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -51,36 +52,34 @@ class Zend_Gdata_Exif_Entry extends Zend_Gdata_Entry
* @var string
*/
protected $_entryClassName = 'Zend_Gdata_Exif_Entry';
/**
* The tags that belong to the Exif group.
*
*
* @var string
*/
protected $_tags = null;
/**
* Create a new instance.
*
*
* @param DOMElement $element (optional) DOMElement from which this
* object should be constructed.
*/
public function __construct($element = null)
{
foreach (Zend_Gdata_Exif::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
parent::__construct($element);
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
@ -112,27 +111,27 @@ class Zend_Gdata_Exif_Entry extends Zend_Gdata_Entry
break;
}
}
/**
* Retrieve the tags for this entry.
*
* @see setTags
* @return Zend_Gdata_Exif_Extension_Tags The requested object
* @return Zend_Gdata_Exif_Extension_Tags The requested object
* or null if not set.
*/
public function getTags()
{
return $this->_tags;
}
/**
* Set the tags property for this entry. This property contains
* Set the tags property for this entry. This property contains
* various Exif data.
*
* This corresponds to the <exif:tags> property in the Google Data
*
* This corresponds to the <exif:tags> property in the Google Data
* protocol.
*
* @param Zend_Gdata_Exif_Extension_Tags $value The desired value
*
* @param Zend_Gdata_Exif_Extension_Tags $value The desired value
* this element, or null to unset.
* @return Zend_Gdata_Exif_Entry Provides a fluent interface
*/

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/Exif.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -43,17 +44,15 @@ class Zend_Gdata_Exif_Extension_Distance extends Zend_Gdata_Extension
protected $_rootNamespace = 'exif';
protected $_rootElement = 'distance';
/**
* Constructs a new Zend_Gdata_Exif_Extension_Distance object.
*
*
* @param string $text (optional) The value to use for this element.
*/
public function __construct($text = null)
public function __construct($text = null)
{
foreach (Zend_Gdata_Exif::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
parent::__construct();
$this->setText($text);
}

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/Exif.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -43,17 +44,15 @@ class Zend_Gdata_Exif_Extension_Exposure extends Zend_Gdata_Extension
protected $_rootNamespace = 'exif';
protected $_rootElement = 'exposure';
/**
* Constructs a new Zend_Gdata_Exif_Extension_Exposure object.
*
*
* @param string $text (optional) The value to use for this element.
*/
public function __construct($text = null)
public function __construct($text = null)
{
foreach (Zend_Gdata_Exif::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
parent::__construct();
$this->setText($text);
}

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/Exif.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -43,17 +44,15 @@ class Zend_Gdata_Exif_Extension_FStop extends Zend_Gdata_Extension
protected $_rootNamespace = 'exif';
protected $_rootElement = 'fstop';
/**
* Constructs a new Zend_Gdata_Exif_Extension_FStop object.
*
*
* @param string $text (optional) The value to use for this element.
*/
public function __construct($text = null)
public function __construct($text = null)
{
foreach (Zend_Gdata_Exif::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
parent::__construct();
$this->setText($text);
}

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/Exif.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -43,17 +44,15 @@ class Zend_Gdata_Exif_Extension_Flash extends Zend_Gdata_Extension
protected $_rootNamespace = 'exif';
protected $_rootElement = 'flash';
/**
* Constructs a new Zend_Gdata_Exif_Extension_Flash object.
*
*
* @param string $text (optional) The value to use for this element.
*/
public function __construct($text = null)
public function __construct($text = null)
{
foreach (Zend_Gdata_Exif::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
parent::__construct();
$this->setText($text);
}

View File

@ -35,6 +35,7 @@ require_once 'Zend/Gdata/Exif.php';
*
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -43,17 +44,15 @@ class Zend_Gdata_Exif_Extension_FocalLength extends Zend_Gdata_Extension
protected $_rootNamespace = 'exif';
protected $_rootElement = 'focallength';
/**
* Constructs a new Zend_Gdata_Exif_Extension_FocalLength object.
*
*
* @param string $text (optional) The value to use for this element.
*/
public function __construct($text = null)
public function __construct($text = null)
{
foreach (Zend_Gdata_Exif::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
parent::__construct();
$this->setText($text);
}

Some files were not shown because too many files have changed in this diff Show More