Skip to content
Browse files

updateing

  • Loading branch information...
1 parent 97335ed commit 7f7c19da825c7771f685ba594b506414bf8e9cb4 @sgehrig sgehrig committed
Showing with 42 additions and 7,294 deletions.
  1. +42 −42 library/Zend/Feed/Reader/Entry/Rss.php
  2. +0 −42 library/Zend/GData/App/AuthException.php
  3. +0 −42 library/Zend/GData/App/BadMethodCallException.php
  4. +0 −569 library/Zend/GData/App/Base.php
  5. +0 −178 library/Zend/GData/App/BaseMediaSource.php
  6. +0 −94 library/Zend/GData/App/CaptchaRequiredException.php
  7. +0 −365 library/Zend/GData/App/Entry.php
  8. +0 −42 library/Zend/GData/App/Exception.php
  9. +0 −88 library/Zend/GData/App/Extension/Content.php
  10. +0 −49 library/Zend/GData/App/Extension/Rights.php
  11. +0 −42 library/Zend/GData/App/Extension/Source.php
  12. +0 −43 library/Zend/GData/App/Extension/Subtitle.php
  13. +0 −43 library/Zend/GData/App/Extension/Summary.php
  14. +0 −43 library/Zend/GData/App/Extension/Title.php
  15. +0 −347 library/Zend/GData/App/Feed.php
  16. +0 −42 library/Zend/GData/App/IOException.php
  17. +0 −42 library/Zend/GData/App/InvalidArgumentException.php
  18. +0 −111 library/Zend/GData/App/MediaEntry.php
  19. +0 −145 library/Zend/GData/App/MediaFileSource.php
  20. +0 −77 library/Zend/GData/App/MediaSource.php
  21. +0 −115 library/Zend/GData/App/Util.php
  22. +0 −42 library/Zend/GData/App/VersionException.php
  23. +0 −485 library/Zend/GData/Calendar/EventQuery.php
  24. +0 −222 library/Zend/GData/Docs/Query.php
  25. +0 −128 library/Zend/GData/Entry.php
  26. +0 −232 library/Zend/GData/Feed.php
  27. +0 −49 library/Zend/GData/GApps/EmailListFeed.php
  28. +0 −49 library/Zend/GData/GApps/EmailListRecipientFeed.php
  29. +0 −232 library/Zend/GData/GApps/Error.php
  30. +0 −49 library/Zend/GData/GApps/NicknameFeed.php
  31. +0 −201 library/Zend/GData/GApps/ServiceException.php
  32. +0 −49 library/Zend/GData/GApps/UserFeed.php
  33. +0 −96 library/Zend/GData/GBase/ItemQuery.php
  34. +0 −268 library/Zend/GData/GBase/Query.php
  35. +0 −70 library/Zend/GData/GBase/SnippetQuery.php
  36. +0 −100 library/Zend/GData/Health/ProfileListEntry.php
  37. +0 −53 library/Zend/GData/Health/ProfileListFeed.php
  38. +0 −286 library/Zend/GData/Health/Query.php
  39. +0 −186 library/Zend/GData/MediaMimeStream.php
  40. +0 −96 library/Zend/GData/MimeBodyString.php
  41. +0 −70 library/Zend/GData/MimeFile.php
  42. +0 −149 library/Zend/GData/Photos/AlbumQuery.php
  43. +0 −98 library/Zend/GData/Photos/PhotoQuery.php
  44. +0 −417 library/Zend/GData/Query.php
  45. +0 −411 library/Zend/GData/Spreadsheets/CellQuery.php
  46. +0 −282 library/Zend/GData/Spreadsheets/DocumentQuery.php
  47. +0 −299 library/Zend/GData/Spreadsheets/ListQuery.php
  48. +0 −38 library/Zend/InfoCard/XML/Exception.php
  49. +0 −38 library/Zend/InfoCard/XML/Security/Exception.php
  50. +0 −38 library/Zend/InfoCard/XML/Security/Transform/Exception.php
View
84 library/Zend/Feed/Reader/Entry/Rss.php
@@ -13,40 +13,39 @@
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
- * @package Reader\Reader
+ * @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Rss.php 22300 2010-05-26 10:13:34Z padraic $
+ * @version $Id$
*/
/**
-* @namespace
-*/
+ * @namespace
+ */
namespace Zend\Feed\Reader\Entry;
use Zend\Feed\Reader;
use Zend\Date;
/**
-* @uses \Zend\Date\Date
-* @uses \Zend\Feed\Exception
-* @uses \Zend\Feed\Reader\Reader
-* @uses \Zend\Feed\Reader\Collection\Category
-* @uses \Zend\Feed\Reader\EntryAbstract
-* @uses \Zend\Feed\Reader\EntryInterface
-* @uses \Zend\Feed\Reader\Extension\Atom\Entry
-* @uses \Zend\Feed\Reader\Extension\Content\Entry
-* @uses \Zend\Feed\Reader\Extension\DublinCore\Entry
-* @uses \Zend\Feed\Reader\Extension\Slash\Entry
-* @uses \Zend\Feed\Reader\Extension\Thread\Entry
-* @uses \Zend\Feed\Reader\Extension\WellformedWeb\Entry
-* @category Zend
-* @package Reader\Reader
-* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
-* @license http://framework.zend.com/license/new-bsd New BSD License
-*/
-class Rss extends AbstractEntry implements Reader\Entry
+ * @uses \Zend\Date\Date
+ * @uses \Zend\Feed\Exception
+ * @uses \Zend\Feed\Reader\Reader
+ * @uses \Zend\Feed\Reader\Collection\Category
+ * @uses \Zend\Feed\Reader\AbstractEntry
+ * @uses \Zend\Feed\Reader\Entry
+ * @uses \Zend\Feed\Reader\Extension\Atom\Entry
+ * @uses \Zend\Feed\Reader\Extension\Content\Entry
+ * @uses \Zend\Feed\Reader\Extension\DublinCore\Entry
+ * @uses \Zend\Feed\Reader\Extension\Slash\Entry
+ * @uses \Zend\Feed\Reader\Extension\Thread\Entry
+ * @uses Zend_Feed_Reader_Extension_WellformedWeb_Entry
+ * @category Zend
+ * @package Zend_Feed_Reader
+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class RSS extends Reader\AbstractEntry implements Reader\Entry
{
-
/**
* XPath query for RDF
*
@@ -64,7 +63,7 @@ class Rss extends AbstractEntry implements Reader\Entry
/**
* Constructor
*
- * @param Zend_Feed_Entry_Abstract $entry
+ * @param \Zend\Feed\Entry\AbstractEntry $entry
* @param string $entryKey
* @param string $type
* @return void
@@ -77,23 +76,23 @@ public function __construct(\DOMElement $entry, $entryKey, $type = null)
$pluginLoader = Reader\Reader::getPluginLoader();
- $dublinCoreClass = $pluginLoader->getClassName('DublinCore\\Entry');
- $this->_extensions['DublinCore\\Entry'] = new $dublinCoreClass($entry, $entryKey, $type);
+ $dublinCoreClass = $pluginLoader->getClassName('DublinCore\Entry');
+ $this->_extensions['DublinCore\Entry'] = new $dublinCoreClass($entry, $entryKey, $type);
- $contentClass = $pluginLoader->getClassName('Content\\Entry');
- $this->_extensions['Content\\Entry'] = new $contentClass($entry, $entryKey, $type);
+ $contentClass = $pluginLoader->getClassName('Content\Entry');
+ $this->_extensions['Content\Entry'] = new $contentClass($entry, $entryKey, $type);
- $atomClass = $pluginLoader->getClassName('Atom\\Entry');
- $this->_extensions['Atom\\Entry'] = new $atomClass($entry, $entryKey, $type);
+ $atomClass = $pluginLoader->getClassName('Atom\Entry');
+ $this->_extensions['Atom\Entry'] = new $atomClass($entry, $entryKey, $type);
- $wfwClass = $pluginLoader->getClassName('WellFormedWeb\\Entry');
- $this->_extensions['WellFormedWeb\\Entry'] = new $wfwClass($entry, $entryKey, $type);
+ $wfwClass = $pluginLoader->getClassName('WellFormedWeb\Entry');
+ $this->_extensions['WellFormedWeb\Entry'] = new $wfwClass($entry, $entryKey, $type);
- $slashClass = $pluginLoader->getClassName('Slash\\Entry');
- $this->_extensions['Slash\\Entry'] = new $slashClass($entry, $entryKey, $type);
+ $slashClass = $pluginLoader->getClassName('Slash\Entry');
+ $this->_extensions['Slash\Entry'] = new $slashClass($entry, $entryKey, $type);
- $threadClass = $pluginLoader->getClassName('Thread\\Entry');
- $this->_extensions['Thread\\Entry'] = new $threadClass($entry, $entryKey, $type);
+ $threadClass = $pluginLoader->getClassName('Thread\Entry');
+ $this->_extensions['Thread\Entry'] = new $threadClass($entry, $entryKey, $type);
}
/**
@@ -233,8 +232,10 @@ public function getDateModified()
if ($dateModifiedParsed) {
$date = new Date\Date($dateModifiedParsed);
} else {
- $dateStandards = array(Date\Date::RSS, Date\Date::RFC_822,
- Date\Date::RFC_2822, Date\Date::DATES);
+ $dateStandards = array(
+ Date\Date::RSS, Date\Date::RFC_822,
+ Date\Date::RFC_2822, Date\Date::DATES,
+ );
$date = new Date\Date;
foreach ($dateStandards as $standard) {
try {
@@ -242,8 +243,7 @@ public function getDateModified()
break;
} catch (Date\Exception $e) {
if ($standard == Date\Date::DATES) {
- require_once 'Zend/Feed/Exception.php';
- throw new Exception(
+ throw new \Zend\Feed\Exception(
'Could not load date due to unrecognised'
.' format (should follow RFC 822 or 2822):'
. $e->getMessage(),
@@ -440,7 +440,7 @@ public function getLinks()
/**
* Get all categories
*
- * @return Reader\Reader_Collection_Category
+ * @return \Zend\Feed\Reader\Collection\Category
*/
public function getCategories()
{
@@ -620,7 +620,7 @@ public function getCommentFeedLink()
/**
* Set the XPath query (incl. on all Extensions)
*
- * @param \DOMXPath $xpath
+ * @param DOMXPath $xpath
*/
public function setXpath(\DOMXPath $xpath)
{
View
42 library/Zend/GData/App/AuthException.php
@@ -1,42 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Gdata exceptions
- *
- * Class to represent exceptions that occur during Gdata operations.
- *
- * @uses \Zend\GData\App\Exception
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class AuthException extends Exception
-{
-}
View
42 library/Zend/GData/App/BadMethodCallException.php
@@ -1,42 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Gdata APP exceptions
- *
- * Class to represent exceptions that occur during Gdata APP operations.
- *
- * @uses \Zend\GData\App\Exception
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class BadMethodCallException extends Exception
-{
-}
View
569 library/Zend/GData/App/Base.php
@@ -1,569 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Abstract class for all XML elements
- *
- * @uses DOMDocument
- * @uses \Zend\GData\App\Exception
- * @uses \Zend\GData\App\InvalidArgumentException
- * @uses \Zend\GData\App\Util
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-abstract class Base
-{
-
- /**
- * @var string The XML element name, including prefix if desired
- */
- protected $_rootElement = null;
-
- /**
- * @var string The XML namespace prefix
- */
- protected $_rootNamespace = 'atom';
-
- /**
- * @var string The XML namespace URI - takes precedence over lookup up the
- * corresponding URI for $_rootNamespace
- */
- protected $_rootNamespaceURI = null;
-
- /**
- * @var array Leftover elements which were not handled
- */
- protected $_extensionElements = array();
-
- /**
- * @var array Leftover attributes which were not handled
- */
- protected $_extensionAttributes = array();
-
- /**
- * @var string XML child text node content
- */
- 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
- * minimum major protocol version, and the third dimension is the minimum
- * minor protocol version. Null keys are NOT allowed.
- *
- * When looking up a namespace for a given prefix, the greatest version
- * number (both major and minor) which is less than the effective version
- * should be used.
- *
- * @see lookupNamespace()
- * @see registerNamespace()
- * @see registerAllNamespaces()
- * @var array
- */
- protected $_namespaces = array(
- 'atom' => array(
- 1 => array(
- 0 => 'http://www.w3.org/2005/Atom'
- )
- ),
- 'app' => array(
- 1 => array(
- 0 => 'http://purl.org/atom/app#'
- ),
- 2 => array(
- 0 => 'http://www.w3.org/2007/app'
- )
- )
- );
-
- public function __construct()
- {
- }
-
- /**
- * Returns the child text node of this element
- * This represents any raw text contained within the XML element
- *
- * @return string Child text node
- */
- public function getText($trim = true)
- {
- if ($trim) {
- return trim($this->_text);
- } else {
- return $this->_text;
- }
- }
-
- /**
- * Sets the child text node of this element
- * This represents any raw text contained within the XML element
- *
- * @param string $value Child text node
- * @return \Zend\GData\App\Base Returns an object of the same type as 'this' to provide a fluent interface.
- */
- public function setText($value)
- {
- $this->_text = $value;
- return $this;
- }
-
- /**
- * Returns an array of all elements not matched to data model classes
- * during the parsing of the XML
- *
- * @return array All elements not matched to data model classes during parsing
- */
- public function getExtensionElements()
- {
- return $this->_extensionElements;
- }
-
- /**
- * Sets an array of all elements not matched to data model classes
- * during the parsing of the XML. This method can be used to add arbitrary
- * child XML elements to any data model class.
- *
- * @param array $value All extension elements
- * @return \Zend\GData\App\Base Returns an object of the same type as 'this' to provide a fluent interface.
- */
- public function setExtensionElements($value)
- {
- $this->_extensionElements = $value;
- return $this;
- }
-
- /**
- * 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:
- * array('namespaceUri' => string, 'name' => string, 'value' => string);
- *
- * @return array All extension attributes
- */
- public function getExtensionAttributes()
- {
- return $this->_extensionAttributes;
- }
-
- /**
- * 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:
- * array('namespaceUri' => string, 'name' => string, 'value' => string);
- * This can be used to add arbitrary attributes to any data model element
- *
- * @param array $value All extension attributes
- * @return \Zend\GData\App\Base Returns an object of the same type as 'this' to provide a fluent interface.
- */
- public function setExtensionAttributes($value)
- {
- $this->_extensionAttributes = $value;
- return $this;
- }
-
- /**
- * 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.
- *
- * @param DOMDocument $doc The DOMDocument used to construct DOMElements
- * @return DOMElement The DOMElement representing this element and all
- * child properties.
- */
- public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
- {
- if ($doc === null) {
- $doc = new \DOMDocument('1.0', 'utf-8');
- }
- if ($this->_rootNamespaceURI != null) {
- $element = $doc->createElementNS($this->_rootNamespaceURI, $this->_rootElement);
- } elseif ($this->_rootNamespace !== null) {
- if (strpos($this->_rootElement, ':') === false) {
- $elementName = $this->_rootNamespace . ':' . $this->_rootElement;
- } else {
- $elementName = $this->_rootElement;
- }
- $element = $doc->createElementNS($this->lookupNamespace($this->_rootNamespace), $elementName);
- } else {
- $element = $doc->createElement($this->_rootElement);
- }
- if ($this->_text != null) {
- $element->appendChild($element->ownerDocument->createTextNode($this->_text));
- }
- foreach ($this->_extensionElements as $extensionElement) {
- $element->appendChild($extensionElement->getDOM($element->ownerDocument));
- }
- foreach ($this->_extensionAttributes as $attribute) {
- $element->setAttribute($attribute['name'], $attribute['value']);
- }
- return $element;
- }
-
- /**
- * Given a child DOMNode, tries to determine how to map the data into
- * object instance members. If no mapping is defined, Extension_Element
- * objects are created and stored in an array.
- *
- * @param DOMNode $child The DOMNode needed to be handled
- */
- protected function takeChildFromDOM($child)
- {
- if ($child->nodeType == XML_TEXT_NODE) {
- $this->_text = $child->nodeValue;
- } else {
- $extensionElement = new Extension\Element();
- $extensionElement->transferFromDOM($child);
- $this->_extensionElements[] = $extensionElement;
- }
- }
-
- /**
- * Given a DOMNode representing an attribute, tries to map the data into
- * instance members. If no mapping is defined, the name and value are
- * stored in an array.
- *
- * @param DOMNode $attribute The DOMNode attribute needed to be handled
- */
- protected function takeAttributeFromDOM($attribute)
- {
- $arrayIndex = ($attribute->namespaceURI != '')?(
- $attribute->namespaceURI . ':' . $attribute->name):
- $attribute->name;
- $this->_extensionAttributes[$arrayIndex] =
- array('namespaceUri' => $attribute->namespaceURI,
- 'name' => $attribute->localName,
- 'value' => $attribute->nodeValue);
- }
-
- /**
- * Transfers each child and attribute into member variables.
- * This is called when XML is received over the wire and the data
- * model needs to be built to represent this XML.
- *
- * @param DOMNode $node The DOMNode that represents this object's data
- */
- public function transferFromDOM($node)
- {
- foreach ($node->childNodes as $child) {
- $this->takeChildFromDOM($child);
- }
- foreach ($node->attributes as $attribute) {
- $this->takeAttributeFromDOM($attribute);
- }
- }
-
- /**
- * Parses the provided XML text and generates data model classes for
- * each know element by turning the XML text into a DOM tree and calling
- * transferFromDOM($element). The first data model element with the same
- * name as $this->_rootElement is used and the child elements are
- * recursively parsed.
- *
- * @param string $xml The XML text to parse
- */
- public function transferFromXML($xml)
- {
- if ($xml) {
- // Load the feed as an XML DOMDocument object
- @ini_set('track_errors', 1);
- $doc = new \DOMDocument();
- $success = @$doc->loadXML($xml);
- @ini_restore('track_errors');
- if (!$success) {
- throw new Exception("DOMDocument cannot parse XML: $php_errormsg");
- }
- $element = $doc->getElementsByTagName($this->_rootElement)->item(0);
- if (!$element) {
- throw new Exception('No root <' . $this->_rootElement . '> element');
- }
- $this->transferFromDOM($element);
- } else {
- throw new Exception('XML passed to transferFromXML cannot be null');
- }
- }
-
- /**
- * Converts this element and all children into XML text using getDOM()
- *
- * @return string XML content
- */
- public function saveXML()
- {
- $element = $this->getDOM();
- return $element->ownerDocument->saveXML($element);
- }
-
- /**
- * Alias for saveXML() returns XML content for this element and all
- * children
- *
- * @return string XML content
- */
- public function getXML()
- {
- return $this->saveXML();
- }
-
- /**
- * Alias for saveXML()
- *
- * Can be overridden by children to provide more complex representations
- * of entries.
- *
- * @return string Encoded string content
- */
- public function encode()
- {
- return $this->saveXML();
- }
-
- /**
- * 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.
- *
- * @param string $prefix The namespace prefix to lookup.
- * @param integer $majorVersion The major protocol version in effect.
- * Defaults to '1'.
- * @param integer $minorVersion The minor protocol version in effect.
- * Defaults to null (use latest).
- * @return string
- */
- public function lookupNamespace($prefix,
- $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
- $nsData = $this->_namespaces[$prefix];
- $foundMajorV = Util::findGreatestBoundedValue(
- $majorVersion, $nsData);
- // Minor version search
- $nsData = $nsData[$foundMajorV];
- $foundMinorV = Util::findGreatestBoundedValue(
- $minorVersion, $nsData);
- // Extract NS
- $result = $nsData[$foundMinorV];
- }
-
- // Memoize result
- self::$_namespaceLookupCache[$key] = $result;
-
- return $result;
- }
-
- /**
- * Add a namespace and prefix to the registered list
- *
- * Takes a prefix and a full namespace URI and adds them to the
- * 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.
- * Defaults to '1'.
- * @param integer $minorVersion The minor protocol version in effect.
- * Defaults to null (use latest).
- * @return void
- */
- public function registerNamespace($prefix,
- $namespaceUri,
- $majorVersion = 1,
- $minorVersion = 0)
- {
- $this->_namespaces[$prefix][$majorVersion][$minorVersion] =
- $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
- * is defined, this is returned.
- *
- * TODO Remove ability to bypass getFoo() methods??
- *
- * @param string $name The variable name sought
- */
- public function __get($name)
- {
- $method = 'get'.ucfirst($name);
- if (method_exists($this, $method)) {
- return call_user_func(array(&$this, $method));
- } else if (property_exists($this, "_${name}")) {
- return $this->{'_' . $name};
- } else {
- throw new InvalidArgumentException(
- 'Property ' . $name . ' does not exist');
- }
- }
-
- /**
- * Magic setter to allow acces like $entry->foo='bar' to call
- * $entry->setFoo('bar') automatically.
- *
- * Alternatively, if no setFoo() is defined, but a $_foo protected variable
- * is defined, this is returned.
- *
- * TODO Remove ability to bypass getFoo() methods??
- *
- * @param string $name
- * @param string $value
- */
- public function __set($name, $val)
- {
- $method = 'set'.ucfirst($name);
- if (method_exists($this, $method)) {
- return call_user_func(array(&$this, $method), $val);
- } else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
- $this->{'_' . $name} = $val;
- } else {
- throw new InvalidArgumentException(
- 'Property ' . $name . ' does not exist');
- }
- }
-
- /**
- * Magic __isset method
- *
- * @param string $name
- */
- public function __isset($name)
- {
- $rc = new \ReflectionClass(get_class($this));
- $privName = '_' . $name;
- if (!($rc->hasProperty($privName))) {
- throw new InvalidArgumentException(
- 'Property ' . $name . ' does not exist');
- } else {
- if (isset($this->{$privName})) {
- if (is_array($this->{$privName})) {
- if (count($this->{$privName}) > 0) {
- return true;
- } else {
- return false;
- }
- } else {
- return true;
- }
- } else {
- return false;
- }
- }
- }
-
- /**
- * Magic __unset method
- *
- * @param string $name
- */
- public function __unset($name)
- {
- if (isset($this->{'_' . $name})) {
- if (is_array($this->{'_' . $name})) {
- $this->{'_' . $name} = array();
- } else {
- $this->{'_' . $name} = null;
- }
- }
- }
-
- /**
- * Magic toString method allows using this directly via echo
- * Works best in PHP >= 4.2.0
- *
- * @return string The text representation of this object
- */
- public function __toString()
- {
- return $this->getText();
- }
-
-}
View
178 library/Zend/GData/App/BaseMediaSource.php
@@ -1,178 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Concrete class to use a file handle as an attachment within a MediaEntry.
- *
- * @uses ReflectionClass
- * @uses \Zend\GData\App\InvalidArgumentException
- * @uses \Zend\GData\App\MediaSource
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-abstract class BaseMediaSource implements MediaSource
-{
-
- /**
- * The content type for the attached file (example image/png)
- *
- * @var string
- */
- protected $_contentType = null;
-
- /**
- * The slug header value representing the attached file title, or null if
- * no slug should be used. The slug header is only necessary in some cases,
- * usually when a multipart upload is not being performed.
- *
- * @var string
- */
- protected $_slug = null;
-
- /**
- * The content type for the attached file (example image/png)
- *
- * @return string The content type
- */
- public function getContentType()
- {
- return $this->_contentType;
- }
-
- /**
- * Set the content type for the file attached (example image/png)
- *
- * @param string $value The content type
- * @return \Zend\GData\App\MediaFileSource Provides a fluent interface
- */
- public function setContentType($value)
- {
- $this->_contentType = $value;
- return $this;
- }
-
- /**
- * 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
- */
- public function getSlug(){
- return $this->_slug;
- }
-
- /**
- * 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
- * @return \Zend\GData\App\MediaSource Provides a fluent interface
- */
- public function setSlug($value){
- $this->_slug = $value;
- return $this;
- }
-
-
- /**
- * Magic getter to allow acces like $source->foo to call $source->getFoo()
- * Alternatively, if no getFoo() is defined, but a $_foo protected variable
- * is defined, this is returned.
- *
- * TODO Remove ability to bypass getFoo() methods??
- *
- * @param string $name The variable name sought
- */
- public function __get($name)
- {
- $method = 'get'.ucfirst($name);
- if (method_exists($this, $method)) {
- return call_user_func(array(&$this, $method));
- } else if (property_exists($this, "_${name}")) {
- return $this->{'_' . $name};
- } else {
- throw new InvalidArgumentException(
- 'Property ' . $name . ' does not exist');
- }
- }
-
- /**
- * Magic setter to allow acces like $source->foo='bar' to call
- * $source->setFoo('bar') automatically.
- *
- * Alternatively, if no setFoo() is defined, but a $_foo protected variable
- * is defined, this is returned.
- *
- * @param string $name
- * @param string $value
- */
- public function __set($name, $val)
- {
- $method = 'set'.ucfirst($name);
- if (method_exists($this, $method)) {
- return call_user_func(array(&$this, $method), $val);
- } else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
- $this->{'_' . $name} = $val;
- } else {
- throw new InvalidArgumentException(
- 'Property ' . $name . ' does not exist');
- }
- }
-
- /**
- * Magic __isset method
- *
- * @param string $name
- */
- public function __isset($name)
- {
- $rc = new \ReflectionClass(get_class($this));
- $privName = '_' . $name;
- if (!($rc->hasProperty($privName))) {
- throw new InvalidArgumentException(
- 'Property ' . $name . ' does not exist');
- } else {
- if (isset($this->{$privName})) {
- if (is_array($this->{$privName})) {
- if (count($this->{$privName}) > 0) {
- return true;
- } else {
- return false;
- }
- } else {
- return true;
- }
- } else {
- return false;
- }
- }
- }
-
-}
View
94 library/Zend/GData/App/CaptchaRequiredException.php
@@ -1,94 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Gdata exceptions
- *
- * Class to represent an exception that occurs during the use of ClientLogin.
- * This particular exception happens when a CAPTCHA challenge is issued. This
- * challenge is a visual puzzle presented to the user to prove that they are
- * not an automated system.
- *
- * @uses \Zend\GData\App\AuthException
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class CaptchaRequiredException extends AuthException
-{
- /**
- * The Google Accounts URL prefix.
- */
- const ACCOUNTS_URL = 'https://www.google.com/accounts/';
-
- /**
- * The token identifier from the server.
- *
- * @var string
- */
- private $captchaToken;
-
- /**
- * The URL of the CAPTCHA image.
- *
- * @var string
- */
- private $captchaUrl;
-
- /**
- * Constructs the exception to handle a CAPTCHA required response.
- *
- * @param string $captchaToken The CAPTCHA token ID provided by the server.
- * @param string $captchaUrl The URL to the CAPTCHA challenge image.
- */
- public function __construct($captchaToken, $captchaUrl) {
- $this->captchaToken = $captchaToken;
- $this->captchaUrl = self::ACCOUNTS_URL . $captchaUrl;
- parent::__construct('CAPTCHA challenge issued by server');
- }
-
- /**
- * Retrieves the token identifier as provided by the server.
- *
- * @return string
- */
- public function getCaptchaToken() {
- return $this->captchaToken;
- }
-
- /**
- * Retrieves the URL CAPTCHA image as provided by the server.
- *
- * @return string
- */
- public function getCaptchaUrl() {
- return $this->captchaUrl;
- }
-
-}
View
365 library/Zend/GData/App/Entry.php
@@ -1,365 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Concrete class for working with Atom entries.
- *
- * @uses \Zend\GData\App\Extension\Content
- * @uses \Zend\GData\App\Extension\Control
- * @uses \Zend\GData\App\Extension\Edited
- * @uses \Zend\GData\App\Extension\Published
- * @uses \Zend\GData\App\Extension\Source
- * @uses \Zend\GData\App\Extension\Summary
- * @uses \Zend\GData\App\FeedEntryParent
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Entry extends FeedEntryParent
-{
-
- /**
- * Root XML element for Atom entries.
- *
- * @var string
- */
- protected $_rootElement = 'entry';
-
- /**
- * Class name for each entry in this feed*
- *
- * @var string
- */
- protected $_entryClassName = '\Zend\GData\App\Entry';
-
- /**
- * atom:content element
- *
- * @var \Zend\GData\App\Extension\Content
- */
- protected $_content = null;
-
- /**
- * atom:published element
- *
- * @var \Zend\GData\App\Extension\Published
- */
- protected $_published = null;
-
- /**
- * atom:source element
- *
- * @var \Zend\GData\App\Extension\Source
- */
- protected $_source = null;
-
- /**
- * atom:summary element
- *
- * @var \Zend\GData\App\Extension\Summary
- */
- protected $_summary = null;
-
- /**
- * app:control element
- *
- * @var \Zend\GData\App\Extension\Control
- */
- 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);
- if ($this->_content != null) {
- $element->appendChild($this->_content->getDOM($element->ownerDocument));
- }
- if ($this->_published != null) {
- $element->appendChild($this->_published->getDOM($element->ownerDocument));
- }
- if ($this->_source != null) {
- $element->appendChild($this->_source->getDOM($element->ownerDocument));
- }
- if ($this->_summary != null) {
- $element->appendChild($this->_summary->getDOM($element->ownerDocument));
- }
- if ($this->_control != null) {
- $element->appendChild($this->_control->getDOM($element->ownerDocument));
- }
- if ($this->_edited != null) {
- $element->appendChild($this->_edited->getDOM($element->ownerDocument));
- }
- return $element;
- }
-
- protected function takeChildFromDOM($child)
- {
- $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
- switch ($absoluteNodeName) {
- case $this->lookupNamespace('atom') . ':' . 'content':
- $content = new Extension\Content();
- $content->transferFromDOM($child);
- $this->_content = $content;
- break;
- case $this->lookupNamespace('atom') . ':' . 'published':
- $published = new Extension\Published();
- $published->transferFromDOM($child);
- $this->_published = $published;
- break;
- case $this->lookupNamespace('atom') . ':' . 'source':
- $source = new Extension\Source();
- $source->transferFromDOM($child);
- $this->_source = $source;
- break;
- case $this->lookupNamespace('atom') . ':' . 'summary':
- $summary = new Extension\Summary();
- $summary->transferFromDOM($child);
- $this->_summary = $summary;
- break;
- case $this->lookupNamespace('app') . ':' . 'control':
- $control = new Extension\Control();
- $control->transferFromDOM($child);
- $this->_control = $control;
- break;
- case $this->lookupNamespace('app') . ':' . 'edited':
- $edited = new Extension\Edited();
- $edited->transferFromDOM($child);
- $this->_edited = $edited;
- break;
- default:
- parent::takeChildFromDOM($child);
- break;
- }
- }
-
- /**
- * Uploads changes in this entry to the server using Zend_Gdata_App
- *
- * @param string|null $uri The URI to send requests to, or null if $data
- * contains the URI.
- * @param string|null $className The name of the class that should we
- * deserializing the server response. If null, then
- * 'Zend_Gdata_App_Entry' will be used.
- * @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 updated entry.
- * @throws \Zend\GData\App\Exception
- */
- public function save($uri = null, $className = null, $extraHeaders = array())
- {
- return $this->getService()->updateEntry($this,
- $uri,
- $className,
- $extraHeaders);
- }
-
- /**
- * Deletes this entry to the server using the referenced
- * Zend_Http_Client to do a HTTP DELETE to the edit link stored in this
- * entry's link collection.
- *
- * @return void
- * @throws \Zend\GData\App\Exception
- */
- public function delete()
- {
- $this->getService()->delete($this);
- }
-
- /**
- * Reload the current entry. Returns a new copy of the entry as returned
- * by the server, or null if no changes exist. This does not
- * modify the current entry instance.
- *
- * @param string|null The URI to send requests to, or null if $data
- * contains the URI.
- * @param string|null The name of the class that should we deserializing
- * the server response. If null, then 'Zend_Gdata_App_Entry' will
- * be used.
- * @param array $extraHeaders Extra headers to add to the request, as an
- * array of string-based key/value pairs.
- * @return mixed A new instance of the current entry with updated data, or
- * null if the server reports that no changes have been made.
- * @throws \Zend\GData\App\Exception
- */
- public function reload($uri = null, $className = null, $extraHeaders = array())
- {
- // Get URI
- $editLink = $this->getEditLink();
- if (($uri === null) && $editLink != null) {
- $uri = $editLink->getHref();
- }
-
- // Set classname to current class, if not otherwise set
- 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
- && !array_key_exists('If-Match', $extraHeaders)
- && !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;
- try {
- $result = $this->service->importUrl($uri, $className, $extraHeaders);
- } catch (HttpException $e) {
- if ($e->getResponse()->getStatus() != '304')
- throw $e;
- }
-
- return $result;
- }
-
- /**
- * Gets the value of the atom:content element
- *
- * @return \Zend\GData\App\Extension\Content
- */
- public function getContent()
- {
- return $this->_content;
- }
-
- /**
- * Sets the value of the atom:content element
- *
- * @param \Zend\GData\App\Extension\Content $value
- * @return \Zend\GData\App\Entry Provides a fluent interface
- */
- public function setContent($value)
- {
- $this->_content = $value;
- return $this;
- }
-
- /**
- * Sets the value of the atom:published element
- * This represents the publishing date for an entry
- *
- * @return \Zend\GData\App\Extension\Published
- */
- public function getPublished()
- {
- return $this->_published;
- }
-
- /**
- * Sets the value of the atom:published element
- * This represents the publishing date for an entry
- *
- * @param \Zend\GData\App\Extension\Published $value
- * @return \Zend\GData\App\Entry Provides a fluent interface
- */
- public function setPublished($value)
- {
- $this->_published = $value;
- return $this;
- }
-
- /**
- * Gets the value of the atom:source element
- *
- * @return \Zend\GData\App\Extension\Source
- */
- public function getSource()
- {
- return $this->_source;
- }
-
- /**
- * Sets the value of the atom:source element
- *
- * @param \Zend\GData\App\Extension\Source $value
- * @return \Zend\GData\App\Entry Provides a fluent interface
- */
- public function setSource($value)
- {
- $this->_source = $value;
- return $this;
- }
-
- /**
- * Gets the value of the atom:summary element
- * This represents a textual summary of this entry's content
- *
- * @return \Zend\GData\App\Extension\Summary
- */
- public function getSummary()
- {
- return $this->_summary;
- }
-
- /**
- * Sets the value of the atom:summary element
- * This represents a textual summary of this entry's content
- *
- * @param \Zend\GData\App\Extension\Summary $value
- * @return \Zend\GData\App\Entry Provides a fluent interface
- */
- public function setSummary($value)
- {
- $this->_summary = $value;
- return $this;
- }
-
- /**
- * Gets the value of the app:control element
- *
- * @return \Zend\GData\App\Extension\Control
- */
- public function getControl()
- {
- return $this->_control;
- }
-
- /**
- * Sets the value of the app:control element
- *
- * @param \Zend\GData\App\Extension\Control $value
- * @return \Zend\GData\App\Entry Provides a fluent interface
- */
- public function setControl($value)
- {
- $this->_control = $value;
- return $this;
- }
-
-}
View
42 library/Zend/GData/App/Exception.php
@@ -1,42 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Gdata App exceptions
- *
- * Class to represent exceptions that occur during Gdata App operations.
- *
- * @uses \Zend\Exception
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Exception extends \Zend\Exception
-{
-}
View
88 library/Zend/GData/App/Extension/Content.php
@@ -1,88 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App\Extension;
-
-/**
- * Represents the atom:content element
- *
- * @uses \Zend\GData\App\Extension\Text
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Content extends Text
-{
-
- protected $_rootElement = 'content';
- protected $_src = null;
-
- public function __construct($text = null, $type = 'text', $src = null)
- {
- parent::__construct($text, $type);
- $this->_src = $src;
- }
-
- public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
- {
- $element = parent::getDOM($doc, $majorVersion, $minorVersion);
- if ($this->_src !== null) {
- $element->setAttribute('src', $this->_src);
- }
- return $element;
- }
-
- protected function takeAttributeFromDOM($attribute)
- {
- switch ($attribute->localName) {
- case 'src':
- $this->_src = $attribute->nodeValue;
- break;
- default:
- parent::takeAttributeFromDOM($attribute);
- }
- }
-
- /**
- * @return string
- */
- public function getSrc()
- {
- return $this->_src;
- }
-
- /**
- * @param string $value
- * @return \Zend\GData\App\Entry Provides a fluent interface
- */
- public function setSrc($value)
- {
- $this->_src = $value;
- return $this;
- }
-
-}
View
49 library/Zend/GData/App/Extension/Rights.php
@@ -1,49 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App\Extension;
-
-/**
- * Represents the atom:rights element
- *
- * @uses \Zend\GData\App\Extension\Text
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Rights extends Text
-{
-
- protected $_rootElement = 'rights';
-
- public function __construct($text = null)
- {
- parent::__construct();
- $this->_text = $text;
- }
-
-}
View
42 library/Zend/GData/App/Extension/Source.php
@@ -1,42 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App\Extension;
-
-/**
- * @uses \Zend\GData\App\Entry
- * @uses \Zend\GData\App\FeedSourceParent
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Source extends \Zend\GData\App\FeedSourceParent
-{
-
- protected $_rootElement = 'source';
-
-}
View
43 library/Zend/GData/App/Extension/Subtitle.php
@@ -1,43 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App\Extension;
-
-/**
- * Represents the atom:subtitle element
- *
- * @uses \Zend\GData\App\Extension\Text
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Subtitle extends Text
-{
-
- protected $_rootElement = 'subtitle';
-
-}
View
43 library/Zend/GData/App/Extension/Summary.php
@@ -1,43 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App\Extension;
-
-/**
- * Represents the atom:summary element
- *
- * @uses \Zend\GData\App\Extension\Text
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Summary extends Text
-{
-
- protected $_rootElement = 'summary';
-
-}
View
43 library/Zend/GData/App/Extension/Title.php
@@ -1,43 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App\Extension;
-
-/**
- * Represents the atom:title element
- *
- * @uses \Zend\GData\App\Extension\Text
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Title extends Text
-{
-
- protected $_rootElement = 'title';
-
-}
View
347 library/Zend/GData/App/Feed.php
@@ -1,347 +0,0 @@
-<?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-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\GData\App;
-
-/**
- * Atom feed class
- *
- * @uses \Zend\GData\App\Entry
- * @uses \Zend\GData\App\FeedSourceParent
- * @uses \Zend\GData\App\HttpException
- * @category Zend
- * @package Zend_Gdata
- * @subpackage App
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Feed extends FeedSourceParent
- implements \Iterator, \ArrayAccess
-{
-
- /**
- * The root xml element of this data element
- *
- * @var string
- */
- protected $_rootElement = 'feed';
-
- /**
- * Cache of feed entries.
- *
- * @var array
- */
- protected $_entry = array();
-
- /**
- * Current location in $_entry array
- *
- * @var int
- */
- protected $_entryIndex = 0;
-
- /**
- * Make accessing some individual elements of the feed easier.
- *
- * Special accessors 'entry' and 'entries' are provided so that if
- * you wish to iterate over an Atom feed's entries, you can do so
- * using foreach ($feed->entries as $entry) or foreach
- * ($feed->entry as $entry).
- *
- * @param string $var The property to get.
- * @return mixed
- */
- public function __get($var)
- {
- switch ($var) {
- case 'entries':
- return $this;
- default:
- return parent::__get($var);
- }
- }
-
- /**
- * Retrieves the DOM model representing this object and all children
- *
- * @param DOMDocument $doc
- * @return DOMElement
- */
- public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
- {
- $element = parent::getDOM($doc, $majorVersion, $minorVersion);
- foreach ($this->_entry as $entry) {
- $element->appendChild($entry->getDOM($element->ownerDocument));
- }
- return $element;
- }
-
- /**
- * Creates individual Entry objects of the appropriate type and
- * stores them in the $_entry array based upon DOM data.
- *
- * @param DOMNode $child The DOMNode to process
- */
- protected function takeChildFromDOM($child)
- {
- $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
- switch ($absoluteNodeName) {
- 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:
- parent::takeChildFromDOM($child);
- break;
- }
- }
-
- /**
- * Get the number of entries in this feed object.
- *
- * @return integer Entry count.
- */
- public function count()
- {
- return count($this->_entry);
- }
-
- /**
- * Required by the Iterator interface.
- *
- * @return void
- */
- public function rewind()
- {
- $this->_entryIndex = 0;
- }
-
- /**
- * Required by the Iterator interface.
- *
- * @return mixed The current row, or null if no rows.
- */
- public function current()
- {
- return $this->_entry[$this->_entryIndex];
- }
-
- /**
- * Required by the Iterator interface.
- *
- * @return mixed The current row number (starts at 0), or NULL if no rows
- */
- public function key()
- {
- return $this->_entryIndex;
- }
-
- /**
- * Required by the Iterator interface.
- *
- * @return mixed The next row, or null if no more rows.
- */
- public function next()
- {
- ++$this->_entryIndex;
- }
-
- /**
- * Required by the Iterator interface.
- *
- * @return boolean Whether the iteration is valid
- */
- public function valid()
- {
- return 0 <= $this->_entryIndex && $this->_entryIndex < $this->count();
- }
-
- /**
- * Gets the array of atom:entry elements contained within this
- * atom:feed representation
- *
- * @return array \Zend\GData\App\Entry array
- */
- public function getEntry()
- {
- return $this->_entry;
- }
-
- /**
- * Sets the array of atom:entry elements contained within this
- * atom:feed representation
- *
- * @param array $value The array of \Zend\GData\App\Entry elements
- * @return \Zend\GData\App\Feed Provides a fluent interface
- */
- public function setEntry($value)
- {
- $this->_entry = $value;
- return $this;
- }
-
- /**
- * Adds an entry representation to the array of entries
- * contained within this feed
- *
- * @param \Zend\GData\App\Entry An individual entry to add.
- * @return \Zend\GData\App\Feed Provides a fluent interface
- */
- public function addEntry($value)
- {
- $this->_entry[] = $value;
- return $this;
- }
-
- /**
- * Required by the ArrayAccess interface
- *
- * @param int $key The index to set
- * @param \Zend\GData\App\Entry $value The value to set
- * @return void
- */
- public function offsetSet($key, $value)
- {
- $this->_entry[$key] = $value;
- }
-
- /**
- * Required by the ArrayAccess interface
- *
- * @param int $key The index to get
- * @param \Zend\GData\App\Entry $value The value to set
- */
- public function offsetGet($key)
- {
- if (array_key_exists($key, $this->_entry)) {
- return $this->_entry[$key];
- }
- }
-
- /**
- * Required by the ArrayAccess interface
- *
- * @param int $key The index to set
- * @param \Zend\GData\App\Entry $value The value to set
- */
- public function offsetUnset($key)
- {
- if (array_key_exists($key, $this->_entry)) {
- unset($this->_entry[$key]);
- }
- }
-
- /**
- * Required by the ArrayAccess interface
- *
- * @param int $key The index to check for existence
- * @return boolean
- */
- public function offsetExists($key)
- {
- return (array_key_exists($key, $this->_entry));
- }
-
- /**
- * Retrieve the next set of results from this feed.
- *
- * @throws \Zend\GData\App\Exception
- * @return mixed|null Returns the next set of results as a feed of the same
- * class as this feed, or null if no results exist.
- */
- public function getNextFeed()
- {
- $nextLink = $this->getNextLink();
- if (!$nextLink) {
- throw new Exception('No link to next set ' .
- 'of results found.');
- }
- $nextLinkHref = $nextLink->getHref();
- $service = new App($this->getHttpClient());
-
- return $service->getFeed($nextLinkHref, get_class($this));
- }
-
- /**
- * Retrieve the previous set of results from this feed.
- *
- * @throws \Zend\GData\App\Exception
- * @return mixed|null Returns the previous set of results as a feed of
- * the same class as this feed, or null if no results exist.
- */
- public function getPreviousFeed()
- {
- $previousLink = $this->getPreviousLink();
- if (!$previousLink) {
- throw new Exception('No link to previous set ' .
- 'of results found.');
- }
- $previousLinkHref = $previousLink->getHref();
- $service = new App($this->getHttpClient());
-
- 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
42 library/Zend/GData/App/IOException.php