";
-
-}
diff --git a/library/Zend/Feed.php b/library/Zend/Feed.php
deleted file mode 100644
index 63286adb88..0000000000
--- a/library/Zend/Feed.php
+++ /dev/null
@@ -1,409 +0,0 @@
- 'http://a9.com/-/spec/opensearchrss/1.0/',
- 'atom' => 'http://www.w3.org/2005/Atom',
- 'rss' => 'http://blogs.law.harvard.edu/tech/rss',
- );
-
-
- /**
- * Set the HTTP client instance
- *
- * Sets the HTTP client object to use for retrieving the feeds.
- *
- * @param Zend_Http_Client $httpClient
- * @return void
- */
- public static function setHttpClient(Zend_Http_Client $httpClient)
- {
- self::$_httpClient = $httpClient;
- }
-
-
- /**
- * Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used.
- *
- * @return Zend_Http_Client_Abstract
- */
- public static function getHttpClient()
- {
- if (!self::$_httpClient instanceof Zend_Http_Client) {
- /**
- * @see Zend_Http_Client
- */
- #require_once 'Zend/Http/Client.php';
- self::$_httpClient = new Zend_Http_Client();
- }
-
- return self::$_httpClient;
- }
-
-
- /**
- * Toggle using POST instead of PUT and DELETE HTTP methods
- *
- * Some feed implementations do not accept PUT and DELETE HTTP
- * methods, or they can't be used because of proxies or other
- * measures. This allows turning on using POST where PUT and
- * DELETE would normally be used; in addition, an
- * X-Method-Override header will be sent with a value of PUT or
- * DELETE as appropriate.
- *
- * @param boolean $override Whether to override PUT and DELETE.
- * @return void
- */
- public static function setHttpMethodOverride($override = true)
- {
- self::$_httpMethodOverride = $override;
- }
-
-
- /**
- * Get the HTTP override state
- *
- * @return boolean
- */
- public static function getHttpMethodOverride()
- {
- return self::$_httpMethodOverride;
- }
-
-
- /**
- * 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.
- *
- * @return string
- */
- public static function lookupNamespace($prefix)
- {
- return isset(self::$_namespaces[$prefix]) ?
- self::$_namespaces[$prefix] :
- $prefix;
- }
-
-
- /**
- * 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
- * Zend_Feed::lookupNamespace().
- *
- * @param string $prefix The namespace prefix
- * @param string $namespaceURI The full namespace URI
- * @return void
- */
- public static function registerNamespace($prefix, $namespaceURI)
- {
- self::$_namespaces[$prefix] = $namespaceURI;
- }
-
-
- /**
- * Imports a feed located at $uri.
- *
- * @param string $uri
- * @throws Zend_Feed_Exception
- * @return Zend_Feed_Abstract
- */
- public static function import($uri)
- {
- $client = self::getHttpClient();
- $client->setUri($uri);
- $response = $client->request('GET');
- if ($response->getStatus() !== 200) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus());
- }
- $feed = $response->getBody();
- return self::importString($feed);
- }
-
-
- /**
- * Imports a feed represented by $string.
- *
- * @param string $string
- * @throws Zend_Feed_Exception
- * @return Zend_Feed_Abstract
- */
- public static function importString($string)
- {
- if (trim($string) == '') {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Document/string being imported'
- . ' is an Empty string or comes from an empty HTTP response');
- }
- $doc = new DOMDocument;
- $doc = Zend_Xml_Security::scan($string, $doc);
-
- if (!$doc) {
- // prevent the class to generate an undefined variable notice (ZF-2590)
- // Build error message
- $error = libxml_get_last_error();
- if ($error && $error->message) {
- $errormsg = "DOMDocument cannot parse XML: {$error->message}";
- } else {
- $errormsg = "DOMDocument cannot parse XML";
- }
-
-
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception($errormsg);
- }
-
- // Try to find the base feed element or a single of an Atom feed
- if ($doc->getElementsByTagName('feed')->item(0) ||
- $doc->getElementsByTagName('entry')->item(0)) {
- /**
- * @see Zend_Feed_Atom
- */
- #require_once 'Zend/Feed/Atom.php';
- // return a newly created Zend_Feed_Atom object
- return new Zend_Feed_Atom(null, $string);
- }
-
- // Try to find the base feed element of an RSS feed
- if ($doc->getElementsByTagName('channel')->item(0)) {
- /**
- * @see Zend_Feed_Rss
- */
- #require_once 'Zend/Feed/Rss.php';
- // return a newly created Zend_Feed_Rss object
- return new Zend_Feed_Rss(null, $string);
- }
-
- // $string does not appear to be a valid feed of the supported types
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid or unsupported feed format');
- }
-
-
- /**
- * Imports a feed from a file located at $filename.
- *
- * @param string $filename
- * @throws Zend_Feed_Exception
- * @return Zend_Feed_Abstract
- */
- public static function importFile($filename)
- {
- @ini_set('track_errors', 1);
- $feed = @file_get_contents($filename);
- @ini_restore('track_errors');
- if ($feed === false) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("File could not be loaded: $php_errormsg");
- }
- return self::importString($feed);
- }
-
-
- /**
- * Attempts to find feeds at $uri referenced by tags. Returns an
- * array of the feeds referenced at $uri.
- *
- * @todo Allow findFeeds() to follow one, but only one, code 302.
- *
- * @param string $uri
- * @throws Zend_Feed_Exception
- * @return array
- */
- public static function findFeeds($uri)
- {
- // Get the HTTP response from $uri and save the contents
- $client = self::getHttpClient();
- $client->setUri($uri);
- $response = $client->request();
- if ($response->getStatus() !== 200) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("Failed to access $uri, got response code " . $response->getStatus());
- }
- $contents = $response->getBody();
-
- // Parse the contents for appropriate tags
- @ini_set('track_errors', 1);
- $pattern = '~(]+)/?>~i';
- $result = @preg_match_all($pattern, $contents, $matches);
- @ini_restore('track_errors');
- if ($result === false) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("Internal error: $php_errormsg");
- }
-
- // Try to fetch a feed for each link tag that appears to refer to a feed
- $feeds = array();
- if (isset($matches[1]) && count($matches[1]) > 0) {
- foreach ($matches[1] as $link) {
- // force string to be an utf-8 one
- if (!mb_check_encoding($link, 'UTF-8')) {
- $link = mb_convert_encoding($link, 'UTF-8');
- }
- $xml = @Zend_Xml_Security::scan(rtrim($link, ' /') . ' />');
- if ($xml === false) {
- continue;
- }
- $attributes = $xml->attributes();
- if (!isset($attributes['rel']) || !@preg_match('~^(?:alternate|service\.feed)~i', $attributes['rel'])) {
- continue;
- }
- if (!isset($attributes['type']) ||
- !@preg_match('~^application/(?:atom|rss|rdf)\+xml~', $attributes['type'])) {
- continue;
- }
- if (!isset($attributes['href'])) {
- continue;
- }
- try {
- // checks if we need to canonize the given uri
- try {
- $uri = Zend_Uri::factory((string) $attributes['href']);
- } catch (Zend_Uri_Exception $e) {
- // canonize the uri
- $path = (string) $attributes['href'];
- $query = $fragment = '';
- if (substr($path, 0, 1) != '/') {
- // add the current root path to this one
- $path = rtrim($client->getUri()->getPath(), '/') . '/' . $path;
- }
- if (strpos($path, '?') !== false) {
- list($path, $query) = explode('?', $path, 2);
- }
- if (strpos($query, '#') !== false) {
- list($query, $fragment) = explode('#', $query, 2);
- }
- $uri = Zend_Uri::factory($client->getUri(true));
- $uri->setPath($path);
- $uri->setQuery($query);
- $uri->setFragment($fragment);
- }
-
- $feed = self::import($uri);
- } catch (Exception $e) {
- continue;
- }
- $feeds[$uri->getUri()] = $feed;
- }
- }
-
- // Return the fetched feeds
- return $feeds;
- }
-
- /**
- * Construct a new Zend_Feed_Abstract object from a custom array
- *
- * @param array $data
- * @param string $format (rss|atom) the requested output format
- * @return Zend_Feed_Abstract
- */
- public static function importArray(array $data, $format = 'atom')
- {
- $obj = 'Zend_Feed_' . ucfirst(strtolower($format));
- if (!class_exists($obj)) {
- #require_once 'Zend/Loader.php';
- Zend_Loader::loadClass($obj);
- }
-
- /**
- * @see Zend_Feed_Builder
- */
- #require_once 'Zend/Feed/Builder.php';
- return new $obj(null, null, new Zend_Feed_Builder($data));
- }
-
- /**
- * Construct a new Zend_Feed_Abstract object from a Zend_Feed_Builder_Interface data source
- *
- * @param Zend_Feed_Builder_Interface $builder this object will be used to extract the data of the feed
- * @param string $format (rss|atom) the requested output format
- * @return Zend_Feed_Abstract
- */
- public static function importBuilder(Zend_Feed_Builder_Interface $builder, $format = 'atom')
- {
- $obj = 'Zend_Feed_' . ucfirst(strtolower($format));
- if (!class_exists($obj)) {
- #require_once 'Zend/Loader.php';
- Zend_Loader::loadClass($obj);
- }
- return new $obj(null, null, $builder);
- }
-}
diff --git a/library/Zend/Feed/Abstract.php b/library/Zend/Feed/Abstract.php
deleted file mode 100644
index afc9b720f0..0000000000
--- a/library/Zend/Feed/Abstract.php
+++ /dev/null
@@ -1,301 +0,0 @@
-setUri($uri);
- $response = $client->request('GET');
- if ($response->getStatus() !== 200) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus() . '; request: ' . $client->getLastRequest() . "\nresponse: " . $response->asString());
- }
- $this->_element = $this->_importFeedFromString($response->getBody());
- $this->__wakeup();
- } elseif ($string !== null) {
- // Retrieve the feed from $string
- $this->_element = $string;
- $this->__wakeup();
- } else {
- // Generate the feed from the array
- $header = $builder->getHeader();
- $this->_element = new DOMDocument('1.0', $header['charset']);
- $root = $this->_mapFeedHeaders($header);
- $this->_mapFeedEntries($root, $builder->getEntries());
- $this->_element = $root;
- $this->_buildEntryCache();
- }
- }
-
-
- /**
- * Load the feed as an XML DOMDocument object
- *
- * @return void
- * @throws Zend_Feed_Exception
- */
- public function __wakeup()
- {
- @ini_set('track_errors', 1);
- $doc = new DOMDocument;
- $doc = @Zend_Xml_Security::scan($this->_element, $doc);
- @ini_restore('track_errors');
-
- if (!$doc) {
- // prevent the class to generate an undefined variable notice (ZF-2590)
- if (!isset($php_errormsg)) {
- if (function_exists('xdebug_is_enabled')) {
- $php_errormsg = '(error message not available, when XDebug is running)';
- } else {
- $php_errormsg = '(error message not available)';
- }
- }
-
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("DOMDocument cannot parse XML: $php_errormsg");
- }
-
- $this->_element = $doc;
- }
-
-
- /**
- * Prepare for serialiation
- *
- * @return array
- */
- public function __sleep()
- {
- $this->_element = $this->saveXML();
-
- return array('_element');
- }
-
-
- /**
- * Cache the individual feed elements so they don't need to be
- * searched for on every operation.
- *
- * @return void
- */
- protected function _buildEntryCache()
- {
- $this->_entries = array();
- foreach ($this->_element->childNodes as $child) {
- if ($child->localName == $this->_entryElementName) {
- $this->_entries[] = $child;
- }
- }
- }
-
-
- /**
- * Get the number of entries in this feed object.
- *
- * @return integer Entry count.
- */
- public function count()
- {
- return count($this->_entries);
- }
-
-
- /**
- * 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 new $this->_entryClassName(
- null,
- $this->_entries[$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();
- }
-
- /**
- * Generate the header of the feed when working in write mode
- *
- * @param array $array the data to use
- * @return DOMElement root node
- */
- abstract protected function _mapFeedHeaders($array);
-
- /**
- * Generate the entries of the feed when working in write mode
- *
- * @param DOMElement $root the root node to use
- * @param array $array the data to use
- * @return DOMElement root node
- */
- abstract protected function _mapFeedEntries(DOMElement $root, $array);
-
- /**
- * Send feed to a http client with the correct header
- *
- * @throws Zend_Feed_Exception if headers have already been sent
- * @return void
- */
- abstract public function send();
-
- /**
- * Import a feed from a string
- *
- * Protects against XXE attack vectors.
- *
- * @param string $feed
- * @return string
- * @throws Zend_Feed_Exception on detection of an XXE vector
- */
- protected function _importFeedFromString($feed)
- {
- if (trim($feed) == '') {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Remote feed being imported'
- . ' is an Empty string or comes from an empty HTTP response');
- }
- $doc = new DOMDocument;
- $doc = Zend_Xml_Security::scan($feed, $doc);
-
- if (!$doc) {
- // prevent the class to generate an undefined variable notice (ZF-2590)
- // Build error message
- $error = libxml_get_last_error();
- if ($error && $error->message) {
- $errormsg = "DOMDocument cannot parse XML: {$error->message}";
- } else {
- $errormsg = "DOMDocument cannot parse XML";
- }
-
-
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception($errormsg);
- }
-
- return $doc->saveXML($doc->documentElement);
- }
-}
diff --git a/library/Zend/Feed/Atom.php b/library/Zend/Feed/Atom.php
deleted file mode 100644
index 3a6da4bcb6..0000000000
--- a/library/Zend/Feed/Atom.php
+++ /dev/null
@@ -1,390 +0,0 @@
-
- * elements).
- *
- * @var string
- */
- protected $_entryElementName = 'entry';
-
- /**
- * The default namespace for Atom feeds.
- *
- * @var string
- */
- protected $_defaultNamespace = 'atom';
-
-
- /**
- * Override Zend_Feed_Abstract to set up the $_element and $_entries aliases.
- *
- * @return void
- * @throws Zend_Feed_Exception
- */
- public function __wakeup()
- {
- parent::__wakeup();
-
- // Find the base feed element and create an alias to it.
- $element = $this->_element->getElementsByTagName('feed')->item(0);
- if (!$element) {
- // Try to find a single instead.
- $element = $this->_element->getElementsByTagName($this->_entryElementName)->item(0);
- if (!$element) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('No root or <' . $this->_entryElementName
- . '> element found, cannot parse feed.');
- }
-
- $doc = new DOMDocument($this->_element->version,
- $this->_element->actualEncoding);
- $feed = $doc->appendChild($doc->createElement('feed'));
- $feed->appendChild($doc->importNode($element, true));
- $element = $feed;
- }
-
- $this->_element = $element;
-
- // Find the entries and save a pointer to them for speed and
- // simplicity.
- $this->_buildEntryCache();
- }
-
-
- /**
- * Easy access to tags keyed by "rel" attributes.
- *
- * If $elt->link() is called with no arguments, we will attempt to
- * return the value of the tag(s) like all other
- * method-syntax attribute access. If an argument is passed to
- * link(), however, then we will return the "href" value of the
- * first tag that has a "rel" attribute matching $rel:
- *
- * $elt->link(): returns the value of the link tag.
- * $elt->link('self'): returns the href from the first in the entry.
- *
- * @param string $rel The "rel" attribute to look for.
- * @return mixed
- */
- public function link($rel = null)
- {
- if ($rel === null) {
- return parent::__call('link', null);
- }
-
- // index link tags by their "rel" attribute.
- $links = parent::__get('link');
- if (!is_array($links)) {
- if ($links instanceof Zend_Feed_Element) {
- $links = array($links);
- } else {
- return $links;
- }
- }
-
- foreach ($links as $link) {
- if (empty($link['rel'])) {
- continue;
- }
- if ($rel == $link['rel']) {
- return $link['href'];
- }
- }
-
- return null;
- }
-
-
- /**
- * 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 access.
- * @return mixed
- */
- public function __get($var)
- {
- switch ($var) {
- case 'entry':
- // fall through to the next case
- case 'entries':
- return $this;
-
- default:
- return parent::__get($var);
- }
- }
-
- /**
- * Generate the header of the feed when working in write mode
- *
- * @param array $array the data to use
- * @return DOMElement root node
- */
- protected function _mapFeedHeaders($array)
- {
- $feed = $this->_element->createElement('feed');
- $feed->setAttribute('xmlns', 'http://www.w3.org/2005/Atom');
-
- $id = $this->_element->createElement('id', $array->link);
- $feed->appendChild($id);
-
- $title = $this->_element->createElement('title');
- $title->appendChild($this->_element->createCDATASection($array->title));
- $feed->appendChild($title);
-
- if (isset($array->author)) {
- $author = $this->_element->createElement('author');
- $name = $this->_element->createElement('name', $array->author);
- $author->appendChild($name);
- if (isset($array->email)) {
- $email = $this->_element->createElement('email', $array->email);
- $author->appendChild($email);
- }
- $feed->appendChild($author);
- }
-
- $updated = isset($array->lastUpdate) ? $array->lastUpdate : time();
- $updated = $this->_element->createElement('updated', date(DATE_ATOM, $updated));
- $feed->appendChild($updated);
-
- if (isset($array->published)) {
- $published = $this->_element->createElement('published', date(DATE_ATOM, $array->published));
- $feed->appendChild($published);
- }
-
- $link = $this->_element->createElement('link');
- $link->setAttribute('rel', 'self');
- $link->setAttribute('href', $array->link);
- if (isset($array->language)) {
- $link->setAttribute('hreflang', $array->language);
- }
- $feed->appendChild($link);
-
- if (isset($array->description)) {
- $subtitle = $this->_element->createElement('subtitle');
- $subtitle->appendChild($this->_element->createCDATASection($array->description));
- $feed->appendChild($subtitle);
- }
-
- if (isset($array->copyright)) {
- $copyright = $this->_element->createElement('rights', $array->copyright);
- $feed->appendChild($copyright);
- }
-
- if (isset($array->image)) {
- $image = $this->_element->createElement('logo', $array->image);
- $feed->appendChild($image);
- }
-
- $generator = !empty($array->generator) ? $array->generator : 'Zend_Feed';
- $generator = $this->_element->createElement('generator', $generator);
- $feed->appendChild($generator);
-
- return $feed;
- }
-
- /**
- * Generate the entries of the feed when working in write mode
- *
- * The following nodes are constructed for each feed entry
- *
- * url to feed entry
- * entry title
- * last update
- *
- * short text
- * long version, can contain html
- *
- *
- * @param array $array the data to use
- * @param DOMElement $root the root node to use
- * @return void
- */
- protected function _mapFeedEntries(DOMElement $root, $array)
- {
- foreach ($array as $dataentry) {
- $entry = $this->_element->createElement('entry');
-
- $id = $this->_element->createElement('id', isset($dataentry->guid) ? $dataentry->guid : $dataentry->link);
- $entry->appendChild($id);
-
- $title = $this->_element->createElement('title');
- $title->appendChild($this->_element->createCDATASection($dataentry->title));
- $entry->appendChild($title);
-
- $updated = isset($dataentry->lastUpdate) ? $dataentry->lastUpdate : time();
- $updated = $this->_element->createElement('updated', date(DATE_ATOM, $updated));
- $entry->appendChild($updated);
-
- $link = $this->_element->createElement('link');
- $link->setAttribute('rel', 'alternate');
- $link->setAttribute('href', $dataentry->link);
- $entry->appendChild($link);
-
- $summary = $this->_element->createElement('summary');
- $summary->appendChild($this->_element->createCDATASection($dataentry->description));
- $entry->appendChild($summary);
-
- if (isset($dataentry->content)) {
- $content = $this->_element->createElement('content');
- $content->setAttribute('type', 'html');
- $content->appendChild($this->_element->createCDATASection($dataentry->content));
- $entry->appendChild($content);
- }
-
- if (isset($dataentry->category)) {
- foreach ($dataentry->category as $category) {
- $node = $this->_element->createElement('category');
- $node->setAttribute('term', $category['term']);
- if (isset($category['scheme'])) {
- $node->setAttribute('scheme', $category['scheme']);
- }
- $entry->appendChild($node);
- }
- }
-
- if (isset($dataentry->source)) {
- $source = $this->_element->createElement('source');
- $title = $this->_element->createElement('title', $dataentry->source['title']);
- $source->appendChild($title);
- $link = $this->_element->createElement('link', $dataentry->source['title']);
- $link->setAttribute('rel', 'alternate');
- $link->setAttribute('href', $dataentry->source['url']);
- $source->appendChild($link);
- }
-
- if (isset($dataentry->enclosure)) {
- foreach ($dataentry->enclosure as $enclosure) {
- $node = $this->_element->createElement('link');
- $node->setAttribute('rel', 'enclosure');
- $node->setAttribute('href', $enclosure['url']);
- if (isset($enclosure['type'])) {
- $node->setAttribute('type', $enclosure['type']);
- }
- if (isset($enclosure['length'])) {
- $node->setAttribute('length', $enclosure['length']);
- }
- $entry->appendChild($node);
- }
- }
-
- if (isset($dataentry->comments)) {
- $comments = $this->_element->createElementNS('http://wellformedweb.org/CommentAPI/',
- 'wfw:comment',
- $dataentry->comments);
- $entry->appendChild($comments);
- }
- if (isset($dataentry->commentRss)) {
- $comments = $this->_element->createElementNS('http://wellformedweb.org/CommentAPI/',
- 'wfw:commentRss',
- $dataentry->commentRss);
- $entry->appendChild($comments);
- }
-
- $root->appendChild($entry);
- }
- }
-
- /**
- * Override Zend_Feed_Element to allow formated feeds
- *
- * @return string
- */
- public function saveXml()
- {
- // Return a complete document including XML prologue.
- $doc = new DOMDocument($this->_element->ownerDocument->version,
- $this->_element->ownerDocument->actualEncoding);
- $doc->appendChild($doc->importNode($this->_element, true));
- $doc->formatOutput = true;
-
- return $doc->saveXML();
- }
-
- /**
- * Send feed to a http client with the correct header
- *
- * @return void
- * @throws Zend_Feed_Exception if headers have already been sent
- */
- public function send()
- {
- if (headers_sent()) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Cannot send ATOM because headers have already been sent.');
- }
-
- header('Content-Type: application/atom+xml; charset=' . $this->_element->ownerDocument->actualEncoding);
-
- echo $this->saveXML();
- }
-}
diff --git a/library/Zend/Feed/Builder.php b/library/Zend/Feed/Builder.php
deleted file mode 100644
index 1254d8da0f..0000000000
--- a/library/Zend/Feed/Builder.php
+++ /dev/null
@@ -1,398 +0,0 @@
-
- * array(
- * 'title' => 'title of the feed', //required
- * 'link' => 'canonical url to the feed', //required
- * 'lastUpdate' => 'timestamp of the update date', // optional
- * 'published' => 'timestamp of the publication date', //optional
- * 'charset' => 'charset', // required
- * 'description' => 'short description of the feed', //optional
- * 'author' => 'author/publisher of the feed', //optional
- * 'email' => 'email of the author', //optional
- * 'webmaster' => 'email address for person responsible for technical issues' // optional, ignored if atom is used
- * 'copyright' => 'copyright notice', //optional
- * 'image' => 'url to image', //optional
- * 'generator' => 'generator', // optional
- * 'language' => 'language the feed is written in', // optional
- * 'ttl' => 'how long in minutes a feed can be cached before refreshing', // optional, ignored if atom is used
- * 'rating' => 'The PICS rating for the channel.', // optional, ignored if atom is used
- * 'cloud' => array(
- * 'domain' => 'domain of the cloud, e.g. rpc.sys.com' // required
- * 'port' => 'port to connect to' // optional, default to 80
- * 'path' => 'path of the cloud, e.g. /RPC2 //required
- * 'registerProcedure' => 'procedure to call, e.g. myCloud.rssPleaseNotify' // required
- * 'protocol' => 'protocol to use, e.g. soap or xml-rpc' // required
- * ), a cloud to be notified of updates // optional, ignored if atom is used
- * 'textInput' => array(
- * 'title' => 'the label of the Submit button in the text input area' // required,
- * 'description' => 'explains the text input area' // required
- * 'name' => 'the name of the text object in the text input area' // required
- * 'link' => 'the URL of the CGI script that processes text input requests' // required
- * ) // a text input box that can be displayed with the feed // optional, ignored if atom is used
- * 'skipHours' => array(
- * 'hour in 24 format', // e.g 13 (1pm)
- * // up to 24 rows whose value is a number between 0 and 23
- * ) // Hint telling aggregators which hours they can skip // optional, ignored if atom is used
- * 'skipDays ' => array(
- * 'a day to skip', // e.g Monday
- * // up to 7 rows whose value is a Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday
- * ) // Hint telling aggregators which days they can skip // optional, ignored if atom is used
- * 'itunes' => array(
- * 'author' => 'Artist column' // optional, default to the main author value
- * 'owner' => array(
- * 'name' => 'name of the owner' // optional, default to main author value
- * 'email' => 'email of the owner' // optional, default to main email value
- * ) // Owner of the podcast // optional
- * 'image' => 'album/podcast art' // optional, default to the main image value
- * 'subtitle' => 'short description' // optional, default to the main description value
- * 'summary' => 'longer description' // optional, default to the main description value
- * 'block' => 'Prevent an episode from appearing (yes|no)' // optional
- * 'category' => array(
- * array('main' => 'main category', // required
- * 'sub' => 'sub category' // optional
- * ),
- * // up to 3 rows
- * ) // 'Category column and in iTunes Music Store Browse' // required
- * 'explicit' => 'parental advisory graphic (yes|no|clean)' // optional
- * 'keywords' => 'a comma separated list of 12 keywords maximum' // optional
- * 'new-feed-url' => 'used to inform iTunes of new feed URL location' // optional
- * ) // Itunes extension data // optional, ignored if atom is used
- * 'entries' => array(
- * array(
- * 'title' => 'title of the feed entry', //required
- * 'link' => 'url to a feed entry', //required
- * 'description' => 'short version of a feed entry', // only text, no html, required
- * 'guid' => 'id of the article, if not given link value will used', //optional
- * 'content' => 'long version', // can contain html, optional
- * 'lastUpdate' => 'timestamp of the publication date', // optional
- * 'comments' => 'comments page of the feed entry', // optional
- * 'commentRss' => 'the feed url of the associated comments', // optional
- * 'source' => array(
- * 'title' => 'title of the original source' // required,
- * 'url' => 'url of the original source' // required
- * ) // original source of the feed entry // optional
- * 'category' => array(
- * array(
- * 'term' => 'first category label' // required,
- * 'scheme' => 'url that identifies a categorization scheme' // optional
- * ),
- * array(
- * //data for the second category and so on
- * )
- * ) // list of the attached categories // optional
- * 'enclosure' => array(
- * array(
- * 'url' => 'url of the linked enclosure' // required
- * 'type' => 'mime type of the enclosure' // optional
- * 'length' => 'length of the linked content in octets' // optional
- * ),
- * array(
- * //data for the second enclosure and so on
- * )
- * ) // list of the enclosures of the feed entry // optional
- * ),
- * array(
- * //data for the second entry and so on
- * )
- * )
- * );
- *
- *
- * @param array $data
- * @return void
- */
- public function __construct(array $data)
- {
- $this->_data = $data;
- $this->_createHeader($data);
- if (isset($data['entries'])) {
- $this->_createEntries($data['entries']);
- }
- }
-
- /**
- * Returns an instance of Zend_Feed_Builder_Header
- * describing the header of the feed
- *
- * @return Zend_Feed_Builder_Header
- */
- public function getHeader()
- {
- return $this->_header;
- }
-
- /**
- * Returns an array of Zend_Feed_Builder_Entry instances
- * describing the entries of the feed
- *
- * @return array of Zend_Feed_Builder_Entry
- */
- public function getEntries()
- {
- return $this->_entries;
- }
-
- /**
- * Create the Zend_Feed_Builder_Header instance
- *
- * @param array $data
- * @throws Zend_Feed_Builder_Exception
- * @return void
- */
- protected function _createHeader(array $data)
- {
- $mandatories = array('title', 'link', 'charset');
- foreach ($mandatories as $mandatory) {
- if (!isset($data[$mandatory])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("$mandatory key is missing");
- }
- }
- $this->_header = new Zend_Feed_Builder_Header($data['title'], $data['link'], $data['charset']);
- if (isset($data['lastUpdate'])) {
- $this->_header->setLastUpdate($data['lastUpdate']);
- }
- if (isset($data['published'])) {
- $this->_header->setPublishedDate($data['published']);
- }
- if (isset($data['description'])) {
- $this->_header->setDescription($data['description']);
- }
- if (isset($data['author'])) {
- $this->_header->setAuthor($data['author']);
- }
- if (isset($data['email'])) {
- $this->_header->setEmail($data['email']);
- }
- if (isset($data['webmaster'])) {
- $this->_header->setWebmaster($data['webmaster']);
- }
- if (isset($data['copyright'])) {
- $this->_header->setCopyright($data['copyright']);
- }
- if (isset($data['image'])) {
- $this->_header->setImage($data['image']);
- }
- if (isset($data['generator'])) {
- $this->_header->setGenerator($data['generator']);
- }
- if (isset($data['language'])) {
- $this->_header->setLanguage($data['language']);
- }
- if (isset($data['ttl'])) {
- $this->_header->setTtl($data['ttl']);
- }
- if (isset($data['rating'])) {
- $this->_header->setRating($data['rating']);
- }
- if (isset($data['cloud'])) {
- $mandatories = array('domain', 'path', 'registerProcedure', 'protocol');
- foreach ($mandatories as $mandatory) {
- if (!isset($data['cloud'][$mandatory])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to define $mandatory property of your cloud");
- }
- }
- $uri_str = 'http://' . $data['cloud']['domain'] . $data['cloud']['path'];
- $this->_header->setCloud($uri_str, $data['cloud']['registerProcedure'], $data['cloud']['protocol']);
- }
- if (isset($data['textInput'])) {
- $mandatories = array('title', 'description', 'name', 'link');
- foreach ($mandatories as $mandatory) {
- if (!isset($data['textInput'][$mandatory])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to define $mandatory property of your textInput");
- }
- }
- $this->_header->setTextInput($data['textInput']['title'],
- $data['textInput']['description'],
- $data['textInput']['name'],
- $data['textInput']['link']);
- }
- if (isset($data['skipHours'])) {
- $this->_header->setSkipHours($data['skipHours']);
- }
- if (isset($data['skipDays'])) {
- $this->_header->setSkipDays($data['skipDays']);
- }
- if (isset($data['itunes'])) {
- $itunes = new Zend_Feed_Builder_Header_Itunes($data['itunes']['category']);
- if (isset($data['itunes']['author'])) {
- $itunes->setAuthor($data['itunes']['author']);
- }
- if (isset($data['itunes']['owner'])) {
- $name = isset($data['itunes']['owner']['name']) ? $data['itunes']['owner']['name'] : '';
- $email = isset($data['itunes']['owner']['email']) ? $data['itunes']['owner']['email'] : '';
- $itunes->setOwner($name, $email);
- }
- if (isset($data['itunes']['image'])) {
- $itunes->setImage($data['itunes']['image']);
- }
- if (isset($data['itunes']['subtitle'])) {
- $itunes->setSubtitle($data['itunes']['subtitle']);
- }
- if (isset($data['itunes']['summary'])) {
- $itunes->setSummary($data['itunes']['summary']);
- }
- if (isset($data['itunes']['block'])) {
- $itunes->setBlock($data['itunes']['block']);
- }
- if (isset($data['itunes']['explicit'])) {
- $itunes->setExplicit($data['itunes']['explicit']);
- }
- if (isset($data['itunes']['keywords'])) {
- $itunes->setKeywords($data['itunes']['keywords']);
- }
- if (isset($data['itunes']['new-feed-url'])) {
- $itunes->setNewFeedUrl($data['itunes']['new-feed-url']);
- }
-
- $this->_header->setITunes($itunes);
- }
- }
-
- /**
- * Create the array of article entries
- *
- * @param array $data
- * @throws Zend_Feed_Builder_Exception
- * @return void
- */
- protected function _createEntries(array $data)
- {
- foreach ($data as $row) {
- $mandatories = array('title', 'link', 'description');
- foreach ($mandatories as $mandatory) {
- if (!isset($row[$mandatory])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("$mandatory key is missing");
- }
- }
- $entry = new Zend_Feed_Builder_Entry($row['title'], $row['link'], $row['description']);
- if (isset($row['author'])) {
- $entry->setAuthor($row['author']);
- }
- if (isset($row['guid'])) {
- $entry->setId($row['guid']);
- }
- if (isset($row['content'])) {
- $entry->setContent($row['content']);
- }
- if (isset($row['lastUpdate'])) {
- $entry->setLastUpdate($row['lastUpdate']);
- }
- if (isset($row['comments'])) {
- $entry->setCommentsUrl($row['comments']);
- }
- if (isset($row['commentRss'])) {
- $entry->setCommentsRssUrl($row['commentRss']);
- }
- if (isset($row['source'])) {
- $mandatories = array('title', 'url');
- foreach ($mandatories as $mandatory) {
- if (!isset($row['source'][$mandatory])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("$mandatory key of source property is missing");
- }
- }
- $entry->setSource($row['source']['title'], $row['source']['url']);
- }
- if (isset($row['category'])) {
- $entry->setCategories($row['category']);
- }
- if (isset($row['enclosure'])) {
- $entry->setEnclosures($row['enclosure']);
- }
-
- $this->_entries[] = $entry;
- }
- }
-}
diff --git a/library/Zend/Feed/Builder/Entry.php b/library/Zend/Feed/Builder/Entry.php
deleted file mode 100644
index 59f2651e70..0000000000
--- a/library/Zend/Feed/Builder/Entry.php
+++ /dev/null
@@ -1,297 +0,0 @@
-offsetSet('title', $title);
- $this->offsetSet('link', $link);
- $this->offsetSet('description', $description);
- $this->setLastUpdate(time());
- }
-
- /**
- * Read only properties accessor
- *
- * @param string $name property to read
- * @return mixed
- */
- public function __get($name)
- {
- if (!$this->offsetExists($name)) {
- return NULL;
- }
-
- return $this->offsetGet($name);
- }
-
- /**
- * Write properties accessor
- *
- * @param string $name name of the property to set
- * @param mixed $value value to set
- * @return void
- */
- public function __set($name, $value)
- {
- $this->offsetSet($name, $value);
- }
-
- /**
- * Isset accessor
- *
- * @param string $key
- * @return boolean
- */
- public function __isset($key)
- {
- return $this->offsetExists($key);
- }
-
- /**
- * Unset accessor
- *
- * @param string $key
- * @return void
- */
- public function __unset($key)
- {
- if ($this->offsetExists($key)) {
- $this->offsetUnset($key);
- }
- }
-
- /**
- * Sets the author of the entry
- *
- * @param string $author
- * @return Zend_Feed_Builder_Entry
- */
- public function setAuthor($author)
- {
- $this->offsetSet('author', $author);
- return $this;
- }
-
- /**
- * Sets the id/guid of the entry
- *
- * @param string $id
- * @return Zend_Feed_Builder_Entry
- */
- public function setId($id)
- {
- $this->offsetSet('guid', $id);
- return $this;
- }
-
- /**
- * Sets the full html content of the entry
- *
- * @param string $content
- * @return Zend_Feed_Builder_Entry
- */
- public function setContent($content)
- {
- $this->offsetSet('content', $content);
- return $this;
- }
-
- /**
- * Timestamp of the update date
- *
- * @param int $lastUpdate
- * @return Zend_Feed_Builder_Entry
- */
- public function setLastUpdate($lastUpdate)
- {
- $this->offsetSet('lastUpdate', $lastUpdate);
- return $this;
- }
-
- /**
- * Sets the url of the commented page associated to the entry
- *
- * @param string $comments
- * @return Zend_Feed_Builder_Entry
- */
- public function setCommentsUrl($comments)
- {
- $this->offsetSet('comments', $comments);
- return $this;
- }
-
- /**
- * Sets the url of the comments feed link
- *
- * @param string $commentRss
- * @return Zend_Feed_Builder_Entry
- */
- public function setCommentsRssUrl($commentRss)
- {
- $this->offsetSet('commentRss', $commentRss);
- return $this;
- }
-
- /**
- * Defines a reference to the original source
- *
- * @param string $title
- * @param string $url
- * @return Zend_Feed_Builder_Entry
- */
- public function setSource($title, $url)
- {
- $this->offsetSet('source', array('title' => $title,
- 'url' => $url));
- return $this;
- }
-
- /**
- * Sets the categories of the entry
- * Format of the array:
- *
- * array(
- * array(
- * 'term' => 'first category label',
- * 'scheme' => 'url that identifies a categorization scheme' // optional
- * ),
- * // second category and so one
- * )
- *
- *
- * @param array $categories
- * @return Zend_Feed_Builder_Entry
- */
- public function setCategories(array $categories)
- {
- foreach ($categories as $category) {
- $this->addCategory($category);
- }
- return $this;
- }
-
- /**
- * Add a category to the entry
- *
- * @param array $category see Zend_Feed_Builder_Entry::setCategories() for format
- * @return Zend_Feed_Builder_Entry
- * @throws Zend_Feed_Builder_Exception
- */
- public function addCategory(array $category)
- {
- if (empty($category['term'])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to define the name of the category");
- }
-
- if (!$this->offsetExists('category')) {
- $categories = array($category);
- } else {
- $categories = $this->offsetGet('category');
- $categories[] = $category;
- }
- $this->offsetSet('category', $categories);
- return $this;
- }
-
- /**
- * Sets the enclosures of the entry
- * Format of the array:
- *
- * array(
- * array(
- * 'url' => 'url of the linked enclosure',
- * 'type' => 'mime type of the enclosure' // optional
- * 'length' => 'length of the linked content in octets' // optional
- * ),
- * // second enclosure and so one
- * )
- *
- *
- * @param array $enclosures
- * @return Zend_Feed_Builder_Entry
- * @throws Zend_Feed_Builder_Exception
- */
- public function setEnclosures(array $enclosures)
- {
- foreach ($enclosures as $enclosure) {
- if (empty($enclosure['url'])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to supply an url for your enclosure");
- }
- $type = isset($enclosure['type']) ? $enclosure['type'] : '';
- $length = isset($enclosure['length']) ? $enclosure['length'] : '';
- $this->addEnclosure($enclosure['url'], $type, $length);
- }
- return $this;
- }
-
- /**
- * Add an enclosure to the entry
- *
- * @param string $url
- * @param string $type
- * @param string $length
- * @return Zend_Feed_Builder_Entry
- */
- public function addEnclosure($url, $type = '', $length = '')
- {
- if (!$this->offsetExists('enclosure')) {
- $enclosure = array();
- } else {
- $enclosure = $this->offsetGet('enclosure');
- }
- $enclosure[] = array('url' => $url,
- 'type' => $type,
- 'length' => $length);
- $this->offsetSet('enclosure', $enclosure);
- return $this;
- }
-}
diff --git a/library/Zend/Feed/Builder/Exception.php b/library/Zend/Feed/Builder/Exception.php
deleted file mode 100644
index 320e4dc70e..0000000000
--- a/library/Zend/Feed/Builder/Exception.php
+++ /dev/null
@@ -1,40 +0,0 @@
-offsetSet('title', $title);
- $this->offsetSet('link', $link);
- $this->offsetSet('charset', $charset);
- $this->setLastUpdate(time())
- ->setGenerator('Zend_Feed');
- }
-
- /**
- * Read only properties accessor
- *
- * @param string $name property to read
- * @return mixed
- */
- public function __get($name)
- {
- if (!$this->offsetExists($name)) {
- return NULL;
- }
-
- return $this->offsetGet($name);
- }
-
- /**
- * Write properties accessor
- *
- * @param string $name name of the property to set
- * @param mixed $value value to set
- * @return void
- */
- public function __set($name, $value)
- {
- $this->offsetSet($name, $value);
- }
-
- /**
- * Isset accessor
- *
- * @param string $key
- * @return boolean
- */
- public function __isset($key)
- {
- return $this->offsetExists($key);
- }
-
- /**
- * Unset accessor
- *
- * @param string $key
- * @return void
- */
- public function __unset($key)
- {
- if ($this->offsetExists($key)) {
- $this->offsetUnset($key);
- }
- }
-
- /**
- * Timestamp of the update date
- *
- * @param int $lastUpdate
- * @return Zend_Feed_Builder_Header
- */
- public function setLastUpdate($lastUpdate)
- {
- $this->offsetSet('lastUpdate', $lastUpdate);
- return $this;
- }
-
- /**
- * Timestamp of the publication date
- *
- * @param int $published
- * @return Zend_Feed_Builder_Header
- */
- public function setPublishedDate($published)
- {
- $this->offsetSet('published', $published);
- return $this;
- }
-
- /**
- * Short description of the feed
- *
- * @param string $description
- * @return Zend_Feed_Builder_Header
- */
- public function setDescription($description)
- {
- $this->offsetSet('description', $description);
- return $this;
- }
-
- /**
- * Sets the author of the feed
- *
- * @param string $author
- * @return Zend_Feed_Builder_Header
- */
- public function setAuthor($author)
- {
- $this->offsetSet('author', $author);
- return $this;
- }
-
- /**
- * Sets the author's email
- *
- * @param string $email
- * @return Zend_Feed_Builder_Header
- * @throws Zend_Feed_Builder_Exception
- */
- public function setEmail($email)
- {
- /**
- * @see Zend_Validate_EmailAddress
- */
- #require_once 'Zend/Validate/EmailAddress.php';
- $validate = new Zend_Validate_EmailAddress();
- if (!$validate->isValid($email)) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set a valid email address into the email property");
- }
- $this->offsetSet('email', $email);
- return $this;
- }
-
- /**
- * Sets the copyright notice
- *
- * @param string $copyright
- * @return Zend_Feed_Builder_Header
- */
- public function setCopyright($copyright)
- {
- $this->offsetSet('copyright', $copyright);
- return $this;
- }
-
- /**
- * Sets the image of the feed
- *
- * @param string $image
- * @return Zend_Feed_Builder_Header
- */
- public function setImage($image)
- {
- $this->offsetSet('image', $image);
- return $this;
- }
-
- /**
- * Sets the generator of the feed
- *
- * @param string $generator
- * @return Zend_Feed_Builder_Header
- */
- public function setGenerator($generator)
- {
- $this->offsetSet('generator', $generator);
- return $this;
- }
-
- /**
- * Sets the language of the feed
- *
- * @param string $language
- * @return Zend_Feed_Builder_Header
- */
- public function setLanguage($language)
- {
- $this->offsetSet('language', $language);
- return $this;
- }
-
- /**
- * Email address for person responsible for technical issues
- * Ignored if atom is used
- *
- * @param string $webmaster
- * @return Zend_Feed_Builder_Header
- * @throws Zend_Feed_Builder_Exception
- */
- public function setWebmaster($webmaster)
- {
- /**
- * @see Zend_Validate_EmailAddress
- */
- #require_once 'Zend/Validate/EmailAddress.php';
- $validate = new Zend_Validate_EmailAddress();
- if (!$validate->isValid($webmaster)) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set a valid email address into the webmaster property");
- }
- $this->offsetSet('webmaster', $webmaster);
- return $this;
- }
-
- /**
- * How long in minutes a feed can be cached before refreshing
- * Ignored if atom is used
- *
- * @param int $ttl
- * @return Zend_Feed_Builder_Header
- * @throws Zend_Feed_Builder_Exception
- */
- public function setTtl($ttl)
- {
- /**
- * @see Zend_Validate_Int
- */
- #require_once 'Zend/Validate/Int.php';
- $validate = new Zend_Validate_Int();
- if (!$validate->isValid($ttl)) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set an integer value to the ttl property");
- }
- $this->offsetSet('ttl', $ttl);
- return $this;
- }
-
- /**
- * PICS rating for the feed
- * Ignored if atom is used
- *
- * @param string $rating
- * @return Zend_Feed_Builder_Header
- */
- public function setRating($rating)
- {
- $this->offsetSet('rating', $rating);
- return $this;
- }
-
- /**
- * Cloud to be notified of updates of the feed
- * Ignored if atom is used
- *
- * @param string|Zend_Uri_Http $uri
- * @param string $procedure procedure to call, e.g. myCloud.rssPleaseNotify
- * @param string $protocol protocol to use, e.g. soap or xml-rpc
- * @return Zend_Feed_Builder_Header
- * @throws Zend_Feed_Builder_Exception
- */
- public function setCloud($uri, $procedure, $protocol)
- {
- if (is_string($uri) && Zend_Uri_Http::check($uri)) {
- $uri = Zend_Uri::factory($uri);
- }
- if (!$uri instanceof Zend_Uri_Http) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception('Passed parameter is not a valid HTTP URI');
- }
- if (!$uri->getPort()) {
- $uri->setPort(80);
- }
- $this->offsetSet('cloud', array('uri' => $uri,
- 'procedure' => $procedure,
- 'protocol' => $protocol));
- return $this;
- }
-
- /**
- * A text input box that can be displayed with the feed
- * Ignored if atom is used
- *
- * @param string $title the label of the Submit button in the text input area
- * @param string $description explains the text input area
- * @param string $name the name of the text object in the text input area
- * @param string $link the URL of the CGI script that processes text input requests
- * @return Zend_Feed_Builder_Header
- */
- public function setTextInput($title, $description, $name, $link)
- {
- $this->offsetSet('textInput', array('title' => $title,
- 'description' => $description,
- 'name' => $name,
- 'link' => $link));
- return $this;
- }
-
- /**
- * Hint telling aggregators which hours they can skip
- * Ignored if atom is used
- *
- * @param array $hours list of hours in 24 format
- * @return Zend_Feed_Builder_Header
- * @throws Zend_Feed_Builder_Exception
- */
- public function setSkipHours(array $hours)
- {
- if (count($hours) > 24) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you can not have more than 24 rows in the skipHours property");
- }
- foreach ($hours as $hour) {
- if ($hour < 0 || $hour > 23) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("$hour has te be between 0 and 23");
- }
- }
- $this->offsetSet('skipHours', $hours);
- return $this;
- }
-
- /**
- * Hint telling aggregators which days they can skip
- * Ignored if atom is used
- *
- * @param array $days list of days to skip, e.g. Monday
- * @return Zend_Feed_Builder_Header
- * @throws Zend_Feed_Builder_Exception
- */
- public function setSkipDays(array $days)
- {
- if (count($days) > 7) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you can not have more than 7 days in the skipDays property");
- }
- $valid = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
- foreach ($days as $day) {
- if (!in_array(strtolower($day), $valid)) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("$day is not a valid day");
- }
- }
- $this->offsetSet('skipDays', $days);
- return $this;
- }
-
- /**
- * Sets the iTunes rss extension
- *
- * @param Zend_Feed_Builder_Header_Itunes $itunes
- * @return Zend_Feed_Builder_Header
- */
- public function setITunes(Zend_Feed_Builder_Header_Itunes $itunes)
- {
- $this->offsetSet('itunes', $itunes);
- return $this;
- }
-}
diff --git a/library/Zend/Feed/Builder/Header/Itunes.php b/library/Zend/Feed/Builder/Header/Itunes.php
deleted file mode 100644
index d9752f62ce..0000000000
--- a/library/Zend/Feed/Builder/Header/Itunes.php
+++ /dev/null
@@ -1,288 +0,0 @@
-setCategories($categories);
- }
-
- /**
- * Sets the categories column and in iTunes Music Store Browse
- * $categories must conform to the following format:
- *
- * array(array('main' => 'main category',
- * 'sub' => 'sub category' // optionnal
- * ),
- * // up to 3 rows
- * )
- *
- *
- * @param array $categories
- * @return Zend_Feed_Builder_Header_Itunes
- * @throws Zend_Feed_Builder_Exception
- */
- public function setCategories(array $categories)
- {
- $nb = count($categories);
- if (0 === $nb) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set at least one itunes category");
- }
- if ($nb > 3) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set at most three itunes categories");
- }
- foreach ($categories as $i => $category) {
- if (empty($category['main'])) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set the main category (category #$i)");
- }
- }
- $this->offsetSet('category', $categories);
- return $this;
- }
-
- /**
- * Sets the artist value, default to the feed's author value
- *
- * @param string $author
- * @return Zend_Feed_Builder_Header_Itunes
- */
- public function setAuthor($author)
- {
- $this->offsetSet('author', $author);
- return $this;
- }
-
- /**
- * Sets the owner of the postcast
- *
- * @param string $name default to the feed's author value
- * @param string $email default to the feed's email value
- * @return Zend_Feed_Builder_Header_Itunes
- * @throws Zend_Feed_Builder_Exception
- */
- public function setOwner($name = '', $email = '')
- {
- if (!empty($email)) {
- /**
- * @see Zend_Validate_EmailAddress
- */
- #require_once 'Zend/Validate/EmailAddress.php';
- $validate = new Zend_Validate_EmailAddress();
- if (!$validate->isValid($email)) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set a valid email address into the itunes owner's email property");
- }
- }
- $this->offsetSet('owner', array('name' => $name, 'email' => $email));
- return $this;
- }
-
- /**
- * Sets the album/podcast art picture
- * Default to the feed's image value
- *
- * @param string $image
- * @return Zend_Feed_Builder_Header_Itunes
- */
- public function setImage($image)
- {
- $this->offsetSet('image', $image);
- return $this;
- }
-
- /**
- * Sets the short description of the podcast
- * Default to the feed's description
- *
- * @param string $subtitle
- * @return Zend_Feed_Builder_Header_Itunes
- */
- public function setSubtitle($subtitle)
- {
- $this->offsetSet('subtitle', $subtitle);
- return $this;
- }
-
- /**
- * Sets the longer description of the podcast
- * Default to the feed's description
- *
- * @param string $summary
- * @return Zend_Feed_Builder_Header_Itunes
- */
- public function setSummary($summary)
- {
- $this->offsetSet('summary', $summary);
- return $this;
- }
-
- /**
- * Prevent a feed from appearing
- *
- * @param string $block can be 'yes' or 'no'
- * @return Zend_Feed_Builder_Header_Itunes
- * @throws Zend_Feed_Builder_Exception
- */
- public function setBlock($block)
- {
- $block = strtolower($block);
- if (!in_array($block, array('yes', 'no'))) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set yes or no to the itunes block property");
- }
- $this->offsetSet('block', $block);
- return $this;
- }
-
- /**
- * Configuration of the parental advisory graphic
- *
- * @param string $explicit can be 'yes', 'no' or 'clean'
- * @return Zend_Feed_Builder_Header_Itunes
- * @throws Zend_Feed_Builder_Exception
- */
- public function setExplicit($explicit)
- {
- $explicit = strtolower($explicit);
- if (!in_array($explicit, array('yes', 'no', 'clean'))) {
- /**
- * @see Zend_Feed_Builder_Exception
- */
- #require_once 'Zend/Feed/Builder/Exception.php';
- throw new Zend_Feed_Builder_Exception("you have to set yes, no or clean to the itunes explicit property");
- }
- $this->offsetSet('explicit', $explicit);
- return $this;
- }
-
- /**
- * Sets a comma separated list of 12 keywords maximum
- *
- * @param string $keywords
- * @return Zend_Feed_Builder_Header_Itunes
- */
- public function setKeywords($keywords)
- {
- $this->offsetSet('keywords', $keywords);
- return $this;
- }
-
- /**
- * Sets the new feed URL location
- *
- * @param string $url
- * @return Zend_Feed_Builder_Header_Itunes
- */
- public function setNewFeedUrl($url)
- {
- $this->offsetSet('new_feed_url', $url);
- return $this;
- }
-
- /**
- * Read only properties accessor
- *
- * @param string $name property to read
- * @return mixed
- */
- public function __get($name)
- {
- if (!$this->offsetExists($name)) {
- return NULL;
- }
-
- return $this->offsetGet($name);
- }
-
- /**
- * Write properties accessor
- *
- * @param string $name name of the property to set
- * @param mixed $value value to set
- * @return void
- */
- public function __set($name, $value)
- {
- $this->offsetSet($name, $value);
- }
-
- /**
- * Isset accessor
- *
- * @param string $key
- * @return boolean
- */
- public function __isset($key)
- {
- return $this->offsetExists($key);
- }
-
- /**
- * Unset accessor
- *
- * @param string $key
- * @return void
- */
- public function __unset($key)
- {
- if ($this->offsetExists($key)) {
- $this->offsetUnset($key);
- }
- }
-
-}
diff --git a/library/Zend/Feed/Builder/Interface.php b/library/Zend/Feed/Builder/Interface.php
deleted file mode 100644
index 8e2615694b..0000000000
--- a/library/Zend/Feed/Builder/Interface.php
+++ /dev/null
@@ -1,52 +0,0 @@
-_element = $element;
- }
-
-
- /**
- * Get a DOM representation of the element
- *
- * Returns the underlying DOM object, which can then be
- * manipulated with full DOM methods.
- *
- * @return DOMDocument
- */
- public function getDOM()
- {
- return $this->_element;
- }
-
-
- /**
- * Update the object from a DOM element
- *
- * Take a DOMElement object, which may be originally from a call
- * to getDOM() or may be custom created, and use it as the
- * DOM tree for this Zend_Feed_Element.
- *
- * @param DOMElement $element
- * @return void
- */
- public function setDOM(DOMElement $element)
- {
- $this->_element = $this->_element->ownerDocument->importNode($element, true);
- }
-
- /**
- * Set the parent element of this object to another
- * Zend_Feed_Element.
- *
- * @param Zend_Feed_Element $element
- * @return void
- */
- public function setParent(Zend_Feed_Element $element)
- {
- $this->_parentElement = $element;
- $this->_appended = false;
- }
-
-
- /**
- * Appends this element to its parent if necessary.
- *
- * @return void
- */
- protected function ensureAppended()
- {
- if (!$this->_appended) {
- $this->_parentElement->getDOM()->appendChild($this->_element);
- $this->_appended = true;
- $this->_parentElement->ensureAppended();
- }
- }
-
-
- /**
- * Get an XML string representation of this element
- *
- * Returns a string of this element's XML, including the XML
- * prologue.
- *
- * @return string
- */
- public function saveXml()
- {
- // Return a complete document including XML prologue.
- $doc = new DOMDocument($this->_element->ownerDocument->version,
- $this->_element->ownerDocument->actualEncoding);
- $doc->appendChild($doc->importNode($this->_element, true));
- return $doc->saveXML();
- }
-
-
- /**
- * Get the XML for only this element
- *
- * Returns a string of this element's XML without prologue.
- *
- * @return string
- */
- public function saveXmlFragment()
- {
- return $this->_element->ownerDocument->saveXML($this->_element);
- }
-
- /**
- * Get encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- return $this->_encoding;
- }
-
- /**
- * Set encoding
- *
- * @param string $value Encoding to use
- * @return Zend_Feed_Element
- */
- public function setEncoding($value)
- {
- $this->_encoding = (string) $value;
- return $this;
- }
-
- /**
- * Map variable access onto the underlying entry representation.
- *
- * Get-style access returns a Zend_Feed_Element representing the
- * child element accessed. To get string values, use method syntax
- * with the __call() overriding.
- *
- * @param string $var The property to access.
- * @return mixed
- */
- public function __get($var)
- {
- $nodes = $this->_children($var);
- $length = count($nodes);
-
- if ($length == 1) {
- return new Zend_Feed_Element($nodes[0]);
- } elseif ($length > 1) {
- return array_map(function ($e) { return new Zend_Feed_Element($e); }, $nodes);
- } else {
- // When creating anonymous nodes for __set chaining, don't
- // call appendChild() on them. Instead we pass the current
- // element to them as an extra reference; the child is
- // then responsible for appending itself when it is
- // actually set. This way "if ($foo->bar)" doesn't create
- // a phantom "bar" element in our tree.
- if (strpos($var, ':') !== false) {
- list($ns, $elt) = explode(':', $var, 2);
- $node = $this->_element->ownerDocument->createElementNS(Zend_Feed::lookupNamespace($ns), $elt);
- } else {
- $node = $this->_element->ownerDocument->createElement($var);
- }
- $node = new self($node);
- $node->setParent($this);
- return $node;
- }
- }
-
-
- /**
- * Map variable sets onto the underlying entry representation.
- *
- * @param string $var The property to change.
- * @param string $val The property's new value.
- * @return void
- * @throws Zend_Feed_Exception
- */
- public function __set($var, $val)
- {
- $this->ensureAppended();
-
- $nodes = $this->_children($var);
- if (!$nodes) {
- if (strpos($var, ':') !== false) {
- list($ns, $elt) = explode(':', $var, 2);
- $node = $this->_element->ownerDocument->createElementNS(Zend_Feed::lookupNamespace($ns),
- $var, htmlspecialchars($val, ENT_NOQUOTES, $this->getEncoding()));
- $this->_element->appendChild($node);
- } else {
- $node = $this->_element->ownerDocument->createElement($var,
- htmlspecialchars($val, ENT_NOQUOTES, $this->getEncoding()));
- $this->_element->appendChild($node);
- }
- } elseif (count($nodes) > 1) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Cannot set the value of multiple tags simultaneously.');
- } else {
- $nodes[0]->nodeValue = $val;
- }
- }
-
-
- /**
- * Map isset calls onto the underlying entry representation.
- *
- * @param string $var
- * @return boolean
- */
- public function __isset($var)
- {
- // Look for access of the form {ns:var}. We don't use
- // _children() here because we can break out of the loop
- // immediately once we find something.
- if (strpos($var, ':') !== false) {
- list($ns, $elt) = explode(':', $var, 2);
- foreach ($this->_element->childNodes as $child) {
- if ($child->localName == $elt && $child->prefix == $ns) {
- return true;
- }
- }
- } else {
- foreach ($this->_element->childNodes as $child) {
- if ($child->localName == $var) {
- return true;
- }
- }
- }
- }
-
-
- /**
- * Get the value of an element with method syntax.
- *
- * Map method calls to get the string value of the requested
- * element. If there are multiple elements that match, this will
- * return an array of those objects.
- *
- * @param string $var The element to get the string value of.
- * @param mixed $unused This parameter is not used.
- * @return mixed The node's value, null, or an array of nodes.
- */
- public function __call($var, $unused)
- {
- $nodes = $this->_children($var);
-
- if (!$nodes) {
- return null;
- } elseif (count($nodes) > 1) {
- return $nodes;
- } else {
- return $nodes[0]->nodeValue;
- }
- }
-
-
- /**
- * Remove all children matching $var.
- *
- * @param string $var
- * @return void
- */
- public function __unset($var)
- {
- $nodes = $this->_children($var);
- foreach ($nodes as $node) {
- $parent = $node->parentNode;
- $parent->removeChild($node);
- }
- }
-
-
- /**
- * Returns the nodeValue of this element when this object is used
- * in a string context.
- *
- * @return string
- */
- public function __toString()
- {
- return $this->_element->nodeValue;
- }
-
-
- /**
- * Finds children with tagnames matching $var
- *
- * Similar to SimpleXML's children() method.
- *
- * @param string $var Tagname to match, can be either namespace:tagName or just tagName.
- * @return array
- */
- protected function _children($var)
- {
- $found = array();
-
- // Look for access of the form {ns:var}.
- if (strpos($var, ':') !== false) {
- list($ns, $elt) = explode(':', $var, 2);
- foreach ($this->_element->childNodes as $child) {
- if ($child->localName == $elt && $child->prefix == $ns) {
- $found[] = $child;
- }
- }
- } else {
- foreach ($this->_element->childNodes as $child) {
- if ($child->localName == $var) {
- $found[] = $child;
- }
- }
- }
-
- return $found;
- }
-
-
- /**
- * Required by the ArrayAccess interface.
- *
- * @param string $offset
- * @return boolean
- */
- public function offsetExists($offset)
- {
- if (strpos($offset, ':') !== false) {
- list($ns, $attr) = explode(':', $offset, 2);
- return $this->_element->hasAttributeNS(Zend_Feed::lookupNamespace($ns), $attr);
- } else {
- return $this->_element->hasAttribute($offset);
- }
- }
-
-
- /**
- * Required by the ArrayAccess interface.
- *
- * @param string $offset
- * @return string
- */
- public function offsetGet($offset)
- {
- if (strpos($offset, ':') !== false) {
- list($ns, $attr) = explode(':', $offset, 2);
- return $this->_element->getAttributeNS(Zend_Feed::lookupNamespace($ns), $attr);
- } else {
- return $this->_element->getAttribute($offset);
- }
- }
-
-
- /**
- * Required by the ArrayAccess interface.
- *
- * @param string $offset
- * @param string $value
- * @return string
- */
- public function offsetSet($offset, $value)
- {
- $this->ensureAppended();
-
- if (strpos($offset, ':') !== false) {
- list($ns, $attr) = explode(':', $offset, 2);
- // DOMElement::setAttributeNS() requires $qualifiedName to have a prefix
- return $this->_element->setAttributeNS(Zend_Feed::lookupNamespace($ns), $offset, $value);
- } else {
- return $this->_element->setAttribute($offset, $value);
- }
- }
-
-
- /**
- * Required by the ArrayAccess interface.
- *
- * @param string $offset
- * @return boolean
- */
- public function offsetUnset($offset)
- {
- if (strpos($offset, ':') !== false) {
- list($ns, $attr) = explode(':', $offset, 2);
- return $this->_element->removeAttributeNS(Zend_Feed::lookupNamespace($ns), $attr);
- } else {
- return $this->_element->removeAttribute($offset);
- }
- }
-
-}
diff --git a/library/Zend/Feed/Entry/Abstract.php b/library/Zend/Feed/Entry/Abstract.php
deleted file mode 100644
index 216bd95f45..0000000000
--- a/library/Zend/Feed/Entry/Abstract.php
+++ /dev/null
@@ -1,126 +0,0 @@
-getElementsByTagName($this->_rootElement)->item(0);
- if (!$element) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('No root <' . $this->_rootElement . '> element found, cannot parse feed.');
- }
- } else {
- $doc = new DOMDocument('1.0', 'utf-8');
- if ($this->_rootNamespace !== null) {
- $element = $doc->createElementNS(Zend_Feed::lookupNamespace($this->_rootNamespace), $this->_rootElement);
- } else {
- $element = $doc->createElement($this->_rootElement);
- }
- }
- }
-
- parent::__construct($element);
- }
-
-}
diff --git a/library/Zend/Feed/Entry/Atom.php b/library/Zend/Feed/Entry/Atom.php
deleted file mode 100644
index 42de70eb22..0000000000
--- a/library/Zend/Feed/Entry/Atom.php
+++ /dev/null
@@ -1,282 +0,0 @@
-link('edit');
- if (!$deleteUri) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Cannot delete entry; no link rel="edit" is present.');
- }
-
- // DELETE
- $client = Zend_Feed::getHttpClient();
- do {
- $client->setUri($deleteUri);
- if (Zend_Feed::getHttpMethodOverride()) {
- $client->setHeader('X-HTTP-Method-Override', 'DELETE');
- $response = $client->request('POST');
- } else {
- $response = $client->request('DELETE');
- }
- $httpStatus = $response->getStatus();
- switch ((int) $httpStatus / 100) {
- // Success
- case 2:
- return true;
- // Redirect
- case 3:
- $deleteUri = $response->getHeader('Location');
- continue;
- // Error
- default:
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("Expected response code 2xx, got $httpStatus");
- }
- } while (true);
- }
-
-
- /**
- * Save a new or updated Atom entry.
- *
- * Save is used to either create new entries or to save changes to
- * existing ones. If we have a link rel="edit", we are changing
- * an existing entry. In this case we re-serialize the entry and
- * PUT it to the edit URI, checking for a 200 OK result.
- *
- * For posting new entries, you must specify the $postUri
- * parameter to save() to tell the object where to post itself.
- * We use $postUri and POST the serialized entry there, checking
- * for a 201 Created response. If the insert is successful, we
- * then parse the response from the POST to get any values that
- * the server has generated: an id, an updated time, and its new
- * link rel="edit".
- *
- * @param string $postUri Location to POST for creating new entries.
- * @return void
- * @throws Zend_Feed_Exception
- */
- public function save($postUri = null)
- {
- if ($this->id()) {
- // If id is set, look for link rel="edit" in the
- // entry object and PUT.
- $editUri = $this->link('edit');
- if (!$editUri) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Cannot edit entry; no link rel="edit" is present.');
- }
-
- $client = Zend_Feed::getHttpClient();
- $client->setUri($editUri);
- if (Zend_Feed::getHttpMethodOverride()) {
- $client->setHeaders(array('X-HTTP-Method-Override: PUT',
- 'Content-Type: ' . self::CONTENT_TYPE));
- $client->setRawData($this->saveXML());
- $response = $client->request('POST');
- } else {
- $client->setHeaders('Content-Type', self::CONTENT_TYPE);
- $client->setRawData($this->saveXML());
- $response = $client->request('PUT');
- }
- if ($response->getStatus() !== 200) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Expected response code 200, got ' . $response->getStatus());
- }
- } else {
- if ($postUri === null) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('PostURI must be specified to save new entries.');
- }
- $client = Zend_Feed::getHttpClient();
- $client->setUri($postUri);
- $client->setHeaders('Content-Type', self::CONTENT_TYPE);
- $client->setRawData($this->saveXML());
- $response = $client->request('POST');
-
- if ($response->getStatus() !== 201) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Expected response code 201, got '
- . $response->getStatus());
- }
- }
-
- // Update internal properties using $client->responseBody;
- @ini_set('track_errors', 1);
- $newEntry = new DOMDocument;
- $newEntry = @Zend_Xml_Security::scan($response->getBody(), $newEntry);
- @ini_restore('track_errors');
-
- if (!$newEntry) {
- // prevent the class to generate an undefined variable notice (ZF-2590)
- if (!isset($php_errormsg)) {
- if (function_exists('xdebug_is_enabled')) {
- $php_errormsg = '(error message not available, when XDebug is running)';
- } else {
- $php_errormsg = '(error message not available)';
- }
- }
-
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('XML cannot be parsed: ' . $php_errormsg);
- }
-
- $newEntry = $newEntry->getElementsByTagName($this->_rootElement)->item(0);
- if (!$newEntry) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('No root element found in server response:'
- . "\n\n" . $client->responseBody);
- }
-
- if ($this->_element->parentNode) {
- $oldElement = $this->_element;
- $this->_element = $oldElement->ownerDocument->importNode($newEntry, true);
- $oldElement->parentNode->replaceChild($this->_element, $oldElement);
- } else {
- $this->_element = $newEntry;
- }
- }
-
-
- /**
- * Easy access to tags keyed by "rel" attributes.
- *
- * If $elt->link() is called with no arguments, we will attempt to
- * return the value of the tag(s) like all other
- * method-syntax attribute access. If an argument is passed to
- * link(), however, then we will return the "href" value of the
- * first tag that has a "rel" attribute matching $rel:
- *
- * $elt->link(): returns the value of the link tag.
- * $elt->link('self'): returns the href from the first in the entry.
- *
- * @param string $rel The "rel" attribute to look for.
- * @return mixed
- */
- public function link($rel = null)
- {
- if ($rel === null) {
- return parent::__call('link', null);
- }
-
- // index link tags by their "rel" attribute.
- $links = parent::__get('link');
- if (!is_array($links)) {
- if ($links instanceof Zend_Feed_Element) {
- $links = array($links);
- } else {
- return $links;
- }
- }
-
- foreach ($links as $link) {
- if (empty($link['rel'])) {
- $link['rel'] = 'alternate'; // see Atom 1.0 spec
- }
- if ($rel == $link['rel']) {
- return $link['href'];
- }
- }
-
- return null;
- }
-
-}
diff --git a/library/Zend/Feed/Entry/Rss.php b/library/Zend/Feed/Entry/Rss.php
deleted file mode 100644
index f0bc5473f0..0000000000
--- a/library/Zend/Feed/Entry/Rss.php
+++ /dev/null
@@ -1,122 +0,0 @@
-_element->lookupPrefix('http://purl.org/rss/1.0/modules/content/');
- return parent::__get("$prefix:encoded");
- default:
- return parent::__get($var);
- }
- }
-
- /**
- * Overwrites parent::_set method to enable write access
- * to content:encoded element.
- *
- * @param string $var The property to change.
- * @param string $val The property's new value.
- * @return void
- */
- public function __set($var, $value)
- {
- switch ($var) {
- case 'content':
- parent::__set('content:encoded', $value);
- break;
- default:
- parent::__set($var, $value);
- }
- }
-
- /**
- * Overwrites parent::_isset method to enable access
- * to content:encoded element.
- *
- * @param string $var
- * @return boolean
- */
- public function __isset($var)
- {
- switch ($var) {
- case 'content':
- // don't use other callback to prevent invalid returned value
- return $this->content() !== null;
- default:
- return parent::__isset($var);
- }
- }
-
- /**
- * Overwrites parent::_call method to enable read access
- * to content:encoded element.
- * Please note that method-style write access is not currently supported
- * by parent method, consequently this method doesn't as well.
- *
- * @param string $var The element to get the string value of.
- * @param mixed $unused This parameter is not used.
- * @return mixed The node's value, null, or an array of nodes.
- */
- public function __call($var, $unused)
- {
- switch ($var) {
- case 'content':
- $prefix = $this->_element->lookupPrefix('http://purl.org/rss/1.0/modules/content/');
- return parent::__call("$prefix:encoded", $unused);
- default:
- return parent::__call($var, $unused);
- }
- }
-}
diff --git a/library/Zend/Feed/Exception.php b/library/Zend/Feed/Exception.php
deleted file mode 100644
index 36a3480782..0000000000
--- a/library/Zend/Feed/Exception.php
+++ /dev/null
@@ -1,42 +0,0 @@
-getHubs();
- }
-
- /**
- * Allows the external environment to make Zend_Oauth use a specific
- * Client instance.
- *
- * @param Zend_Http_Client $httpClient
- * @return void
- */
- public static function setHttpClient(Zend_Http_Client $httpClient)
- {
- self::$httpClient = $httpClient;
- }
-
- /**
- * Return the singleton instance of the HTTP Client. Note that
- * the instance is reset and cleared of previous parameters GET/POST.
- * Headers are NOT reset but handled by this component if applicable.
- *
- * @return Zend_Http_Client
- */
- public static function getHttpClient()
- {
- if (!isset(self::$httpClient)):
- self::$httpClient = new Zend_Http_Client;
- else:
- self::$httpClient->resetParameters();
- endif;
- return self::$httpClient;
- }
-
- /**
- * Simple mechanism to delete the entire singleton HTTP Client instance
- * which forces an new instantiation for subsequent requests.
- *
- * @return void
- */
- public static function clearHttpClient()
- {
- self::$httpClient = null;
- }
-
- /**
- * RFC 3986 safe url encoding method
- *
- * @param string $string
- * @return string
- */
- public static function urlencode($string)
- {
- $rawencoded = rawurlencode($string);
- $rfcencoded = str_replace('%7E', '~', $rawencoded);
- return $rfcencoded;
- }
-}
diff --git a/library/Zend/Feed/Pubsubhubbub/CallbackAbstract.php b/library/Zend/Feed/Pubsubhubbub/CallbackAbstract.php
deleted file mode 100644
index 30712c6b93..0000000000
--- a/library/Zend/Feed/Pubsubhubbub/CallbackAbstract.php
+++ /dev/null
@@ -1,315 +0,0 @@
-setConfig($config);
- }
- }
-
- /**
- * Process any injected configuration options
- *
- * @param array|Zend_Config $config Options array or Zend_Config instance
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_CallbackAbstract
- */
- public function setConfig($config)
- {
- if ($config instanceof Zend_Config) {
- $config = $config->toArray();
- } elseif (!is_array($config)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Array or Zend_Config object'
- . 'expected, got ' . gettype($config));
- }
- if (array_key_exists('storage', $config)) {
- $this->setStorage($config['storage']);
- }
- return $this;
- }
-
- /**
- * Send the response, including all headers.
- * If you wish to handle this via Zend_Controller, use the getter methods
- * to retrieve any data needed to be set on your HTTP Response object, or
- * simply give this object the HTTP Response instance to work with for you!
- *
- * @return void
- */
- public function sendResponse()
- {
- $this->getHttpResponse()->sendResponse();
- }
-
- /**
- * Sets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used
- * to background save any verification tokens associated with a subscription
- * or other.
- *
- * @param Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage
- * @return Zend_Feed_Pubsubhubbub_CallbackAbstract
- */
- public function setStorage(Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage)
- {
- $this->_storage = $storage;
- return $this;
- }
-
- /**
- * Gets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used
- * to background save any verification tokens associated with a subscription
- * or other.
- *
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface
- */
- public function getStorage()
- {
- if ($this->_storage === null) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('No storage object has been'
- . ' set that subclasses Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface');
- }
- return $this->_storage;
- }
-
- /**
- * An instance of a class handling Http Responses. This is implemented in
- * Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with
- * (i.e. not inherited from) Zend_Controller_Response_Http.
- *
- * @param Zend_Feed_Pubsubhubbub_HttpResponse|Zend_Controller_Response_Http $httpResponse
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_CallbackAbstract
- */
- public function setHttpResponse($httpResponse)
- {
- if (!is_object($httpResponse)
- || (!$httpResponse instanceof Zend_Feed_Pubsubhubbub_HttpResponse
- && !$httpResponse instanceof Zend_Controller_Response_Http)
- ) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('HTTP Response object must'
- . ' implement one of Zend_Feed_Pubsubhubbub_HttpResponse or'
- . ' Zend_Controller_Response_Http');
- }
- $this->_httpResponse = $httpResponse;
- return $this;
- }
-
- /**
- * An instance of a class handling Http Responses. This is implemented in
- * Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with
- * (i.e. not inherited from) Zend_Controller_Response_Http.
- *
- * @return Zend_Feed_Pubsubhubbub_HttpResponse|Zend_Controller_Response_Http
- */
- public function getHttpResponse()
- {
- if ($this->_httpResponse === null) {
- $this->_httpResponse = new Zend_Feed_Pubsubhubbub_HttpResponse;
- }
- return $this->_httpResponse;
- }
-
- /**
- * Sets the number of Subscribers for which any updates are on behalf of.
- * In other words, is this class serving one or more subscribers? How many?
- * Defaults to 1 if left unchanged.
- *
- * @param string|int $count
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_CallbackAbstract
- */
- public function setSubscriberCount($count)
- {
- $count = intval($count);
- if ($count <= 0) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Subscriber count must be'
- . ' greater than zero');
- }
- $this->_subscriberCount = $count;
- return $this;
- }
-
- /**
- * Gets the number of Subscribers for which any updates are on behalf of.
- * In other words, is this class serving one or more subscribers? How many?
- *
- * @return int
- */
- public function getSubscriberCount()
- {
- return $this->_subscriberCount;
- }
-
- /**
- * Attempt to detect the callback URL (specifically the path forward)
- */
- protected function _detectCallbackUrl()
- {
- $callbackUrl = '';
- if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
- $callbackUrl = $_SERVER['HTTP_X_ORIGINAL_URL'];
- } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
- $callbackUrl = $_SERVER['HTTP_X_REWRITE_URL'];
- } elseif (isset($_SERVER['REQUEST_URI'])) {
- $callbackUrl = $_SERVER['REQUEST_URI'];
- $scheme = 'http';
- if ($_SERVER['HTTPS'] == 'on') {
- $scheme = 'https';
- }
- $schemeAndHttpHost = $scheme . '://' . $this->_getHttpHost();
- if (strpos($callbackUrl, $schemeAndHttpHost) === 0) {
- $callbackUrl = substr($callbackUrl, strlen($schemeAndHttpHost));
- }
- } elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
- $callbackUrl= $_SERVER['ORIG_PATH_INFO'];
- if (!empty($_SERVER['QUERY_STRING'])) {
- $callbackUrl .= '?' . $_SERVER['QUERY_STRING'];
- }
- }
- return $callbackUrl;
- }
-
- /**
- * Get the HTTP host
- *
- * @return string
- */
- protected function _getHttpHost()
- {
- if (!empty($_SERVER['HTTP_HOST'])) {
- return $_SERVER['HTTP_HOST'];
- }
- $scheme = 'http';
- if ($_SERVER['HTTPS'] == 'on') {
- $scheme = 'https';
- }
- $name = $_SERVER['SERVER_NAME'];
- $port = $_SERVER['SERVER_PORT'];
- if (($scheme == 'http' && $port == 80)
- || ($scheme == 'https' && $port == 443)
- ) {
- return $name;
- } else {
- return $name . ':' . $port;
- }
- }
-
- /**
- * Retrieve a Header value from either $_SERVER or Apache
- *
- * @param string $header
- * @return bool
- */
- protected function _getHeader($header)
- {
- $temp = strtoupper(str_replace('-', '_', $header));
- if (!empty($_SERVER[$temp])) {
- return $_SERVER[$temp];
- }
- $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header));
- if (!empty($_SERVER[$temp])) {
- return $_SERVER[$temp];
- }
- if (function_exists('apache_request_headers')) {
- $headers = apache_request_headers();
- if (!empty($headers[$header])) {
- return $headers[$header];
- }
- }
- return false;
- }
-
- /**
- * Return the raw body of the request
- *
- * @return string|false Raw body, or false if not present
- */
- protected function _getRawBody()
- {
- $body = file_get_contents('php://input');
- if (strlen(trim($body)) == 0 && isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
- $body = $GLOBALS['HTTP_RAW_POST_DATA'];
- }
- if (strlen(trim($body)) > 0) {
- return $body;
- }
- return false;
- }
-}
diff --git a/library/Zend/Feed/Pubsubhubbub/CallbackInterface.php b/library/Zend/Feed/Pubsubhubbub/CallbackInterface.php
deleted file mode 100644
index d655c1bb41..0000000000
--- a/library/Zend/Feed/Pubsubhubbub/CallbackInterface.php
+++ /dev/null
@@ -1,69 +0,0 @@
-sendHeaders();
- echo $this->getBody();
- }
-
- /**
- * Send all headers
- *
- * Sends any headers specified. If an {@link setHttpResponseCode() HTTP response code}
- * has been specified, it is sent with the first header.
- *
- * @return void
- */
- public function sendHeaders()
- {
- if (count($this->_headers) || (200 != $this->_httpResponseCode)) {
- $this->canSendHeaders(true);
- } elseif (200 == $this->_httpResponseCode) {
- return;
- }
- $httpCodeSent = false;
- foreach ($this->_headers as $header) {
- if (!$httpCodeSent && $this->_httpResponseCode) {
- header($header['name'] . ': ' . $header['value'], $header['replace'], $this->_httpResponseCode);
- $httpCodeSent = true;
- } else {
- header($header['name'] . ': ' . $header['value'], $header['replace']);
- }
- }
- if (!$httpCodeSent) {
- header('HTTP/1.1 ' . $this->_httpResponseCode);
- $httpCodeSent = true;
- }
- }
-
- /**
- * Set a header
- *
- * If $replace is true, replaces any headers already defined with that
- * $name.
- *
- * @param string $name
- * @param string $value
- * @param boolean $replace
- * @return Zend_Feed_Pubsubhubbub_HttpResponse
- */
- public function setHeader($name, $value, $replace = false)
- {
- $name = $this->_normalizeHeader($name);
- $value = (string) $value;
- if ($replace) {
- foreach ($this->_headers as $key => $header) {
- if ($name == $header['name']) {
- unset($this->_headers[$key]);
- }
- }
- }
- $this->_headers[] = array(
- 'name' => $name,
- 'value' => $value,
- 'replace' => $replace,
- );
-
- return $this;
- }
-
- /**
- * Check if a specific Header is set and return its value
- *
- * @param string $name
- * @return string|null
- */
- public function getHeader($name)
- {
- $name = $this->_normalizeHeader($name);
- foreach ($this->_headers as $header) {
- if ($header['name'] == $name) {
- return $header['value'];
- }
- }
- }
-
- /**
- * Return array of headers; see {@link $_headers} for format
- *
- * @return array
- */
- public function getHeaders()
- {
- return $this->_headers;
- }
-
- /**
- * Can we send headers?
- *
- * @param boolean $throw Whether or not to throw an exception if headers have been sent; defaults to false
- * @return boolean
- * @throws Zend_Feed_Pubsubhubbub_Exception
- */
- public function canSendHeaders($throw = false)
- {
- $ok = headers_sent($file, $line);
- if ($ok && $throw) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Cannot send headers; headers already sent in ' . $file . ', line ' . $line);
- }
- return !$ok;
- }
-
- /**
- * Set HTTP response code to use with headers
- *
- * @param int $code
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_HttpResponse
- */
- public function setHttpResponseCode($code)
- {
- if (!is_int($code) || (100 > $code) || (599 < $code)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid HTTP response'
- . ' code:' . $code);
- }
- $this->_httpResponseCode = $code;
- return $this;
- }
-
- /**
- * Retrieve HTTP response code
- *
- * @return int
- */
- public function getHttpResponseCode()
- {
- return $this->_httpResponseCode;
- }
-
- /**
- * Set body content
- *
- * @param string $content
- * @return Zend_Feed_Pubsubhubbub_HttpResponse
- */
- public function setBody($content)
- {
- $this->_body = (string) $content;
- $this->setHeader('content-length', strlen($content));
- return $this;
- }
-
- /**
- * Return the body content
- *
- * @return string
- */
- public function getBody()
- {
- return $this->_body;
- }
-
- /**
- * Normalizes a header name to X-Capitalized-Names
- *
- * @param string $name
- * @return string
- */
- protected function _normalizeHeader($name)
- {
- $filtered = str_replace(array('-', '_'), ' ', (string) $name);
- $filtered = ucwords(strtolower($filtered));
- $filtered = str_replace(' ', '-', $filtered);
- return $filtered;
- }
-}
diff --git a/library/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php b/library/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php
deleted file mode 100644
index 51e84ef199..0000000000
--- a/library/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php
+++ /dev/null
@@ -1,63 +0,0 @@
-_db = new Zend_Db_Table($table);
- } else {
- $this->_db = $tableGateway;
- }
- }
-
-}
diff --git a/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php b/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php
deleted file mode 100644
index b2ae7397aa..0000000000
--- a/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php
+++ /dev/null
@@ -1,141 +0,0 @@
-_db->find($data['id']);
- if (count($result)) {
- $data['created_time'] = $result->current()->created_time;
- $now = new Zend_Date;
- if (isset($data['lease_seconds'])) {
- $data['expiration_time'] = $now->add($data['lease_seconds'], Zend_Date::SECOND)
- ->get('yyyy-MM-dd HH:mm:ss');
- }
- $this->_db->update(
- $data,
- $this->_db->getAdapter()->quoteInto('id = ?', $data['id'])
- );
- return false;
- }
-
- $this->_db->insert($data);
- return true;
- }
-
- /**
- * Get subscription by ID/key
- *
- * @param string $key
- * @throws Zend_Db_Table_Exception
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return array
- */
- public function getSubscription($key)
- {
- if (empty($key) || !is_string($key)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "key"'
- .' of "' . $key . '" must be a non-empty string');
- }
- $result = $this->_db->find($key);
- if (count($result)) {
- return $result->current()->toArray();
- }
- return false;
- }
-
- /**
- * Determine if a subscription matching the key exists
- *
- * @param string $key
- * @throws Zend_Db_Table_Exception
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return bool
- */
- public function hasSubscription($key)
- {
- if (empty($key) || !is_string($key)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "key"'
- .' of "' . $key . '" must be a non-empty string');
- }
- $result = $this->_db->find($key);
- if (count($result)) {
- return true;
- }
- return false;
- }
-
- /**
- * Delete a subscription
- *
- * @param string $key
- * @return bool
- */
- public function deleteSubscription($key)
- {
- $result = $this->_db->find($key);
- if (count($result)) {
- $this->_db->delete(
- $this->_db->getAdapter()->quoteInto('id = ?', $key)
- );
- return true;
- }
- return false;
- }
-
-}
diff --git a/library/Zend/Feed/Pubsubhubbub/Model/SubscriptionInterface.php b/library/Zend/Feed/Pubsubhubbub/Model/SubscriptionInterface.php
deleted file mode 100644
index c604ff1fcf..0000000000
--- a/library/Zend/Feed/Pubsubhubbub/Model/SubscriptionInterface.php
+++ /dev/null
@@ -1,65 +0,0 @@
-setConfig($config);
- }
- }
-
- /**
- * Process any injected configuration options
- *
- * @param array|Zend_Config $config Options array or Zend_Config instance
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function setConfig($config)
- {
- if ($config instanceof Zend_Config) {
- $config = $config->toArray();
- } elseif (!is_array($config)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Array or Zend_Config object'
- . 'expected, got ' . gettype($config));
- }
- if (array_key_exists('hubUrls', $config)) {
- $this->addHubUrls($config['hubUrls']);
- }
- if (array_key_exists('updatedTopicUrls', $config)) {
- $this->addUpdatedTopicUrls($config['updatedTopicUrls']);
- }
- if (array_key_exists('parameters', $config)) {
- $this->setParameters($config['parameters']);
- }
- return $this;
- }
-
- /**
- * Add a Hub Server URL supported by Publisher
- *
- * @param string $url
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function addHubUrl($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"'
- .' of "' . $url . '" must be a non-empty string and a valid'
- .'URL');
- }
- $this->_hubUrls[] = $url;
- return $this;
- }
-
- /**
- * Add an array of Hub Server URLs supported by Publisher
- *
- * @param array $urls
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function addHubUrls(array $urls)
- {
- foreach ($urls as $url) {
- $this->addHubUrl($url);
- }
- return $this;
- }
-
- /**
- * Remove a Hub Server URL
- *
- * @param string $url
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function removeHubUrl($url)
- {
- if (!in_array($url, $this->getHubUrls())) {
- return $this;
- }
- $key = array_search($url, $this->_hubUrls);
- unset($this->_hubUrls[$key]);
- return $this;
- }
-
- /**
- * Return an array of unique Hub Server URLs currently available
- *
- * @return array
- */
- public function getHubUrls()
- {
- $this->_hubUrls = array_unique($this->_hubUrls);
- return $this->_hubUrls;
- }
-
- /**
- * Add a URL to a topic (Atom or RSS feed) which has been updated
- *
- * @param string $url
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function addUpdatedTopicUrl($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"'
- .' of "' . $url . '" must be a non-empty string and a valid'
- .'URL');
- }
- $this->_updatedTopicUrls[] = $url;
- return $this;
- }
-
- /**
- * Add an array of Topic URLs which have been updated
- *
- * @param array $urls
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function addUpdatedTopicUrls(array $urls)
- {
- foreach ($urls as $url) {
- $this->addUpdatedTopicUrl($url);
- }
- return $this;
- }
-
- /**
- * Remove an updated topic URL
- *
- * @param string $url
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function removeUpdatedTopicUrl($url)
- {
- if (!in_array($url, $this->getUpdatedTopicUrls())) {
- return $this;
- }
- $key = array_search($url, $this->_updatedTopicUrls);
- unset($this->_updatedTopicUrls[$key]);
- return $this;
- }
-
- /**
- * Return an array of unique updated topic URLs currently available
- *
- * @return array
- */
- public function getUpdatedTopicUrls()
- {
- $this->_updatedTopicUrls = array_unique($this->_updatedTopicUrls);
- return $this->_updatedTopicUrls;
- }
-
- /**
- * Notifies a single Hub Server URL of changes
- *
- * @param string $url The Hub Server's URL
- * @return void
- * @throws Zend_Feed_Pubsubhubbub_Exception Thrown on failure
- */
- public function notifyHub($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"'
- .' of "' . $url . '" must be a non-empty string and a valid'
- .'URL');
- }
- $client = $this->_getHttpClient();
- $client->setUri($url);
- $response = $client->request();
- if ($response->getStatus() !== 204) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Notification to Hub Server '
- . 'at "' . $url . '" appears to have failed with a status code of "'
- . $response->getStatus() . '" and message "'
- . $response->getMessage() . '"');
- }
- }
-
- /**
- * Notifies all Hub Server URLs of changes
- *
- * If a Hub notification fails, certain data will be retained in an
- * an array retrieved using getErrors(), if a failure occurs for any Hubs
- * the isSuccess() check will return FALSE. This method is designed not
- * to needlessly fail with an Exception/Error unless from Zend_Http_Client.
- *
- * @return void
- * @throws Zend_Feed_Pubsubhubbub_Exception Thrown if no hubs attached
- */
- public function notifyAll()
- {
- $client = $this->_getHttpClient();
- $hubs = $this->getHubUrls();
- if (empty($hubs)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('No Hub Server URLs'
- . ' have been set so no notifcations can be sent');
- }
- $this->_errors = array();
- foreach ($hubs as $url) {
- $client->setUri($url);
- $response = $client->request();
- if ($response->getStatus() !== 204) {
- $this->_errors[] = array(
- 'response' => $response,
- 'hubUrl' => $url
- );
- }
- }
- }
-
- /**
- * Add an optional parameter to the update notification requests
- *
- * @param string $name
- * @param string|null $value
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function setParameter($name, $value = null)
- {
- if (is_array($name)) {
- $this->setParameters($name);
- return $this;
- }
- if (empty($name) || !is_string($name)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"'
- .' of "' . $name . '" must be a non-empty string');
- }
- if ($value === null) {
- $this->removeParameter($name);
- return $this;
- }
- if (empty($value) || (!is_string($value) && $value !== null)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "value"'
- .' of "' . $value . '" must be a non-empty string');
- }
- $this->_parameters[$name] = $value;
- return $this;
- }
-
- /**
- * Add an optional parameter to the update notification requests
- *
- * @param array $parameters
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function setParameters(array $parameters)
- {
- foreach ($parameters as $name => $value) {
- $this->setParameter($name, $value);
- }
- return $this;
- }
-
- /**
- * Remove an optional parameter for the notification requests
- *
- * @param string $name
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Publisher
- */
- public function removeParameter($name)
- {
- if (empty($name) || !is_string($name)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"'
- .' of "' . $name . '" must be a non-empty string');
- }
- if (array_key_exists($name, $this->_parameters)) {
- unset($this->_parameters[$name]);
- }
- return $this;
- }
-
- /**
- * Return an array of optional parameters for notification requests
- *
- * @return array
- */
- public function getParameters()
- {
- return $this->_parameters;
- }
-
- /**
- * Returns a boolean indicator of whether the notifications to Hub
- * Servers were ALL successful. If even one failed, FALSE is returned.
- *
- * @return bool
- */
- public function isSuccess()
- {
- if (count($this->_errors) > 0) {
- return false;
- }
- return true;
- }
-
- /**
- * Return an array of errors met from any failures, including keys:
- * 'response' => the Zend_Http_Response object from the failure
- * 'hubUrl' => the URL of the Hub Server whose notification failed
- *
- * @return array
- */
- public function getErrors()
- {
- return $this->_errors;
- }
-
- /**
- * Get a basic prepared HTTP client for use
- *
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @throws Zend_Http_Client_Exception
- * @return Zend_Http_Client
- */
- protected function _getHttpClient()
- {
- $client = Zend_Feed_Pubsubhubbub::getHttpClient();
- $client->setMethod(Zend_Http_Client::POST);
- $client->setConfig(array(
- 'useragent' => 'Zend_Feed_Pubsubhubbub_Publisher/' . Zend_Version::VERSION,
- ));
- $params = array();
- $params[] = 'hub.mode=publish';
- $topics = $this->getUpdatedTopicUrls();
- if (empty($topics)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('No updated topic URLs'
- . ' have been set');
- }
- foreach ($topics as $topicUrl) {
- $params[] = 'hub.url=' . urlencode($topicUrl);
- }
- $optParams = $this->getParameters();
- foreach ($optParams as $name => $value) {
- $params[] = urlencode($name) . '=' . urlencode($value);
- }
- $paramString = implode('&', $params);
- $client->setRawData($paramString, 'application/x-www-form-urlencoded');
- return $client;
- }
-}
diff --git a/library/Zend/Feed/Pubsubhubbub/Subscriber.php b/library/Zend/Feed/Pubsubhubbub/Subscriber.php
deleted file mode 100644
index 51907a5462..0000000000
--- a/library/Zend/Feed/Pubsubhubbub/Subscriber.php
+++ /dev/null
@@ -1,869 +0,0 @@
-setConfig($config);
- }
- }
-
- /**
- * Process any injected configuration options
- *
- * @param array|Zend_Config $config Options array or Zend_Config instance
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setConfig($config)
- {
- if ($config instanceof Zend_Config) {
- $config = $config->toArray();
- } elseif (!is_array($config)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Array or Zend_Config object'
- . ' expected, got ' . gettype($config));
- }
- if (array_key_exists('hubUrls', $config)) {
- $this->addHubUrls($config['hubUrls']);
- }
- if (array_key_exists('callbackUrl', $config)) {
- $this->setCallbackUrl($config['callbackUrl']);
- }
- if (array_key_exists('topicUrl', $config)) {
- $this->setTopicUrl($config['topicUrl']);
- }
- if (array_key_exists('storage', $config)) {
- $this->setStorage($config['storage']);
- }
- if (array_key_exists('leaseSeconds', $config)) {
- $this->setLeaseSeconds($config['leaseSeconds']);
- }
- if (array_key_exists('parameters', $config)) {
- $this->setParameters($config['parameters']);
- }
- if (array_key_exists('authentications', $config)) {
- $this->addAuthentications($config['authentications']);
- }
- if (array_key_exists('usePathParameter', $config)) {
- $this->usePathParameter($config['usePathParameter']);
- }
- if (array_key_exists('preferredVerificationMode', $config)) {
- $this->setPreferredVerificationMode(
- $config['preferredVerificationMode']
- );
- }
- return $this;
- }
-
- /**
- * Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe
- * event will relate
- *
- * @param string $url
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setTopicUrl($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"'
- .' of "' . $url . '" must be a non-empty string and a valid'
- .' URL');
- }
- $this->_topicUrl = $url;
- return $this;
- }
-
- /**
- * Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe
- * event will relate
- *
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return string
- */
- public function getTopicUrl()
- {
- if (empty($this->_topicUrl)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('A valid Topic (RSS or Atom'
- . ' feed) URL MUST be set before attempting any operation');
- }
- return $this->_topicUrl;
- }
-
- /**
- * Set the number of seconds for which any subscription will remain valid
- *
- * @param int $seconds
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setLeaseSeconds($seconds)
- {
- $seconds = intval($seconds);
- if ($seconds <= 0) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Expected lease seconds'
- . ' must be an integer greater than zero');
- }
- $this->_leaseSeconds = $seconds;
- return $this;
- }
-
- /**
- * Get the number of lease seconds on subscriptions
- *
- * @return int
- */
- public function getLeaseSeconds()
- {
- return $this->_leaseSeconds;
- }
-
- /**
- * Set the callback URL to be used by Hub Servers when communicating with
- * this Subscriber
- *
- * @param string $url
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setCallbackUrl($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"'
- . ' of "' . $url . '" must be a non-empty string and a valid'
- . ' URL');
- }
- $this->_callbackUrl = $url;
- return $this;
- }
-
- /**
- * Get the callback URL to be used by Hub Servers when communicating with
- * this Subscriber
- *
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return string
- */
- public function getCallbackUrl()
- {
- if (empty($this->_callbackUrl)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('A valid Callback URL MUST be'
- . ' set before attempting any operation');
- }
- return $this->_callbackUrl;
- }
-
- /**
- * Set preferred verification mode (sync or async). By default, this
- * Subscriber prefers synchronous verification, but does support
- * asynchronous if that's the Hub Server's utilised mode.
- *
- * Zend_Feed_Pubsubhubbub_Subscriber will always send both modes, whose
- * order of occurance in the parameter list determines this preference.
- *
- * @param string $mode Should be 'sync' or 'async'
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setPreferredVerificationMode($mode)
- {
- if ($mode !== Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC
- && $mode !== Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid preferred'
- . ' mode specified: "' . $mode . '" but should be one of'
- . ' Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC or'
- . ' Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC');
- }
- $this->_preferredVerificationMode = $mode;
- return $this;
- }
-
- /**
- * Get preferred verification mode (sync or async).
- *
- * @return string
- */
- public function getPreferredVerificationMode()
- {
- return $this->_preferredVerificationMode;
- }
-
- /**
- * Add a Hub Server URL supported by Publisher
- *
- * @param string $url
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function addHubUrl($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"'
- . ' of "' . $url . '" must be a non-empty string and a valid'
- . ' URL');
- }
- $this->_hubUrls[] = $url;
- return $this;
- }
-
- /**
- * Add an array of Hub Server URLs supported by Publisher
- *
- * @param array $urls
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function addHubUrls(array $urls)
- {
- foreach ($urls as $url) {
- $this->addHubUrl($url);
- }
- return $this;
- }
-
- /**
- * Remove a Hub Server URL
- *
- * @param string $url
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function removeHubUrl($url)
- {
- if (!in_array($url, $this->getHubUrls())) {
- return $this;
- }
- $key = array_search($url, $this->_hubUrls);
- unset($this->_hubUrls[$key]);
- return $this;
- }
-
- /**
- * Return an array of unique Hub Server URLs currently available
- *
- * @return array
- */
- public function getHubUrls()
- {
- $this->_hubUrls = array_unique($this->_hubUrls);
- return $this->_hubUrls;
- }
-
- /**
- * Add authentication credentials for a given URL
- *
- * @param string $url
- * @param array $authentication
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function addAuthentication($url, array $authentication)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"'
- . ' of "' . $url . '" must be a non-empty string and a valid'
- . ' URL');
- }
- $this->_authentications[$url] = $authentication;
- return $this;
- }
-
- /**
- * Add authentication credentials for hub URLs
- *
- * @param array $authentications
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function addAuthentications(array $authentications)
- {
- foreach ($authentications as $url => $authentication) {
- $this->addAuthentication($url, $authentication);
- }
- return $this;
- }
-
- /**
- * Get all hub URL authentication credentials
- *
- * @return array
- */
- public function getAuthentications()
- {
- return $this->_authentications;
- }
-
- /**
- * Set flag indicating whether or not to use a path parameter
- *
- * @param bool $bool
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function usePathParameter($bool = true)
- {
- $this->_usePathParameter = $bool;
- return $this;
- }
-
- /**
- * Add an optional parameter to the (un)subscribe requests
- *
- * @param string $name
- * @param string|null $value
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setParameter($name, $value = null)
- {
- if (is_array($name)) {
- $this->setParameters($name);
- return $this;
- }
- if (empty($name) || !is_string($name)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"'
- . ' of "' . $name . '" must be a non-empty string');
- }
- if ($value === null) {
- $this->removeParameter($name);
- return $this;
- }
- if (empty($value) || (!is_string($value) && $value !== null)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "value"'
- . ' of "' . $value . '" must be a non-empty string');
- }
- $this->_parameters[$name] = $value;
- return $this;
- }
-
- /**
- * Add an optional parameter to the (un)subscribe requests
- *
- * @param array $parameters
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setParameters(array $parameters)
- {
- foreach ($parameters as $name => $value) {
- $this->setParameter($name, $value);
- }
- return $this;
- }
-
- /**
- * Remove an optional parameter for the (un)subscribe requests
- *
- * @param string $name
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function removeParameter($name)
- {
- if (empty($name) || !is_string($name)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"'
- . ' of "' . $name . '" must be a non-empty string');
- }
- if (array_key_exists($name, $this->_parameters)) {
- unset($this->_parameters[$name]);
- }
- return $this;
- }
-
- /**
- * Return an array of optional parameters for (un)subscribe requests
- *
- * @return array
- */
- public function getParameters()
- {
- return $this->_parameters;
- }
-
- /**
- * Sets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background
- * save any verification tokens associated with a subscription or other.
- *
- * @param Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage
- * @return Zend_Feed_Pubsubhubbub_Subscriber
- */
- public function setStorage(Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage)
- {
- $this->_storage = $storage;
- return $this;
- }
-
- /**
- * Gets an instance of Zend_Feed_Pubsubhubbub_Storage_StorageInterface used
- * to background save any verification tokens associated with a subscription
- * or other.
- *
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface
- */
- public function getStorage()
- {
- if ($this->_storage === null) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('No storage vehicle '
- . 'has been set.');
- }
- return $this->_storage;
- }
-
- /**
- * Subscribe to one or more Hub Servers using the stored Hub URLs
- * for the given Topic URL (RSS or Atom feed)
- */
- public function subscribeAll()
- {
- return $this->_doRequest('subscribe');
- }
-
- /**
- * Unsubscribe from one or more Hub Servers using the stored Hub URLs
- * for the given Topic URL (RSS or Atom feed)
- */
- public function unsubscribeAll()
- {
- return $this->_doRequest('unsubscribe');
- }
-
- /**
- * Returns a boolean indicator of whether the notifications to Hub
- * Servers were ALL successful. If even one failed, FALSE is returned.
- *
- * @return bool
- */
- public function isSuccess()
- {
- if (count($this->_errors) > 0) {
- return false;
- }
- return true;
- }
-
- /**
- * Return an array of errors met from any failures, including keys:
- * 'response' => the Zend_Http_Response object from the failure
- * 'hubUrl' => the URL of the Hub Server whose notification failed
- *
- * @return array
- */
- public function getErrors()
- {
- return $this->_errors;
- }
-
- /**
- * Return an array of Hub Server URLs who returned a response indicating
- * operation in Asynchronous Verification Mode, i.e. they will not confirm
- * any (un)subscription immediately but at a later time (Hubs may be
- * doing this as a batch process when load balancing)
- *
- * @return array
- */
- public function getAsyncHubs()
- {
- return $this->_asyncHubs;
- }
-
- /**
- * Executes an (un)subscribe request
- *
- * @param string $mode
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @throws Zend_Http_Client_Exception
- */
- protected function _doRequest($mode)
- {
- $client = $this->_getHttpClient();
- $hubs = $this->getHubUrls();
- if (empty($hubs)) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('No Hub Server URLs'
- . ' have been set so no subscriptions can be attempted');
- }
- $this->_errors = array();
- $this->_asyncHubs = array();
- foreach ($hubs as $url) {
- if (array_key_exists($url, $this->_authentications)) {
- $auth = $this->_authentications[$url];
- $client->setAuth($auth[0], $auth[1]);
- }
- $client->setUri($url);
- $client->setRawData(
- $this->_getRequestParameters($url, $mode),
- 'application/x-www-form-urlencoded'
- );
- $response = $client->request();
- if ($response->getStatus() !== 204
- && $response->getStatus() !== 202
- ) {
- $this->_errors[] = array(
- 'response' => $response,
- 'hubUrl' => $url,
- );
- /**
- * At first I thought it was needed, but the backend storage will
- * allow tracking async without any user interference. It's left
- * here in case the user is interested in knowing what Hubs
- * are using async verification modes so they may update Models and
- * move these to asynchronous processes.
- */
- } elseif ($response->getStatus() == 202) {
- $this->_asyncHubs[] = array(
- 'response' => $response,
- 'hubUrl' => $url,
- );
- }
- }
- }
-
- /**
- * Get a basic prepared HTTP client for use
- *
- * @return Zend_Http_Client
- */
- protected function _getHttpClient()
- {
- $client = Zend_Feed_Pubsubhubbub::getHttpClient();
- $client->setMethod(Zend_Http_Client::POST);
- $client->setConfig(array('useragent' => 'Zend_Feed_Pubsubhubbub_Subscriber/'
- . Zend_Version::VERSION));
- return $client;
- }
-
- /**
- * Return a list of standard protocol/optional parameters for addition to
- * client's POST body that are specific to the current Hub Server URL
- *
- * @param string $hubUrl
- * @param string $mode
- * @throws Zend_Feed_Pubsubhubbub_Exception
- * @return string
- */
- protected function _getRequestParameters($hubUrl, $mode)
- {
- if (!in_array($mode, array('subscribe', 'unsubscribe'))) {
- #require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
- throw new Zend_Feed_Pubsubhubbub_Exception('Invalid mode specified: "'
- . $mode . '" which should have been "subscribe" or "unsubscribe"');
- }
-
- $params = array(
- 'hub.mode' => $mode,
- 'hub.topic' => $this->getTopicUrl(),
- );
-
- if ($this->getPreferredVerificationMode()
- == Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC
- ) {
- $vmodes = array(
- Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC,
- Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC,
- );
- } else {
- $vmodes = array(
- Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC,
- Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC,
- );
- }
- $params['hub.verify'] = array();
- foreach($vmodes as $vmode) {
- $params['hub.verify'][] = $vmode;
- }
-
- /**
- * Establish a persistent verify_token and attach key to callback
- * URL's path/querystring
- */
- $key = $this->_generateSubscriptionKey($params, $hubUrl);
- $token = $this->_generateVerifyToken();
- $params['hub.verify_token'] = $token;
-
- // Note: query string only usable with PuSH 0.2 Hubs
- if (!$this->_usePathParameter) {
- $params['hub.callback'] = $this->getCallbackUrl()
- . '?xhub.subscription=' . Zend_Feed_Pubsubhubbub::urlencode($key);
- } else {
- $params['hub.callback'] = rtrim($this->getCallbackUrl(), '/')
- . '/' . Zend_Feed_Pubsubhubbub::urlencode($key);
- }
- if ($mode == 'subscribe' && $this->getLeaseSeconds() !== null) {
- $params['hub.lease_seconds'] = $this->getLeaseSeconds();
- }
-
- // hub.secret not currently supported
- $optParams = $this->getParameters();
- foreach ($optParams as $name => $value) {
- $params[$name] = $value;
- }
-
- // store subscription to storage
- $now = new Zend_Date;
- $expires = null;
- if (isset($params['hub.lease_seconds'])) {
- $expires = $now->add($params['hub.lease_seconds'], Zend_Date::SECOND)
- ->get('yyyy-MM-dd HH:mm:ss');
- }
- $data = array(
- 'id' => $key,
- 'topic_url' => $params['hub.topic'],
- 'hub_url' => $hubUrl,
- 'created_time' => $now->get('yyyy-MM-dd HH:mm:ss'),
- 'lease_seconds' => $expires,
- 'verify_token' => hash('sha256', $params['hub.verify_token']),
- 'secret' => null,
- 'expiration_time' => $expires,
- 'subscription_state' => Zend_Feed_Pubsubhubbub::SUBSCRIPTION_NOTVERIFIED,
- );
- $this->getStorage()->setSubscription($data);
-
- return $this->_toByteValueOrderedString(
- $this->_urlEncode($params)
- );
- }
-
- /**
- * Simple helper to generate a verification token used in (un)subscribe
- * requests to a Hub Server. Follows no particular method, which means
- * it might be improved/changed in future.
- *
- * @return string
- */
- protected function _generateVerifyToken()
- {
- if (!empty($this->_testStaticToken)) {
- return $this->_testStaticToken;
- }
- return uniqid(rand(), true) . time();
- }
-
- /**
- * Simple helper to generate a verification token used in (un)subscribe
- * requests to a Hub Server.
- *
- * @param array $params
- * @param string $hubUrl The Hub Server URL for which this token will apply
- * @return string
- */
- protected function _generateSubscriptionKey(array $params, $hubUrl)
- {
- $keyBase = $params['hub.topic'] . $hubUrl;
- $key = md5($keyBase);
- return $key;
- }
-
- /**
- * URL Encode an array of parameters
- *
- * @param array $params
- * @return array
- */
- protected function _urlEncode(array $params)
- {
- $encoded = array();
- foreach ($params as $key => $value) {
- if (is_array($value)) {
- $ekey = Zend_Feed_Pubsubhubbub::urlencode($key);
- $encoded[$ekey] = array();
- foreach ($value as $duplicateKey) {
- $encoded[$ekey][]
- = Zend_Feed_Pubsubhubbub::urlencode($duplicateKey);
- }
- } else {
- $encoded[Zend_Feed_Pubsubhubbub::urlencode($key)]
- = Zend_Feed_Pubsubhubbub::urlencode($value);
- }
- }
- return $encoded;
- }
-
- /**
- * Order outgoing parameters
- *
- * @param array $params
- * @return array
- */
- protected function _toByteValueOrderedString(array $params)
- {
- $return = array();
- uksort($params, 'strnatcmp');
- foreach ($params as $key => $value) {
- if (is_array($value)) {
- foreach ($value as $keyduplicate) {
- $return[] = $key . '=' . $keyduplicate;
- }
- } else {
- $return[] = $key . '=' . $value;
- }
- }
- return implode('&', $return);
- }
-
- /**
- * This is STRICTLY for testing purposes only...
- */
- protected $_testStaticToken = null;
-
- final public function setTestStaticToken($token)
- {
- $this->_testStaticToken = (string) $token;
- }
-}
diff --git a/library/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php b/library/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php
deleted file mode 100644
index aeabbf7cbf..0000000000
--- a/library/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php
+++ /dev/null
@@ -1,330 +0,0 @@
-_subscriptionKey = $key;
- return $this;
- }
-
- /**
- * Handle any callback from a Hub Server responding to a subscription or
- * unsubscription request. This should be the Hub Server confirming the
- * the request prior to taking action on it.
- *
- * @param array $httpGetData GET data if available and not in $_GET
- * @param bool $sendResponseNow Whether to send response now or when asked
- * @return void
- */
- public function handle(array $httpGetData = null, $sendResponseNow = false)
- {
- if ($httpGetData === null) {
- $httpGetData = $_GET;
- }
-
- /**
- * Handle any feed updates (sorry for the mess :P)
- *
- * This DOES NOT attempt to process a feed update. Feed updates
- * SHOULD be validated/processed by an asynchronous process so as
- * to avoid holding up responses to the Hub.
- */
- $contentType = $this->_getHeader('Content-Type');
- if (strtolower($_SERVER['REQUEST_METHOD']) == 'post'
- && $this->_hasValidVerifyToken(null, false)
- && (stripos($contentType, 'application/atom+xml') === 0
- || stripos($contentType, 'application/rss+xml') === 0
- || stripos($contentType, 'application/xml') === 0
- || stripos($contentType, 'text/xml') === 0
- || stripos($contentType, 'application/rdf+xml') === 0)
- ) {
- $this->setFeedUpdate($this->_getRawBody());
- $this->getHttpResponse()
- ->setHeader('X-Hub-On-Behalf-Of', $this->getSubscriberCount());
- /**
- * Handle any (un)subscribe confirmation requests
- */
- } elseif ($this->isValidHubVerification($httpGetData)) {
- $data = $this->_currentSubscriptionData;
- $this->getHttpResponse()->setBody($httpGetData['hub_challenge']);
- $data['subscription_state'] = Zend_Feed_Pubsubhubbub::SUBSCRIPTION_VERIFIED;
- if (isset($httpGetData['hub_lease_seconds'])) {
- $data['lease_seconds'] = $httpGetData['hub_lease_seconds'];
- }
- $this->getStorage()->setSubscription($data);
- /**
- * Hey, C'mon! We tried everything else!
- */
- } else {
- $this->getHttpResponse()->setHttpResponseCode(404);
- }
- if ($sendResponseNow) {
- $this->sendResponse();
- }
- }
-
- /**
- * Checks validity of the request simply by making a quick pass and
- * confirming the presence of all REQUIRED parameters.
- *
- * @param array $httpGetData
- * @return bool
- */
- public function isValidHubVerification(array $httpGetData)
- {
- /**
- * As per the specification, the hub.verify_token is OPTIONAL. This
- * implementation of Pubsubhubbub considers it REQUIRED and will
- * always send a hub.verify_token parameter to be echoed back
- * by the Hub Server. Therefore, its absence is considered invalid.
- */
- if (strtolower($_SERVER['REQUEST_METHOD']) !== 'get') {
- return false;
- }
- $required = array(
- 'hub_mode',
- 'hub_topic',
- 'hub_challenge',
- 'hub_verify_token',
- );
- foreach ($required as $key) {
- if (!array_key_exists($key, $httpGetData)) {
- return false;
- }
- }
- if ($httpGetData['hub_mode'] !== 'subscribe'
- && $httpGetData['hub_mode'] !== 'unsubscribe'
- ) {
- return false;
- }
- if ($httpGetData['hub_mode'] == 'subscribe'
- && !array_key_exists('hub_lease_seconds', $httpGetData)
- ) {
- return false;
- }
- if (!Zend_Uri::check($httpGetData['hub_topic'])) {
- return false;
- }
-
- /**
- * Attempt to retrieve any Verification Token Key attached to Callback
- * URL's path by our Subscriber implementation
- */
- if (!$this->_hasValidVerifyToken($httpGetData)) {
- return false;
- }
- return true;
- }
-
- /**
- * Sets a newly received feed (Atom/RSS) sent by a Hub as an update to a
- * Topic we've subscribed to.
- *
- * @param string $feed
- * @return Zend_Feed_Pubsubhubbub_Subscriber_Callback
- */
- public function setFeedUpdate($feed)
- {
- $this->_feedUpdate = $feed;
- return $this;
- }
-
- /**
- * Check if any newly received feed (Atom/RSS) update was received
- *
- * @return bool
- */
- public function hasFeedUpdate()
- {
- if ($this->_feedUpdate === null) {
- return false;
- }
- return true;
- }
-
- /**
- * Gets a newly received feed (Atom/RSS) sent by a Hub as an update to a
- * Topic we've subscribed to.
- *
- * @return string
- */
- public function getFeedUpdate()
- {
- return $this->_feedUpdate;
- }
-
- /**
- * Check for a valid verify_token. By default attempts to compare values
- * with that sent from Hub, otherwise merely ascertains its existence.
- *
- * @param array $httpGetData
- * @param bool $checkValue
- * @return bool
- */
- protected function _hasValidVerifyToken(array $httpGetData = null, $checkValue = true)
- {
- $verifyTokenKey = $this->_detectVerifyTokenKey($httpGetData);
- if (empty($verifyTokenKey)) {
- return false;
- }
- $verifyTokenExists = $this->getStorage()->hasSubscription($verifyTokenKey);
- if (!$verifyTokenExists) {
- return false;
- }
- if ($checkValue) {
- $data = $this->getStorage()->getSubscription($verifyTokenKey);
- $verifyToken = $data['verify_token'];
- if ($verifyToken !== hash('sha256', $httpGetData['hub_verify_token'])) {
- return false;
- }
- $this->_currentSubscriptionData = $data;
- return true;
- }
- return true;
- }
-
- /**
- * Attempt to detect the verification token key. This would be passed in
- * the Callback URL (which we are handling with this class!) as a URI
- * path part (the last part by convention).
- *
- * @param null|array $httpGetData
- * @return false|string
- */
- protected function _detectVerifyTokenKey(array $httpGetData = null)
- {
- /**
- * Available when sub keys encoding in Callback URL path
- */
- if (isset($this->_subscriptionKey)) {
- return $this->_subscriptionKey;
- }
-
- /**
- * Available only if allowed by PuSH 0.2 Hubs
- */
- if (is_array($httpGetData)
- && isset($httpGetData['xhub_subscription'])
- ) {
- return $httpGetData['xhub_subscription'];
- }
-
- /**
- * Available (possibly) if corrupted in transit and not part of $_GET
- */
- $params = $this->_parseQueryString();
- if (isset($params['xhub.subscription'])) {
- return rawurldecode($params['xhub.subscription']);
- }
-
- return false;
- }
-
- /**
- * Build an array of Query String parameters.
- * This bypasses $_GET which munges parameter names and cannot accept
- * multiple parameters with the same key.
- *
- * @return array|void
- */
- protected function _parseQueryString()
- {
- $params = array();
- $queryString = '';
- if (isset($_SERVER['QUERY_STRING'])) {
- $queryString = $_SERVER['QUERY_STRING'];
- }
- if (empty($queryString)) {
- return array();
- }
- $parts = explode('&', $queryString);
- foreach ($parts as $kvpair) {
- $pair = explode('=', $kvpair);
- $key = rawurldecode($pair[0]);
- $value = rawurldecode($pair[1]);
- if (isset($params[$key])) {
- if (is_array($params[$key])) {
- $params[$key][] = $value;
- } else {
- $params[$key] = array($params[$key], $value);
- }
- } else {
- $params[$key] = $value;
- }
- }
- return $params;
- }
-}
diff --git a/library/Zend/Feed/Reader.php b/library/Zend/Feed/Reader.php
deleted file mode 100644
index bd3961936a..0000000000
--- a/library/Zend/Feed/Reader.php
+++ /dev/null
@@ -1,757 +0,0 @@
- array(
- 'DublinCore_Feed',
- 'Atom_Feed'
- ),
- 'entry' => array(
- 'Content_Entry',
- 'DublinCore_Entry',
- 'Atom_Entry'
- ),
- 'core' => array(
- 'DublinCore_Feed',
- 'Atom_Feed',
- 'Content_Entry',
- 'DublinCore_Entry',
- 'Atom_Entry'
- )
- );
-
- /**
- * Get the Feed cache
- *
- * @return Zend_Cache_Core
- */
- public static function getCache()
- {
- return self::$_cache;
- }
-
- /**
- * Set the feed cache
- *
- * @param Zend_Cache_Core $cache
- * @return void
- */
- public static function setCache(Zend_Cache_Core $cache)
- {
- self::$_cache = $cache;
- }
-
- /**
- * Set the HTTP client instance
- *
- * Sets the HTTP client object to use for retrieving the feeds.
- *
- * @param Zend_Http_Client $httpClient
- * @return void
- */
- public static function setHttpClient(Zend_Http_Client $httpClient)
- {
- self::$_httpClient = $httpClient;
- }
-
-
- /**
- * Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used.
- *
- * @return Zend_Http_Client_Abstract
- */
- public static function getHttpClient()
- {
- if (!self::$_httpClient instanceof Zend_Http_Client) {
- /**
- * @see Zend_Http_Client
- */
- #require_once 'Zend/Http/Client.php';
- self::$_httpClient = new Zend_Http_Client();
- }
-
- return self::$_httpClient;
- }
-
- /**
- * Toggle using POST instead of PUT and DELETE HTTP methods
- *
- * Some feed implementations do not accept PUT and DELETE HTTP
- * methods, or they can't be used because of proxies or other
- * measures. This allows turning on using POST where PUT and
- * DELETE would normally be used; in addition, an
- * X-Method-Override header will be sent with a value of PUT or
- * DELETE as appropriate.
- *
- * @param boolean $override Whether to override PUT and DELETE.
- * @return void
- */
- public static function setHttpMethodOverride($override = true)
- {
- self::$_httpMethodOverride = $override;
- }
-
- /**
- * Get the HTTP override state
- *
- * @return boolean
- */
- public static function getHttpMethodOverride()
- {
- return self::$_httpMethodOverride;
- }
-
- /**
- * Set the flag indicating whether or not to use HTTP conditional GET
- *
- * @param bool $bool
- * @return void
- */
- public static function useHttpConditionalGet($bool = true)
- {
- self::$_httpConditionalGet = $bool;
- }
-
- /**
- * Import a feed by providing a URL
- *
- * @param string $url The URL to the feed
- * @param string $etag OPTIONAL Last received ETag for this resource
- * @param string $lastModified OPTIONAL Last-Modified value for this resource
- * @return Zend_Feed_Reader_FeedInterface
- */
- public static function import($uri, $etag = null, $lastModified = null)
- {
- $cache = self::getCache();
- $feed = null;
- $responseXml = '';
- $client = self::getHttpClient();
- $client->resetParameters();
- $client->setHeaders('If-None-Match', null);
- $client->setHeaders('If-Modified-Since', null);
- $client->setUri($uri);
- $cacheId = 'Zend_Feed_Reader_' . md5($uri);
-
- if (self::$_httpConditionalGet && $cache) {
- $data = $cache->load($cacheId);
- if ($data) {
- if ($etag === null) {
- $etag = $cache->load($cacheId.'_etag');
- }
- if ($lastModified === null) {
- $lastModified = $cache->load($cacheId.'_lastmodified');
- }
- if ($etag) {
- $client->setHeaders('If-None-Match', $etag);
- }
- if ($lastModified) {
- $client->setHeaders('If-Modified-Since', $lastModified);
- }
- }
- $response = $client->request('GET');
- if ($response->getStatus() !== 200 && $response->getStatus() !== 304) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus());
- }
- if ($response->getStatus() == 304) {
- $responseXml = $data;
- } else {
- $responseXml = $response->getBody();
- $cache->save($responseXml, $cacheId);
- if ($response->getHeader('ETag')) {
- $cache->save($response->getHeader('ETag'), $cacheId.'_etag');
- }
- if ($response->getHeader('Last-Modified')) {
- $cache->save($response->getHeader('Last-Modified'), $cacheId.'_lastmodified');
- }
- }
- if (empty($responseXml)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got empty response body');
- }
- return self::importString($responseXml);
- } elseif ($cache) {
- $data = $cache->load($cacheId);
- if ($data !== false) {
- return self::importString($data);
- }
- $response = $client->request('GET');
- if ($response->getStatus() !== 200) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus());
- }
- $responseXml = $response->getBody();
- $cache->save($responseXml, $cacheId);
- if (empty($responseXml)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got empty response body');
- }
- return self::importString($responseXml);
- } else {
- $response = $client->request('GET');
- if ($response->getStatus() !== 200) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus());
- }
- $responseXml = $response->getBody();
- if (empty($responseXml)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Feed failed to load, got empty response body');
- }
- $reader = self::importString($responseXml);
- $reader->setOriginalSourceUri($uri);
- return $reader;
- }
- }
-
- /**
- * Import a feed by providing a Zend_Feed_Abstract object
- *
- * @param Zend_Feed_Abstract $feed A fully instantiated Zend_Feed object
- * @return Zend_Feed_Reader_FeedInterface
- */
- public static function importFeed(Zend_Feed_Abstract $feed)
- {
- $dom = $feed->getDOM()->ownerDocument;
- $type = self::detectType($dom);
- self::_registerCoreExtensions();
- if (substr($type, 0, 3) == 'rss') {
- $reader = new Zend_Feed_Reader_Feed_Rss($dom, $type);
- } else {
- $reader = new Zend_Feed_Reader_Feed_Atom($dom, $type);
- }
-
- return $reader;
- }
-
- /**
- * Import a feed from a string
- *
- * @param string $string
- * @return Zend_Feed_Reader_FeedInterface
- */
- public static function importString($string)
- {
- $dom = new DOMDocument;
- try {
- $dom = Zend_Xml_Security::scan($string, $dom);
- } catch (Zend_Xml_Exception $e) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception(
- $e->getMessage()
- );
- }
- if (!$dom) {
- // Build error message
- $error = libxml_get_last_error();
- if ($error && $error->message) {
- $errormsg = "DOMDocument cannot parse XML: {$error->message}";
- } else {
- $errormsg = "DOMDocument cannot parse XML: Please check the XML document's validity";
- }
-
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception($errormsg);
- }
-
- $type = self::detectType($dom);
-
- self::_registerCoreExtensions();
-
- if (substr($type, 0, 3) == 'rss') {
- $reader = new Zend_Feed_Reader_Feed_Rss($dom, $type);
- } elseif (substr($type, 8, 5) == 'entry') {
- $reader = new Zend_Feed_Reader_Entry_Atom($dom->documentElement, 0, Zend_Feed_Reader::TYPE_ATOM_10);
- } elseif (substr($type, 0, 4) == 'atom') {
- $reader = new Zend_Feed_Reader_Feed_Atom($dom, $type);
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('The URI used does not point to a '
- . 'valid Atom, RSS or RDF feed that Zend_Feed_Reader can parse.');
- }
- return $reader;
- }
-
- /**
- * Imports a feed from a file located at $filename.
- *
- * @param string $filename
- * @throws Zend_Feed_Exception
- * @return Zend_Feed_Reader_FeedInterface
- */
- public static function importFile($filename)
- {
- @ini_set('track_errors', 1);
- $feed = @file_get_contents($filename);
- @ini_restore('track_errors');
- if ($feed === false) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("File could not be loaded: $php_errormsg");
- }
- return self::importString($feed);
- }
-
- public static function findFeedLinks($uri)
- {
- // Get the HTTP response from $uri and save the contents
- $client = self::getHttpClient();
- $client->setUri($uri);
- $response = $client->request();
- if ($response->getStatus() !== 200) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("Failed to access $uri, got response code " . $response->getStatus());
- }
- $responseHtml = $response->getBody();
- $libxml_errflag = libxml_use_internal_errors(true);
- $oldValue = libxml_disable_entity_loader(true);
- $dom = new DOMDocument;
- $status = $dom->loadHTML($responseHtml);
- libxml_disable_entity_loader($oldValue);
- libxml_use_internal_errors($libxml_errflag);
- if (!$status) {
- // Build error message
- $error = libxml_get_last_error();
- if ($error && $error->message) {
- $errormsg = "DOMDocument cannot parse HTML: {$error->message}";
- } else {
- $errormsg = "DOMDocument cannot parse HTML: Please check the XML document's validity";
- }
-
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception($errormsg);
- }
- $feedSet = new Zend_Feed_Reader_FeedSet;
- $links = $dom->getElementsByTagName('link');
- $feedSet->addLinks($links, $uri);
- return $feedSet;
- }
-
- /**
- * Detect the feed type of the provided feed
- *
- * @param Zend_Feed_Abstract|DOMDocument|string $feed
- * @param bool $specOnly
- * @return string
- * @throws Zend_Feed_Exception
- */
- public static function detectType($feed, $specOnly = false)
- {
- if ($feed instanceof Zend_Feed_Reader_FeedInterface) {
- $dom = $feed->getDomDocument();
- } elseif($feed instanceof DOMDocument) {
- $dom = $feed;
- } elseif(is_string($feed) && !empty($feed)) {
- @ini_set('track_errors', 1);
- //$oldValue = libxml_disable_entity_loader(true);
- $dom = new DOMDocument;
- try {
- $dom = Zend_Xml_Security::scan($feed, $dom);
- } catch (Zend_Xml_Exception $e) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception(
- $e->getMessage()
- );
- }
- //libxml_disable_entity_loader($oldValue);
- @ini_restore('track_errors');
- if (!$dom) {
- if (!isset($php_errormsg)) {
- if (function_exists('xdebug_is_enabled')) {
- $php_errormsg = '(error message not available, when XDebug is running)';
- } else {
- $php_errormsg = '(error message not available)';
- }
- }
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception("DOMDocument cannot parse XML: $php_errormsg");
- }
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid object/scalar provided: must'
- . ' be of type Zend_Feed_Reader_FeedInterface, DomDocument or string');
- }
- $xpath = new DOMXPath($dom);
-
- if ($xpath->query('/rss')->length) {
- $type = self::TYPE_RSS_ANY;
- $version = $xpath->evaluate('string(/rss/@version)');
-
- if (strlen($version) > 0) {
- switch($version) {
- case '2.0':
- $type = self::TYPE_RSS_20;
- break;
-
- case '0.94':
- $type = self::TYPE_RSS_094;
- break;
-
- case '0.93':
- $type = self::TYPE_RSS_093;
- break;
-
- case '0.92':
- $type = self::TYPE_RSS_092;
- break;
-
- case '0.91':
- $type = self::TYPE_RSS_091;
- break;
- }
- }
-
- return $type;
- }
-
- $xpath->registerNamespace('rdf', self::NAMESPACE_RDF);
-
- if ($xpath->query('/rdf:RDF')->length) {
- $xpath->registerNamespace('rss', self::NAMESPACE_RSS_10);
-
- if ($xpath->query('/rdf:RDF/rss:channel')->length
- || $xpath->query('/rdf:RDF/rss:image')->length
- || $xpath->query('/rdf:RDF/rss:item')->length
- || $xpath->query('/rdf:RDF/rss:textinput')->length
- ) {
- return self::TYPE_RSS_10;
- }
-
- $xpath->registerNamespace('rss', self::NAMESPACE_RSS_090);
-
- if ($xpath->query('/rdf:RDF/rss:channel')->length
- || $xpath->query('/rdf:RDF/rss:image')->length
- || $xpath->query('/rdf:RDF/rss:item')->length
- || $xpath->query('/rdf:RDF/rss:textinput')->length
- ) {
- return self::TYPE_RSS_090;
- }
- }
-
- $type = self::TYPE_ATOM_ANY;
- $xpath->registerNamespace('atom', self::NAMESPACE_ATOM_10);
-
- if ($xpath->query('//atom:feed')->length) {
- return self::TYPE_ATOM_10;
- }
-
- if ($xpath->query('//atom:entry')->length) {
- if ($specOnly == true) {
- return self::TYPE_ATOM_10;
- } else {
- return self::TYPE_ATOM_10_ENTRY;
- }
- }
-
- $xpath->registerNamespace('atom', self::NAMESPACE_ATOM_03);
-
- if ($xpath->query('//atom:feed')->length) {
- return self::TYPE_ATOM_03;
- }
-
- return self::TYPE_ANY;
- }
-
- /**
- * Set plugin loader for use with Extensions
- *
- * @param Zend_Loader_PluginLoader_Interface $loader
- */
- public static function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader)
- {
- self::$_pluginLoader = $loader;
- }
-
- /**
- * Get plugin loader for use with Extensions
- *
- * @return Zend_Loader_PluginLoader_Interface $loader
- */
- public static function getPluginLoader()
- {
- if (!isset(self::$_pluginLoader)) {
- #require_once 'Zend/Loader/PluginLoader.php';
- self::$_pluginLoader = new Zend_Loader_PluginLoader(array(
- 'Zend_Feed_Reader_Extension_' => 'Zend/Feed/Reader/Extension/',
- ));
- }
- return self::$_pluginLoader;
- }
-
- /**
- * Add prefix path for loading Extensions
- *
- * @param string $prefix
- * @param string $path
- * @return void
- */
- public static function addPrefixPath($prefix, $path)
- {
- $prefix = rtrim($prefix, '_');
- $path = rtrim($path, DIRECTORY_SEPARATOR);
- self::getPluginLoader()->addPrefixPath($prefix, $path);
- }
-
- /**
- * Add multiple Extension prefix paths at once
- *
- * @param array $spec
- * @return void
- */
- public static function addPrefixPaths(array $spec)
- {
- if (isset($spec['prefix']) && isset($spec['path'])) {
- self::addPrefixPath($spec['prefix'], $spec['path']);
- }
- foreach ($spec as $prefixPath) {
- if (isset($prefixPath['prefix']) && isset($prefixPath['path'])) {
- self::addPrefixPath($prefixPath['prefix'], $prefixPath['path']);
- }
- }
- }
-
- /**
- * Register an Extension by name
- *
- * @param string $name
- * @return void
- * @throws Zend_Feed_Exception if unable to resolve Extension class
- */
- public static function registerExtension($name)
- {
- $feedName = $name . '_Feed';
- $entryName = $name . '_Entry';
- if (self::isRegistered($name)) {
- if (self::getPluginLoader()->isLoaded($feedName) ||
- self::getPluginLoader()->isLoaded($entryName)) {
- return;
- }
- }
- try {
- self::getPluginLoader()->load($feedName);
- self::$_extensions['feed'][] = $feedName;
- } catch (Zend_Loader_PluginLoader_Exception $e) {
- }
- try {
- self::getPluginLoader()->load($entryName);
- self::$_extensions['entry'][] = $entryName;
- } catch (Zend_Loader_PluginLoader_Exception $e) {
- }
- if (!self::getPluginLoader()->isLoaded($feedName)
- && !self::getPluginLoader()->isLoaded($entryName)
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Could not load extension: ' . $name
- . 'using Plugin Loader. Check prefix paths are configured and extension exists.');
- }
- }
-
- /**
- * Is a given named Extension registered?
- *
- * @param string $extensionName
- * @return boolean
- */
- public static function isRegistered($extensionName)
- {
- $feedName = $extensionName . '_Feed';
- $entryName = $extensionName . '_Entry';
- if (in_array($feedName, self::$_extensions['feed'])
- || in_array($entryName, self::$_extensions['entry'])
- ) {
- return true;
- }
- return false;
- }
-
- /**
- * Get a list of extensions
- *
- * @return array
- */
- public static function getExtensions()
- {
- return self::$_extensions;
- }
-
- /**
- * Reset class state to defaults
- *
- * @return void
- */
- public static function reset()
- {
- self::$_cache = null;
- self::$_httpClient = null;
- self::$_httpMethodOverride = false;
- self::$_httpConditionalGet = false;
- self::$_pluginLoader = null;
- self::$_prefixPaths = array();
- self::$_extensions = array(
- 'feed' => array(
- 'DublinCore_Feed',
- 'Atom_Feed'
- ),
- 'entry' => array(
- 'Content_Entry',
- 'DublinCore_Entry',
- 'Atom_Entry'
- ),
- 'core' => array(
- 'DublinCore_Feed',
- 'Atom_Feed',
- 'Content_Entry',
- 'DublinCore_Entry',
- 'Atom_Entry'
- )
- );
- }
-
- /**
- * Register core (default) extensions
- *
- * @return void
- */
- protected static function _registerCoreExtensions()
- {
- self::registerExtension('DublinCore');
- self::registerExtension('Content');
- self::registerExtension('Atom');
- self::registerExtension('Slash');
- self::registerExtension('WellFormedWeb');
- self::registerExtension('Thread');
- self::registerExtension('Podcast');
- }
-
- /**
- * Utility method to apply array_unique operation to a multidimensional
- * array.
- *
- * @param array
- * @return array
- */
- public static function arrayUnique(array $array)
- {
- foreach ($array as &$value) {
- $value = serialize($value);
- }
- $array = array_unique($array);
- foreach ($array as &$value) {
- $value = unserialize($value);
- }
- return $array;
- }
-
-}
diff --git a/library/Zend/Feed/Reader/Collection.php b/library/Zend/Feed/Reader/Collection.php
deleted file mode 100644
index b12d6744ac..0000000000
--- a/library/Zend/Feed/Reader/Collection.php
+++ /dev/null
@@ -1,33 +0,0 @@
-getIterator() as $element) {
- $authors[] = $element['name'];
- }
- return array_unique($authors);
- }
-
-}
diff --git a/library/Zend/Feed/Reader/Collection/Category.php b/library/Zend/Feed/Reader/Collection/Category.php
deleted file mode 100644
index 2633fa585f..0000000000
--- a/library/Zend/Feed/Reader/Collection/Category.php
+++ /dev/null
@@ -1,57 +0,0 @@
-getIterator() as $element) {
- if (isset($element['label']) && !empty($element['label'])) {
- $categories[] = $element['label'];
- } else {
- $categories[] = $element['term'];
- }
- }
- return array_unique($categories);
- }
-
-}
diff --git a/library/Zend/Feed/Reader/Collection/CollectionAbstract.php b/library/Zend/Feed/Reader/Collection/CollectionAbstract.php
deleted file mode 100644
index d718d55ede..0000000000
--- a/library/Zend/Feed/Reader/Collection/CollectionAbstract.php
+++ /dev/null
@@ -1,41 +0,0 @@
-_xpathQuery = '//atom:entry[' . ($this->_entryKey + 1) . ']';
-
- $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Entry');
- $this->_extensions['Atom_Entry'] = new $atomClass($entry, $entryKey, $type);
-
- $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Thread_Entry');
- $this->_extensions['Thread_Entry'] = new $threadClass($entry, $entryKey, $type);
-
- $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Entry');
- $this->_extensions['DublinCore_Entry'] = new $threadClass($entry, $entryKey, $type);
- }
-
- /**
- * Get the specified author
- *
- * @param int $index
- * @return string|null
- */
- public function getAuthor($index = 0)
- {
- $authors = $this->getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $people = $this->getExtension('Atom')->getAuthors();
-
- $this->_data['authors'] = $people;
-
- return $this->_data['authors'];
- }
-
- /**
- * Get the entry content
- *
- * @return string
- */
- public function getContent()
- {
- if (array_key_exists('content', $this->_data)) {
- return $this->_data['content'];
- }
-
- $content = $this->getExtension('Atom')->getContent();
-
- $this->_data['content'] = $content;
-
- return $this->_data['content'];
- }
-
- /**
- * Get the entry creation date
- *
- * @return string
- */
- public function getDateCreated()
- {
- if (array_key_exists('datecreated', $this->_data)) {
- return $this->_data['datecreated'];
- }
-
- $dateCreated = $this->getExtension('Atom')->getDateCreated();
-
- $this->_data['datecreated'] = $dateCreated;
-
- return $this->_data['datecreated'];
- }
-
- /**
- * Get the entry modification date
- *
- * @return string
- */
- public function getDateModified()
- {
- if (array_key_exists('datemodified', $this->_data)) {
- return $this->_data['datemodified'];
- }
-
- $dateModified = $this->getExtension('Atom')->getDateModified();
-
- $this->_data['datemodified'] = $dateModified;
-
- return $this->_data['datemodified'];
- }
-
- /**
- * Get the entry description
- *
- * @return string
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = $this->getExtension('Atom')->getDescription();
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the entry enclosure
- *
- * @return string
- */
- public function getEnclosure()
- {
- if (array_key_exists('enclosure', $this->_data)) {
- return $this->_data['enclosure'];
- }
-
- $enclosure = $this->getExtension('Atom')->getEnclosure();
-
- $this->_data['enclosure'] = $enclosure;
-
- return $this->_data['enclosure'];
- }
-
- /**
- * Get the entry ID
- *
- * @return string
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = $this->getExtension('Atom')->getId();
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get a specific link
- *
- * @param int $index
- * @return string
- */
- public function getLink($index = 0)
- {
- if (!array_key_exists('links', $this->_data)) {
- $this->getLinks();
- }
-
- if (isset($this->_data['links'][$index])) {
- return $this->_data['links'][$index];
- }
-
- return null;
- }
-
- /**
- * Get all links
- *
- * @return array
- */
- public function getLinks()
- {
- if (array_key_exists('links', $this->_data)) {
- return $this->_data['links'];
- }
-
- $links = $this->getExtension('Atom')->getLinks();
-
- $this->_data['links'] = $links;
-
- return $this->_data['links'];
- }
-
- /**
- * Get a permalink to the entry
- *
- * @return string
- */
- public function getPermalink()
- {
- return $this->getLink(0);
- }
-
- /**
- * Get the entry title
- *
- * @return string
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = $this->getExtension('Atom')->getTitle();
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- * Get the number of comments/replies for current entry
- *
- * @return integer
- */
- public function getCommentCount()
- {
- if (array_key_exists('commentcount', $this->_data)) {
- return $this->_data['commentcount'];
- }
-
- $commentcount = $this->getExtension('Thread')->getCommentCount();
-
- if (!$commentcount) {
- $commentcount = $this->getExtension('Atom')->getCommentCount();
- }
-
- $this->_data['commentcount'] = $commentcount;
-
- return $this->_data['commentcount'];
- }
-
- /**
- * Returns a URI pointing to the HTML page where comments can be made on this entry
- *
- * @return string
- */
- public function getCommentLink()
- {
- if (array_key_exists('commentlink', $this->_data)) {
- return $this->_data['commentlink'];
- }
-
- $commentlink = $this->getExtension('Atom')->getCommentLink();
-
- $this->_data['commentlink'] = $commentlink;
-
- return $this->_data['commentlink'];
- }
-
- /**
- * Returns a URI pointing to a feed of all comments for this entry
- *
- * @return string
- */
- public function getCommentFeedLink()
- {
- if (array_key_exists('commentfeedlink', $this->_data)) {
- return $this->_data['commentfeedlink'];
- }
-
- $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink();
-
- $this->_data['commentfeedlink'] = $commentfeedlink;
-
- return $this->_data['commentfeedlink'];
- }
-
- /**
- * Get category data as a Zend_Feed_Reader_Collection_Category object
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- $categoryCollection = $this->getExtension('Atom')->getCategories();
-
- if (count($categoryCollection) == 0) {
- $categoryCollection = $this->getExtension('DublinCore')->getCategories();
- }
-
- $this->_data['categories'] = $categoryCollection;
-
- return $this->_data['categories'];
- }
-
- /**
- * Get source feed metadata from the entry
- *
- * @return Zend_Feed_Reader_Feed_Atom_Source|null
- */
- public function getSource()
- {
- if (array_key_exists('source', $this->_data)) {
- return $this->_data['source'];
- }
-
- $source = $this->getExtension('Atom')->getSource();
-
- $this->_data['source'] = $source;
-
- return $this->_data['source'];
- }
-
- /**
- * Set the XPath query (incl. on all Extensions)
- *
- * @param DOMXPath $xpath
- */
- public function setXpath(DOMXPath $xpath)
- {
- parent::setXpath($xpath);
- foreach ($this->_extensions as $extension) {
- $extension->setXpath($this->_xpath);
- }
- }
-}
diff --git a/library/Zend/Feed/Reader/Entry/Rss.php b/library/Zend/Feed/Reader/Entry/Rss.php
deleted file mode 100644
index 0a23c42c75..0000000000
--- a/library/Zend/Feed/Reader/Entry/Rss.php
+++ /dev/null
@@ -1,668 +0,0 @@
-_xpathQueryRss = '//item[' . ($this->_entryKey+1) . ']';
- $this->_xpathQueryRdf = '//rss:item[' . ($this->_entryKey+1) . ']';
-
- $pluginLoader = Zend_Feed_Reader::getPluginLoader();
-
- $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);
-
- $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);
-
- $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);
- }
-
- /**
- * Get an author entry
- *
- * @param DOMElement $element
- * @return string
- */
- public function getAuthor($index = 0)
- {
- $authors = $this->getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $authors = array();
- $authors_dc = $this->getExtension('DublinCore')->getAuthors();
- if (!empty($authors_dc)) {
- foreach ($authors_dc as $author) {
- $authors[] = array(
- 'name' => $author['name']
- );
- }
- }
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $list = $this->_xpath->query($this->_xpathQueryRss . '//author');
- } else {
- $list = $this->_xpath->query($this->_xpathQueryRdf . '//rss:author');
- }
- if ($list->length) {
- foreach ($list as $author) {
- $string = trim($author->nodeValue);
- $email = null;
- $name = null;
- $data = array();
- // Pretty rough parsing - but it's a catchall
- if (preg_match("/^.*@[^ ]*/", $string, $matches)) {
- $data['email'] = trim($matches[0]);
- if (preg_match("/\((.*)\)$/", $string, $matches)) {
- $data['name'] = $matches[1];
- }
- $authors[] = $data;
- }
- }
- }
-
- if (count($authors) == 0) {
- $authors = $this->getExtension('Atom')->getAuthors();
- } else {
- $authors = new Zend_Feed_Reader_Collection_Author(
- Zend_Feed_Reader::arrayUnique($authors)
- );
- }
-
- if (count($authors) == 0) {
- $authors = null;
- }
-
- $this->_data['authors'] = $authors;
-
- return $this->_data['authors'];
- }
-
- /**
- * Get the entry content
- *
- * @return string
- */
- public function getContent()
- {
- if (array_key_exists('content', $this->_data)) {
- return $this->_data['content'];
- }
-
- $content = $this->getExtension('Content')->getContent();
-
- if (!$content) {
- $content = $this->getDescription();
- }
-
- if (empty($content)) {
- $content = $this->getExtension('Atom')->getContent();
- }
-
- $this->_data['content'] = $content;
-
- return $this->_data['content'];
- }
-
- /**
- * Get the entry's date of creation
- *
- * @return string
- */
- public function getDateCreated()
- {
- return $this->getDateModified();
- }
-
- /**
- * Get the entry's date of modification
- *
- * @return string
- */
- public function getDateModified()
- {
- if (array_key_exists('datemodified', $this->_data)) {
- return $this->_data['datemodified'];
- }
-
- $dateModified = null;
- $date = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
- ) {
- $dateModified = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/pubDate)');
- if ($dateModified) {
- $dateModifiedParsed = strtotime($dateModified);
- if ($dateModifiedParsed) {
- $date = new Zend_Date($dateModifiedParsed);
- } else {
- $dateStandards = array(Zend_Date::RSS, Zend_Date::RFC_822,
- Zend_Date::RFC_2822, Zend_Date::DATES);
- $date = new Zend_Date;
- foreach ($dateStandards as $standard) {
- try {
- $date->set($dateModified, $standard);
- break;
- } catch (Zend_Date_Exception $e) {
- if ($standard == Zend_Date::DATES) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception(
- 'Could not load date due to unrecognised'
- .' format (should follow RFC 822 or 2822):'
- . $e->getMessage(),
- 0, $e
- );
- }
- }
- }
- }
- }
- }
-
- if (!$date) {
- $date = $this->getExtension('DublinCore')->getDate();
- }
-
- if (!$date) {
- $date = $this->getExtension('Atom')->getDateModified();
- }
-
- if (!$date) {
- $date = null;
- }
-
- $this->_data['datemodified'] = $date;
-
- return $this->_data['datemodified'];
- }
-
- /**
- * Get the entry description
- *
- * @return string
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
- ) {
- $description = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/description)');
- } else {
- $description = $this->_xpath->evaluate('string('.$this->_xpathQueryRdf.'/rss:description)');
- }
-
- if (!$description) {
- $description = $this->getExtension('DublinCore')->getDescription();
- }
-
- if (empty($description)) {
- $description = $this->getExtension('Atom')->getDescription();
- }
-
- if (!$description) {
- $description = null;
- }
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the entry enclosure
- * @return string
- */
- public function getEnclosure()
- {
- if (array_key_exists('enclosure', $this->_data)) {
- return $this->_data['enclosure'];
- }
-
- $enclosure = null;
-
- if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_20) {
- $nodeList = $this->_xpath->query($this->_xpathQueryRss . '/enclosure');
-
- if ($nodeList->length > 0) {
- $enclosure = new stdClass();
- $enclosure->url = $nodeList->item(0)->getAttribute('url');
- $enclosure->length = $nodeList->item(0)->getAttribute('length');
- $enclosure->type = $nodeList->item(0)->getAttribute('type');
- }
- }
-
- if (!$enclosure) {
- $enclosure = $this->getExtension('Atom')->getEnclosure();
- }
-
- $this->_data['enclosure'] = $enclosure;
-
- return $this->_data['enclosure'];
- }
-
- /**
- * Get the entry ID
- *
- * @return string
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
- ) {
- $id = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/guid)');
- }
-
- if (!$id) {
- $id = $this->getExtension('DublinCore')->getId();
- }
-
- if (empty($id)) {
- $id = $this->getExtension('Atom')->getId();
- }
-
- if (!$id) {
- if ($this->getPermalink()) {
- $id = $this->getPermalink();
- } elseif ($this->getTitle()) {
- $id = $this->getTitle();
- } else {
- $id = null;
- }
- }
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get a specific link
- *
- * @param int $index
- * @return string
- */
- public function getLink($index = 0)
- {
- if (!array_key_exists('links', $this->_data)) {
- $this->getLinks();
- }
-
- if (isset($this->_data['links'][$index])) {
- return $this->_data['links'][$index];
- }
-
- return null;
- }
-
- /**
- * Get all links
- *
- * @return array
- */
- public function getLinks()
- {
- if (array_key_exists('links', $this->_data)) {
- return $this->_data['links'];
- }
-
- $links = array();
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $list = $this->_xpath->query($this->_xpathQueryRss.'//link');
- } else {
- $list = $this->_xpath->query($this->_xpathQueryRdf.'//rss:link');
- }
-
- if (!$list->length) {
- $links = $this->getExtension('Atom')->getLinks();
- } else {
- foreach ($list as $link) {
- $links[] = $link->nodeValue;
- }
- }
-
- $this->_data['links'] = $links;
-
- return $this->_data['links'];
- }
-
- /**
- * Get all categories
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $list = $this->_xpath->query($this->_xpathQueryRss.'//category');
- } else {
- $list = $this->_xpath->query($this->_xpathQueryRdf.'//rss:category');
- }
-
- if ($list->length) {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- foreach ($list as $category) {
- $categoryCollection[] = array(
- 'term' => $category->nodeValue,
- 'scheme' => $category->getAttribute('domain'),
- 'label' => $category->nodeValue,
- );
- }
- } else {
- $categoryCollection = $this->getExtension('DublinCore')->getCategories();
- }
-
- if (count($categoryCollection) == 0) {
- $categoryCollection = $this->getExtension('Atom')->getCategories();
- }
-
- $this->_data['categories'] = $categoryCollection;
-
- return $this->_data['categories'];
- }
-
- /**
- * Get a permalink to the entry
- *
- * @return string
- */
- public function getPermalink()
- {
- return $this->getLink(0);
- }
-
- /**
- * Get the entry title
- *
- * @return string
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
- ) {
- $title = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/title)');
- } else {
- $title = $this->_xpath->evaluate('string('.$this->_xpathQueryRdf.'/rss:title)');
- }
-
- if (!$title) {
- $title = $this->getExtension('DublinCore')->getTitle();
- }
-
- if (!$title) {
- $title = $this->getExtension('Atom')->getTitle();
- }
-
- if (!$title) {
- $title = null;
- }
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- * Get the number of comments/replies for current entry
- *
- * @return string|null
- */
- public function getCommentCount()
- {
- if (array_key_exists('commentcount', $this->_data)) {
- return $this->_data['commentcount'];
- }
-
- $commentcount = $this->getExtension('Slash')->getCommentCount();
-
- if (!$commentcount) {
- $commentcount = $this->getExtension('Thread')->getCommentCount();
- }
-
- if (!$commentcount) {
- $commentcount = $this->getExtension('Atom')->getCommentCount();
- }
-
- if (!$commentcount) {
- $commentcount = null;
- }
-
- $this->_data['commentcount'] = $commentcount;
-
- return $this->_data['commentcount'];
- }
-
- /**
- * Returns a URI pointing to the HTML page where comments can be made on this entry
- *
- * @return string
- */
- public function getCommentLink()
- {
- if (array_key_exists('commentlink', $this->_data)) {
- return $this->_data['commentlink'];
- }
-
- $commentlink = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
- ) {
- $commentlink = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/comments)');
- }
-
- if (!$commentlink) {
- $commentlink = $this->getExtension('Atom')->getCommentLink();
- }
-
- if (!$commentlink) {
- $commentlink = null;
- }
-
- $this->_data['commentlink'] = $commentlink;
-
- return $this->_data['commentlink'];
- }
-
- /**
- * Returns a URI pointing to a feed of all comments for this entry
- *
- * @return string
- */
- public function getCommentFeedLink()
- {
- if (array_key_exists('commentfeedlink', $this->_data)) {
- return $this->_data['commentfeedlink'];
- }
-
- $commentfeedlink = $this->getExtension('WellFormedWeb')->getCommentFeedLink();
-
- if (!$commentfeedlink) {
- $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink('rss');
- }
-
- if (!$commentfeedlink) {
- $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink('rdf');
- }
-
- if (!$commentfeedlink) {
- $commentfeedlink = null;
- }
-
- $this->_data['commentfeedlink'] = $commentfeedlink;
-
- return $this->_data['commentfeedlink'];
- }
-
- /**
- * Set the XPath query (incl. on all Extensions)
- *
- * @param DOMXPath $xpath
- */
- public function setXpath(DOMXPath $xpath)
- {
- parent::setXpath($xpath);
- foreach ($this->_extensions as $extension) {
- $extension->setXpath($this->_xpath);
- }
- }
-}
diff --git a/library/Zend/Feed/Reader/EntryAbstract.php b/library/Zend/Feed/Reader/EntryAbstract.php
deleted file mode 100644
index b03afa4889..0000000000
--- a/library/Zend/Feed/Reader/EntryAbstract.php
+++ /dev/null
@@ -1,242 +0,0 @@
-_entry = $entry;
- $this->_entryKey = $entryKey;
- $this->_domDocument = $entry->ownerDocument;
- if ($type !== null) {
- $this->_data['type'] = $type;
- } else {
- $this->_data['type'] = Zend_Feed_Reader::detectType(
- $this->_domDocument
- );
- }
- $this->_loadExtensions();
- }
-
- /**
- * Get the DOM
- *
- * @return DOMDocument
- */
- public function getDomDocument()
- {
- return $this->_domDocument;
- }
-
- /**
- * Get the entry element
- *
- * @return DOMElement
- */
- public function getElement()
- {
- return $this->_entry;
- }
-
- /**
- * Get the Entry's encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- $assumed = $this->getDomDocument()->encoding;
- if (empty($assumed)) {
- $assumed = 'UTF-8';
- }
- return $assumed;
- }
-
- /**
- * Get entry as xml
- *
- * @return string
- */
- public function saveXml()
- {
- $dom = new DOMDocument('1.0', $this->getEncoding());
- $entry = $dom->importNode($this->getElement(), true);
- $dom->appendChild($entry);
- return $dom->saveXml();
- }
-
- /**
- * Get the entry type
- *
- * @return string
- */
- public function getType()
- {
- return $this->_data['type'];
- }
-
- /**
- * Get the XPath query object
- *
- * @return DOMXPath
- */
- public function getXpath()
- {
- if (!$this->_xpath) {
- $this->setXpath(new DOMXPath($this->getDomDocument()));
- }
- return $this->_xpath;
- }
-
- /**
- * Set the XPath query
- *
- * @param DOMXPath $xpath
- * @return Zend_Feed_Reader_Entry_EntryAbstract
- */
- public function setXpath(DOMXPath $xpath)
- {
- $this->_xpath = $xpath;
- return $this;
- }
-
- /**
- * Get registered extensions
- *
- * @return array
- */
- public function getExtensions()
- {
- return $this->_extensions;
- }
-
- /**
- * Return an Extension object with the matching name (postfixed with _Entry)
- *
- * @param string $name
- * @return Zend_Feed_Reader_Extension_EntryAbstract
- */
- public function getExtension($name)
- {
- if (array_key_exists($name . '_Entry', $this->_extensions)) {
- return $this->_extensions[$name . '_Entry'];
- }
- return null;
- }
-
- /**
- * Method overloading: call given method on first extension implementing it
- *
- * @param string $method
- * @param array $args
- * @return mixed
- * @throws Zend_Feed_Exception if no extensions implements the method
- */
- public function __call($method, $args)
- {
- foreach ($this->_extensions as $extension) {
- if (method_exists($extension, $method)) {
- return call_user_func_array(array($extension, $method), $args);
- }
- }
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception(
- 'Method: ' . $method
- . 'does not exist and could not be located on a registered Extension'
- );
- }
-
- /**
- * Load extensions from Zend_Feed_Reader
- *
- * @return void
- */
- protected function _loadExtensions()
- {
- $all = Zend_Feed_Reader::getExtensions();
- $feed = $all['entry'];
- foreach ($feed as $extension) {
- if (in_array($extension, $all['core'])) {
- continue;
- }
- $className = Zend_Feed_Reader::getPluginLoader()->getClassName($extension);
- $this->_extensions[$extension] = new $className(
- $this->getElement(), $this->_entryKey, $this->_data['type']
- );
- }
- }
-}
diff --git a/library/Zend/Feed/Reader/EntryInterface.php b/library/Zend/Feed/Reader/EntryInterface.php
deleted file mode 100644
index 2eee00aa9d..0000000000
--- a/library/Zend/Feed/Reader/EntryInterface.php
+++ /dev/null
@@ -1,143 +0,0 @@
-getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $authors = array();
- $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom:author');
-
- if (!$list->length) {
- /**
- * TODO: Limit query to feed level els only!
- */
- $list = $this->getXpath()->query('//atom:author');
- }
-
- if ($list->length) {
- foreach ($list as $author) {
- $author = $this->_getAuthor($author);
- if (!empty($author)) {
- $authors[] = $author;
- }
- }
- }
-
- if (count($authors) == 0) {
- $authors = null;
- } else {
- $authors = new Zend_Feed_Reader_Collection_Author(
- Zend_Feed_Reader::arrayUnique($authors)
- );
- }
-
- $this->_data['authors'] = $authors;
- return $this->_data['authors'];
- }
-
- /**
- * Get the entry content
- *
- * @return string
- */
- public function getContent()
- {
- if (array_key_exists('content', $this->_data)) {
- return $this->_data['content'];
- }
-
- $content = null;
-
- $el = $this->getXpath()->query($this->getXpathPrefix() . '/atom:content');
- if($el->length > 0) {
- $el = $el->item(0);
- $type = $el->getAttribute('type');
- switch ($type) {
- case '':
- case 'text':
- case 'text/plain':
- case 'html':
- case 'text/html':
- $content = $el->nodeValue;
- break;
- case 'xhtml':
- $this->getXpath()->registerNamespace('xhtml', 'http://www.w3.org/1999/xhtml');
- $xhtml = $this->getXpath()->query(
- $this->getXpathPrefix() . '/atom:content/xhtml:div'
- )->item(0);
- //$xhtml->setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
- $d = new DOMDocument('1.0', $this->getEncoding());
- $xhtmls = $d->importNode($xhtml, true);
- $d->appendChild($xhtmls);
- $content = $this->_collectXhtml(
- $d->saveXML(),
- $d->lookupPrefix('http://www.w3.org/1999/xhtml')
- );
- break;
- }
- }
-
- if (!$content) {
- $content = $this->getDescription();
- }
-
- $this->_data['content'] = trim($content);
-
- return $this->_data['content'];
- }
-
- /**
- * Parse out XHTML to remove the namespacing
- */
- protected function _collectXhtml($xhtml, $prefix)
- {
- if (!empty($prefix)) $prefix = $prefix . ':';
- $matches = array(
- "/<\?xml[^<]*>[^<]*<" . $prefix . "div[^<]*/",
- "/<\/" . $prefix . "div>\s*$/"
- );
- $xhtml = preg_replace($matches, '', $xhtml);
- if (!empty($prefix)) {
- $xhtml = preg_replace("/(<[\/]?)" . $prefix . "([a-zA-Z]+)/", '$1$2', $xhtml);
- }
- return $xhtml;
- }
-
- /**
- * Get the entry creation date
- *
- * @return string
- */
- public function getDateCreated()
- {
- if (array_key_exists('datecreated', $this->_data)) {
- return $this->_data['datecreated'];
- }
-
- $date = null;
-
- if ($this->_getAtomType() === Zend_Feed_Reader::TYPE_ATOM_03) {
- $dateCreated = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:created)');
- } else {
- $dateCreated = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:published)');
- }
-
- if ($dateCreated) {
- $date = new Zend_Date;
- $date->set($dateCreated, Zend_Date::ISO_8601);
- }
-
- $this->_data['datecreated'] = $date;
-
- return $this->_data['datecreated'];
- }
-
- /**
- * Get the entry modification date
- *
- * @return string
- */
- public function getDateModified()
- {
- if (array_key_exists('datemodified', $this->_data)) {
- return $this->_data['datemodified'];
- }
-
- $date = null;
-
- if ($this->_getAtomType() === Zend_Feed_Reader::TYPE_ATOM_03) {
- $dateModified = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:modified)');
- } else {
- $dateModified = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:updated)');
- }
-
- if ($dateModified) {
- $date = new Zend_Date;
- $date->set($dateModified, Zend_Date::ISO_8601);
- }
-
- $this->_data['datemodified'] = $date;
-
- return $this->_data['datemodified'];
- }
-
- /**
- * Get the entry description
- *
- * @return string
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:summary)');
-
- if (!$description) {
- $description = null;
- }
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the entry enclosure
- *
- * @return string
- */
- public function getEnclosure()
- {
- if (array_key_exists('enclosure', $this->_data)) {
- return $this->_data['enclosure'];
- }
-
- $enclosure = null;
-
- $nodeList = $this->getXpath()->query($this->getXpathPrefix() . '/atom:link[@rel="enclosure"]');
-
- if ($nodeList->length > 0) {
- $enclosure = new stdClass();
- $enclosure->url = $nodeList->item(0)->getAttribute('href');
- $enclosure->length = $nodeList->item(0)->getAttribute('length');
- $enclosure->type = $nodeList->item(0)->getAttribute('type');
- }
-
- $this->_data['enclosure'] = $enclosure;
-
- return $this->_data['enclosure'];
- }
-
- /**
- * Get the entry ID
- *
- * @return string
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:id)');
-
- if (!$id) {
- if ($this->getPermalink()) {
- $id = $this->getPermalink();
- } elseif ($this->getTitle()) {
- $id = $this->getTitle();
- } else {
- $id = null;
- }
- }
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get the base URI of the feed (if set).
- *
- * @return string|null
- */
- public function getBaseUrl()
- {
- if (array_key_exists('baseUrl', $this->_data)) {
- return $this->_data['baseUrl'];
- }
-
- $baseUrl = $this->getXpath()->evaluate('string('
- . $this->getXpathPrefix() . '/@xml:base[1]'
- . ')');
-
- if (!$baseUrl) {
- $baseUrl = $this->getXpath()->evaluate('string(//@xml:base[1])');
- }
-
- if (!$baseUrl) {
- $baseUrl = null;
- }
-
- $this->_data['baseUrl'] = $baseUrl;
-
- return $this->_data['baseUrl'];
- }
-
- /**
- * Get a specific link
- *
- * @param int $index
- * @return string
- */
- public function getLink($index = 0)
- {
- if (!array_key_exists('links', $this->_data)) {
- $this->getLinks();
- }
-
- if (isset($this->_data['links'][$index])) {
- return $this->_data['links'][$index];
- }
-
- return null;
- }
-
- /**
- * Get all links
- *
- * @return array
- */
- public function getLinks()
- {
- if (array_key_exists('links', $this->_data)) {
- return $this->_data['links'];
- }
-
- $links = array();
-
- $list = $this->getXpath()->query(
- $this->getXpathPrefix() . '//atom:link[@rel="alternate"]/@href' . '|' .
- $this->getXpathPrefix() . '//atom:link[not(@rel)]/@href'
- );
-
- if ($list->length) {
- foreach ($list as $link) {
- $links[] = $this->_absolutiseUri($link->value);
- }
- }
-
- $this->_data['links'] = $links;
-
- return $this->_data['links'];
- }
-
- /**
- * Get a permalink to the entry
- *
- * @return string
- */
- public function getPermalink()
- {
- return $this->getLink(0);
- }
-
- /**
- * Get the entry title
- *
- * @return string
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:title)');
-
- if (!$title) {
- $title = null;
- }
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- * Get the number of comments/replies for current entry
- *
- * @return integer
- */
- public function getCommentCount()
- {
- if (array_key_exists('commentcount', $this->_data)) {
- return $this->_data['commentcount'];
- }
-
- $count = null;
-
- $this->getXpath()->registerNamespace('thread10', 'http://purl.org/syndication/thread/1.0');
- $list = $this->getXpath()->query(
- $this->getXpathPrefix() . '//atom:link[@rel="replies"]/@thread10:count'
- );
-
- if ($list->length) {
- $count = $list->item(0)->value;
- }
-
- $this->_data['commentcount'] = $count;
-
- return $this->_data['commentcount'];
- }
-
- /**
- * Returns a URI pointing to the HTML page where comments can be made on this entry
- *
- * @return string
- */
- public function getCommentLink()
- {
- if (array_key_exists('commentlink', $this->_data)) {
- return $this->_data['commentlink'];
- }
-
- $link = null;
-
- $list = $this->getXpath()->query(
- $this->getXpathPrefix() . '//atom:link[@rel="replies" and @type="text/html"]/@href'
- );
-
- if ($list->length) {
- $link = $list->item(0)->value;
- $link = $this->_absolutiseUri($link);
- }
-
- $this->_data['commentlink'] = $link;
-
- return $this->_data['commentlink'];
- }
-
- /**
- * Returns a URI pointing to a feed of all comments for this entry
- *
- * @return string
- */
- public function getCommentFeedLink($type = 'atom')
- {
- if (array_key_exists('commentfeedlink', $this->_data)) {
- return $this->_data['commentfeedlink'];
- }
-
- $link = null;
-
- $list = $this->getXpath()->query(
- $this->getXpathPrefix() . '//atom:link[@rel="replies" and @type="application/'.$type.'+xml"]/@href'
- );
-
- if ($list->length) {
- $link = $list->item(0)->value;
- $link = $this->_absolutiseUri($link);
- }
-
- $this->_data['commentfeedlink'] = $link;
-
- return $this->_data['commentfeedlink'];
- }
-
- /**
- * Get all categories
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- if ($this->_getAtomType() == Zend_Feed_Reader::TYPE_ATOM_10) {
- $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom:category');
- } else {
- /**
- * Since Atom 0.3 did not support categories, it would have used the
- * Dublin Core extension. However there is a small possibility Atom 0.3
- * may have been retrofittied to use Atom 1.0 instead.
- */
- $this->getXpath()->registerNamespace('atom10', Zend_Feed_Reader::NAMESPACE_ATOM_10);
- $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom10:category');
- }
-
- if ($list->length) {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- foreach ($list as $category) {
- $categoryCollection[] = array(
- 'term' => $category->getAttribute('term'),
- 'scheme' => $category->getAttribute('scheme'),
- 'label' => $category->getAttribute('label')
- );
- }
- } else {
- return new Zend_Feed_Reader_Collection_Category;
- }
-
- $this->_data['categories'] = $categoryCollection;
-
- return $this->_data['categories'];
- }
-
- /**
- * Get source feed metadata from the entry
- *
- * @return Zend_Feed_Reader_Feed_Atom_Source|null
- */
- public function getSource()
- {
- if (array_key_exists('source', $this->_data)) {
- return $this->_data['source'];
- }
-
- $source = null;
- // TODO: Investigate why _getAtomType() fails here. Is it even needed?
- if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10) {
- $list = $this->getXpath()->query($this->getXpathPrefix() . '/atom:source[1]');
- if ($list->length) {
- $element = $list->item(0);
- $source = new Zend_Feed_Reader_Feed_Atom_Source($element, $this->getXpathPrefix());
- }
- }
-
- $this->_data['source'] = $source;
- return $this->_data['source'];
- }
-
- /**
- * Attempt to absolutise the URI, i.e. if a relative URI apply the
- * xml:base value as a prefix to turn into an absolute URI.
- */
- protected function _absolutiseUri($link)
- {
- if (!Zend_Uri::check($link)) {
- if ($this->getBaseUrl() !== null) {
- $link = $this->getBaseUrl() . $link;
- if (!Zend_Uri::check($link)) {
- $link = null;
- }
- }
- }
- return $link;
- }
-
- /**
- * Get an author entry
- *
- * @param DOMElement $element
- * @return string
- */
- protected function _getAuthor(DOMElement $element)
- {
- $author = array();
-
- $emailNode = $element->getElementsByTagName('email');
- $nameNode = $element->getElementsByTagName('name');
- $uriNode = $element->getElementsByTagName('uri');
-
- if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) {
- $author['email'] = $emailNode->item(0)->nodeValue;
- }
-
- if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) {
- $author['name'] = $nameNode->item(0)->nodeValue;
- }
-
- if ($uriNode->length && strlen($uriNode->item(0)->nodeValue) > 0) {
- $author['uri'] = $uriNode->item(0)->nodeValue;
- }
-
- if (empty($author)) {
- return null;
- }
- return $author;
- }
-
- /**
- * Register the default namespaces for the current feed format
- */
- protected function _registerNamespaces()
- {
- switch ($this->_getAtomType()) {
- case Zend_Feed_Reader::TYPE_ATOM_03:
- $this->getXpath()->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_03);
- break;
- default:
- $this->getXpath()->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_10);
- break;
- }
- }
-
- /**
- * Detect the presence of any Atom namespaces in use
- */
- protected function _getAtomType()
- {
- $dom = $this->getDomDocument();
- $prefixAtom03 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_03);
- $prefixAtom10 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_10);
- if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_03)
- || !empty($prefixAtom03)) {
- return Zend_Feed_Reader::TYPE_ATOM_03;
- }
- if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_10)
- || !empty($prefixAtom10)) {
- return Zend_Feed_Reader::TYPE_ATOM_10;
- }
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/Atom/Feed.php b/library/Zend/Feed/Reader/Extension/Atom/Feed.php
deleted file mode 100644
index f6ccc4eca9..0000000000
--- a/library/Zend/Feed/Reader/Extension/Atom/Feed.php
+++ /dev/null
@@ -1,590 +0,0 @@
-getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $list = $this->_xpath->query('//atom:author');
-
- $authors = array();
-
- if ($list->length) {
- foreach ($list as $author) {
- $author = $this->_getAuthor($author);
- if (!empty($author)) {
- $authors[] = $author;
- }
- }
- }
-
- if (count($authors) == 0) {
- $authors = null;
- } else {
- $authors = new Zend_Feed_Reader_Collection_Author(
- Zend_Feed_Reader::arrayUnique($authors)
- );
- }
-
- $this->_data['authors'] = $authors;
-
- return $this->_data['authors'];
- }
-
- /**
- * Get the copyright entry
- *
- * @return string|null
- */
- public function getCopyright()
- {
- if (array_key_exists('copyright', $this->_data)) {
- return $this->_data['copyright'];
- }
-
- $copyright = null;
-
- if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) {
- $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:copyright)');
- } else {
- $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:rights)');
- }
-
- if (!$copyright) {
- $copyright = null;
- }
-
- $this->_data['copyright'] = $copyright;
-
- return $this->_data['copyright'];
- }
-
- /**
- * Get the feed creation date
- *
- * @return Zend_Date|null
- */
- public function getDateCreated()
- {
- if (array_key_exists('datecreated', $this->_data)) {
- return $this->_data['datecreated'];
- }
-
- $date = null;
-
- if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) {
- $dateCreated = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:created)');
- } else {
- $dateCreated = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:published)');
- }
-
- if ($dateCreated) {
- $date = new Zend_Date;
- $date->set($dateCreated, Zend_Date::ISO_8601);
- }
-
- $this->_data['datecreated'] = $date;
-
- return $this->_data['datecreated'];
- }
-
- /**
- * Get the feed modification date
- *
- * @return Zend_Date|null
- */
- public function getDateModified()
- {
- if (array_key_exists('datemodified', $this->_data)) {
- return $this->_data['datemodified'];
- }
-
- $date = null;
-
- if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) {
- $dateModified = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:modified)');
- } else {
- $dateModified = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:updated)');
- }
-
- if ($dateModified) {
- $date = new Zend_Date;
- $date->set($dateModified, Zend_Date::ISO_8601);
- }
-
- $this->_data['datemodified'] = $date;
-
- return $this->_data['datemodified'];
- }
-
- /**
- * Get the feed description
- *
- * @return string|null
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = null;
-
- if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) {
- $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:tagline)'); // TODO: Is this the same as subtitle?
- } else {
- $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:subtitle)');
- }
-
- if (!$description) {
- $description = null;
- }
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the feed generator entry
- *
- * @return string|null
- */
- public function getGenerator()
- {
- if (array_key_exists('generator', $this->_data)) {
- return $this->_data['generator'];
- }
- // TODO: Add uri support
- $generator = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:generator)');
-
- if (!$generator) {
- $generator = null;
- }
-
- $this->_data['generator'] = $generator;
-
- return $this->_data['generator'];
- }
-
- /**
- * Get the feed ID
- *
- * @return string|null
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:id)');
-
- if (!$id) {
- if ($this->getLink()) {
- $id = $this->getLink();
- } elseif ($this->getTitle()) {
- $id = $this->getTitle();
- } else {
- $id = null;
- }
- }
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get the feed language
- *
- * @return string|null
- */
- public function getLanguage()
- {
- if (array_key_exists('language', $this->_data)) {
- return $this->_data['language'];
- }
-
- $language = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:lang)');
-
- if (!$language) {
- $language = $this->_xpath->evaluate('string(//@xml:lang[1])');
- }
-
- if (!$language) {
- $language = null;
- }
-
- $this->_data['language'] = $language;
-
- return $this->_data['language'];
- }
-
- /**
- * Get the feed image
- *
- * @return array|null
- */
- public function getImage()
- {
- if (array_key_exists('image', $this->_data)) {
- return $this->_data['image'];
- }
-
- $imageUrl = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:logo)');
-
- if (!$imageUrl) {
- $image = null;
- } else {
- $image = array('uri'=>$imageUrl);
- }
-
- $this->_data['image'] = $image;
-
- return $this->_data['image'];
- }
-
- /**
- * Get the feed image
- *
- * @return array|null
- */
- public function getIcon()
- {
- if (array_key_exists('icon', $this->_data)) {
- return $this->_data['icon'];
- }
-
- $imageUrl = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:icon)');
-
- if (!$imageUrl) {
- $image = null;
- } else {
- $image = array('uri'=>$imageUrl);
- }
-
- $this->_data['icon'] = $image;
-
- return $this->_data['icon'];
- }
-
- /**
- * Get the base URI of the feed (if set).
- *
- * @return string|null
- */
- public function getBaseUrl()
- {
- if (array_key_exists('baseUrl', $this->_data)) {
- return $this->_data['baseUrl'];
- }
-
- $baseUrl = $this->_xpath->evaluate('string(//@xml:base[1])');
-
- if (!$baseUrl) {
- $baseUrl = null;
- }
- $this->_data['baseUrl'] = $baseUrl;
-
- return $this->_data['baseUrl'];
- }
-
- /**
- * Get a link to the source website
- *
- * @return string|null
- */
- public function getLink()
- {
- if (array_key_exists('link', $this->_data)) {
- return $this->_data['link'];
- }
-
- $link = null;
-
- $list = $this->_xpath->query(
- $this->getXpathPrefix() . '/atom:link[@rel="alternate"]/@href' . '|' .
- $this->getXpathPrefix() . '/atom:link[not(@rel)]/@href'
- );
-
- if ($list->length) {
- $link = $list->item(0)->nodeValue;
- $link = $this->_absolutiseUri($link);
- }
-
- $this->_data['link'] = $link;
-
- return $this->_data['link'];
- }
-
- /**
- * Get a link to the feed's XML Url
- *
- * @return string|null
- */
- public function getFeedLink()
- {
- if (array_key_exists('feedlink', $this->_data)) {
- return $this->_data['feedlink'];
- }
-
- $link = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:link[@rel="self"]/@href)');
-
- $link = $this->_absolutiseUri($link);
-
- $this->_data['feedlink'] = $link;
-
- return $this->_data['feedlink'];
- }
-
- /**
- * Get an array of any supported Pusubhubbub endpoints
- *
- * @return array|null
- */
- public function getHubs()
- {
- if (array_key_exists('hubs', $this->_data)) {
- return $this->_data['hubs'];
- }
- $hubs = array();
-
- $list = $this->_xpath->query($this->getXpathPrefix()
- . '//atom:link[@rel="hub"]/@href');
-
- if ($list->length) {
- foreach ($list as $uri) {
- $hubs[] = $this->_absolutiseUri($uri->nodeValue);
- }
- } else {
- $hubs = null;
- }
-
- $this->_data['hubs'] = $hubs;
-
- return $this->_data['hubs'];
- }
-
- /**
- * Get the feed title
- *
- * @return string|null
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:title)');
-
- if (!$title) {
- $title = null;
- }
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- * Get all categories
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10) {
- $list = $this->_xpath->query($this->getXpathPrefix() . '/atom:category');
- } else {
- /**
- * Since Atom 0.3 did not support categories, it would have used the
- * Dublin Core extension. However there is a small possibility Atom 0.3
- * may have been retrofittied to use Atom 1.0 instead.
- */
- $this->_xpath->registerNamespace('atom10', Zend_Feed_Reader::NAMESPACE_ATOM_10);
- $list = $this->_xpath->query($this->getXpathPrefix() . '/atom10:category');
- }
-
- if ($list->length) {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- foreach ($list as $category) {
- $categoryCollection[] = array(
- 'term' => $category->getAttribute('term'),
- 'scheme' => $category->getAttribute('scheme'),
- 'label' => $category->getAttribute('label')
- );
- }
- } else {
- return new Zend_Feed_Reader_Collection_Category;
- }
-
- $this->_data['categories'] = $categoryCollection;
-
- return $this->_data['categories'];
- }
-
- /**
- * Get an author entry in RSS format
- *
- * @param DOMElement $element
- * @return string
- */
- protected function _getAuthor(DOMElement $element)
- {
- $author = array();
-
- $emailNode = $element->getElementsByTagName('email');
- $nameNode = $element->getElementsByTagName('name');
- $uriNode = $element->getElementsByTagName('uri');
-
- if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) {
- $author['email'] = $emailNode->item(0)->nodeValue;
- }
-
- if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) {
- $author['name'] = $nameNode->item(0)->nodeValue;
- }
-
- if ($uriNode->length && strlen($uriNode->item(0)->nodeValue) > 0) {
- $author['uri'] = $uriNode->item(0)->nodeValue;
- }
-
- if (empty($author)) {
- return null;
- }
- return $author;
- }
-
- /**
- * Attempt to absolutise the URI, i.e. if a relative URI apply the
- * xml:base value as a prefix to turn into an absolute URI.
- */
- protected function _absolutiseUri($link)
- {
- if (!Zend_Uri::check($link)) {
- if ($this->getBaseUrl() !== null) {
- $link = $this->getBaseUrl() . $link;
- if (!Zend_Uri::check($link)) {
- $link = null;
- }
- }
- }
- return $link;
- }
-
- /**
- * Register the default namespaces for the current feed format
- */
- protected function _registerNamespaces()
- {
- if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10
- || $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03
- ) {
- return; // pre-registered at Feed level
- }
- $atomDetected = $this->_getAtomType();
- switch ($atomDetected) {
- case Zend_Feed_Reader::TYPE_ATOM_03:
- $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_03);
- break;
- default:
- $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_10);
- break;
- }
- }
-
- /**
- * Detect the presence of any Atom namespaces in use
- */
- protected function _getAtomType()
- {
- $dom = $this->getDomDocument();
- $prefixAtom03 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_03);
- $prefixAtom10 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_10);
- if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_10)
- || !empty($prefixAtom10)) {
- return Zend_Feed_Reader::TYPE_ATOM_10;
- }
- if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_03)
- || !empty($prefixAtom03)) {
- return Zend_Feed_Reader::TYPE_ATOM_03;
- }
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/Content/Entry.php b/library/Zend/Feed/Reader/Extension/Content/Entry.php
deleted file mode 100644
index bc986d662b..0000000000
--- a/library/Zend/Feed/Reader/Extension/Content/Entry.php
+++ /dev/null
@@ -1,61 +0,0 @@
-getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
- ) {
- $content = $this->_xpath->evaluate('string('.$this->getXpathPrefix().'/content:encoded)');
- } else {
- $content = $this->_xpath->evaluate('string('.$this->getXpathPrefix().'/content:encoded)');
- }
- return $content;
- }
-
- /**
- * Register RSS Content Module namespace
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('content', 'http://purl.org/rss/1.0/modules/content/');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php b/library/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php
deleted file mode 100644
index 84a7604f6b..0000000000
--- a/library/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php
+++ /dev/null
@@ -1,97 +0,0 @@
-getLicenses();
-
- if (isset($licenses[$index])) {
- return $licenses[$index];
- }
-
- return null;
- }
-
- /**
- * Get the entry licenses
- *
- * @return array
- */
- public function getLicenses()
- {
- $name = 'licenses';
- if (array_key_exists($name, $this->_data)) {
- return $this->_data[$name];
- }
-
- $licenses = array();
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//cc:license');
-
- if ($list->length) {
- foreach ($list as $license) {
- $licenses[] = $license->nodeValue;
- }
-
- $licenses = array_unique($licenses);
- } else {
- $cc = new Zend_Feed_Reader_Extension_CreativeCommons_Feed(
- $this->_domDocument, $this->_data['type'], $this->_xpath
- );
- $licenses = $cc->getLicenses();
- }
-
- $this->_data[$name] = $licenses;
-
- return $this->_data[$name];
- }
-
- /**
- * Register Creative Commons namespaces
- *
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('cc', 'http://backend.userland.com/creativeCommonsRssModule');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php b/library/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php
deleted file mode 100644
index 69c37c8da6..0000000000
--- a/library/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php
+++ /dev/null
@@ -1,89 +0,0 @@
-getLicenses();
-
- if (isset($licenses[$index])) {
- return $licenses[$index];
- }
-
- return null;
- }
-
- /**
- * Get the entry licenses
- *
- * @return array
- */
- public function getLicenses()
- {
- $name = 'licenses';
- if (array_key_exists($name, $this->_data)) {
- return $this->_data[$name];
- }
-
- $licenses = array();
- $list = $this->_xpath->evaluate('channel/cc:license');
-
- if ($list->length) {
- foreach ($list as $license) {
- $licenses[] = $license->nodeValue;
- }
-
- $licenses = array_unique($licenses);
- }
-
- $this->_data[$name] = $licenses;
-
- return $this->_data[$name];
- }
-
- /**
- * Register Creative Commons namespaces
- *
- * @return void
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('cc', 'http://backend.userland.com/creativeCommonsRssModule');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/DublinCore/Entry.php b/library/Zend/Feed/Reader/Extension/DublinCore/Entry.php
deleted file mode 100644
index 4c83aebf6d..0000000000
--- a/library/Zend/Feed/Reader/Extension/DublinCore/Entry.php
+++ /dev/null
@@ -1,266 +0,0 @@
-getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $authors = array();
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:creator');
-
- if (!$list->length) {
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:creator');
- }
- if (!$list->length) {
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:publisher');
-
- if (!$list->length) {
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:publisher');
- }
- }
-
- if ($list->length) {
- foreach ($list as $author) {
- $authors[] = array(
- 'name' => $author->nodeValue
- );
- }
- $authors = new Zend_Feed_Reader_Collection_Author(
- Zend_Feed_Reader::arrayUnique($authors)
- );
- } else {
- $authors = null;
- }
-
- $this->_data['authors'] = $authors;
-
- return $this->_data['authors'];
- }
-
- /**
- * Get categories (subjects under DC)
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:subject');
-
- if (!$list->length) {
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:subject');
- }
-
- if ($list->length) {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- foreach ($list as $category) {
- $categoryCollection[] = array(
- 'term' => $category->nodeValue,
- 'scheme' => null,
- 'label' => $category->nodeValue,
- );
- }
- } else {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- }
-
- $this->_data['categories'] = $categoryCollection;
- return $this->_data['categories'];
- }
-
-
- /**
- * Get the entry content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->getDescription();
- }
-
- /**
- * Get the entry description
- *
- * @return string
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = null;
- $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)');
-
- if (!$description) {
- $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)');
- }
-
- if (!$description) {
- $description = null;
- }
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the entry ID
- *
- * @return string
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = null;
- $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)');
-
- if (!$id) {
- $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)');
- }
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get the entry title
- *
- * @return string
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = null;
- $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)');
-
- if (!$title) {
- $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)');
- }
-
- if (!$title) {
- $title = null;
- }
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- *
- *
- * @return Zend_Date|null
- */
- public function getDate()
- {
- if (array_key_exists('date', $this->_data)) {
- return $this->_data['date'];
- }
-
- $d = null;
- $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)');
-
- if (!$date) {
- $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)');
- }
-
- if ($date) {
- $d = new Zend_Date;
- $d->set($date, Zend_Date::ISO_8601);
- }
-
- $this->_data['date'] = $d;
-
- return $this->_data['date'];
- }
-
- /**
- * Register DC namespaces
- *
- * @return void
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/');
- $this->_xpath->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/DublinCore/Feed.php b/library/Zend/Feed/Reader/Extension/DublinCore/Feed.php
deleted file mode 100644
index 516c58c78d..0000000000
--- a/library/Zend/Feed/Reader/Extension/DublinCore/Feed.php
+++ /dev/null
@@ -1,309 +0,0 @@
-getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $authors = array();
- $list = $this->_xpath->query('//dc11:creator');
-
- if (!$list->length) {
- $list = $this->_xpath->query('//dc10:creator');
- }
- if (!$list->length) {
- $list = $this->_xpath->query('//dc11:publisher');
-
- if (!$list->length) {
- $list = $this->_xpath->query('//dc10:publisher');
- }
- }
-
- if ($list->length) {
- foreach ($list as $author) {
- $authors[] = array(
- 'name' => $author->nodeValue
- );
- }
- $authors = new Zend_Feed_Reader_Collection_Author(
- Zend_Feed_Reader::arrayUnique($authors)
- );
- } else {
- $authors = null;
- }
-
- $this->_data['authors'] = $authors;
-
- return $this->_data['authors'];
- }
-
- /**
- * Get the copyright entry
- *
- * @return string|null
- */
- public function getCopyright()
- {
- if (array_key_exists('copyright', $this->_data)) {
- return $this->_data['copyright'];
- }
-
- $copyright = null;
- $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:rights)');
-
- if (!$copyright) {
- $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:rights)');
- }
-
- if (!$copyright) {
- $copyright = null;
- }
-
- $this->_data['copyright'] = $copyright;
-
- return $this->_data['copyright'];
- }
-
- /**
- * Get the feed description
- *
- * @return string|null
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = null;
- $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)');
-
- if (!$description) {
- $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)');
- }
-
- if (!$description) {
- $description = null;
- }
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the feed ID
- *
- * @return string|null
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = null;
- $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)');
-
- if (!$id) {
- $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)');
- }
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get the feed language
- *
- * @return string|null
- */
- public function getLanguage()
- {
- if (array_key_exists('language', $this->_data)) {
- return $this->_data['language'];
- }
-
- $language = null;
- $language = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:language)');
-
- if (!$language) {
- $language = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:language)');
- }
-
- if (!$language) {
- $language = null;
- }
-
- $this->_data['language'] = $language;
-
- return $this->_data['language'];
- }
-
- /**
- * Get the feed title
- *
- * @return string|null
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = null;
- $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)');
-
- if (!$title) {
- $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)');
- }
-
- if (!$title) {
- $title = null;
- }
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- *
- *
- * @return Zend_Date|null
- */
- public function getDate()
- {
- if (array_key_exists('date', $this->_data)) {
- return $this->_data['date'];
- }
-
- $d = null;
- $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)');
-
- if (!$date) {
- $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)');
- }
-
- if ($date) {
- $d = new Zend_Date;
- $d->set($date, Zend_Date::ISO_8601);
- }
-
- $this->_data['date'] = $d;
-
- return $this->_data['date'];
- }
-
- /**
- * Get categories (subjects under DC)
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:subject');
-
- if (!$list->length) {
- $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:subject');
- }
-
- if ($list->length) {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- foreach ($list as $category) {
- $categoryCollection[] = array(
- 'term' => $category->nodeValue,
- 'scheme' => null,
- 'label' => $category->nodeValue,
- );
- }
- } else {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- }
-
- $this->_data['categories'] = $categoryCollection;
- return $this->_data['categories'];
- }
-
- /**
- * Register the default namespaces for the current feed format
- *
- * @return void
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/');
- $this->_xpath->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/EntryAbstract.php b/library/Zend/Feed/Reader/Extension/EntryAbstract.php
deleted file mode 100644
index 6b1cda6235..0000000000
--- a/library/Zend/Feed/Reader/Extension/EntryAbstract.php
+++ /dev/null
@@ -1,200 +0,0 @@
-_entry = $entry;
- $this->_entryKey = $entryKey;
- $this->_domDocument = $entry->ownerDocument;
-
- if ($type !== null) {
- $this->_data['type'] = $type;
- } else {
- $this->_data['type'] = Zend_Feed_Reader::detectType($entry->ownerDocument, true);
- }
- // set the XPath query prefix for the entry being queried
- if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_10
- || $this->getType() == Zend_Feed_Reader::TYPE_RSS_090
- ) {
- $this->setXpathPrefix('//rss:item[' . ($this->_entryKey+1) . ']');
- } elseif ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10
- || $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03
- ) {
- $this->setXpathPrefix('//atom:entry[' . ($this->_entryKey+1) . ']');
- } else {
- $this->setXpathPrefix('//item[' . ($this->_entryKey+1) . ']');
- }
- }
-
- /**
- * Get the DOM
- *
- * @return DOMDocument
- */
- public function getDomDocument()
- {
- return $this->_domDocument;
- }
-
- /**
- * Get the Entry's encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- $assumed = $this->getDomDocument()->encoding;
- return $assumed;
- }
-
- /**
- * Get the entry type
- *
- * @return string
- */
- public function getType()
- {
- return $this->_data['type'];
- }
-
- /**
- * Set the XPath query
- *
- * @param DOMXPath $xpath
- * @return Zend_Feed_Reader_Extension_EntryAbstract
- */
- public function setXpath(DOMXPath $xpath)
- {
- $this->_xpath = $xpath;
- $this->_registerNamespaces();
- return $this;
- }
-
- /**
- * Get the XPath query object
- *
- * @return DOMXPath
- */
- public function getXpath()
- {
- if (!$this->_xpath) {
- $this->setXpath(new DOMXPath($this->getDomDocument()));
- }
- return $this->_xpath;
- }
-
- /**
- * Serialize the entry to an array
- *
- * @return array
- */
- public function toArray()
- {
- return $this->_data;
- }
-
- /**
- * Get the XPath prefix
- *
- * @return string
- */
- public function getXpathPrefix()
- {
- return $this->_xpathPrefix;
- }
-
- /**
- * Set the XPath prefix
- *
- * @param string $prefix
- * @return Zend_Feed_Reader_Extension_EntryAbstract
- */
- public function setXpathPrefix($prefix)
- {
- $this->_xpathPrefix = $prefix;
- return $this;
- }
-
- /**
- * Register XML namespaces
- *
- * @return void
- */
- protected abstract function _registerNamespaces();
-}
diff --git a/library/Zend/Feed/Reader/Extension/FeedAbstract.php b/library/Zend/Feed/Reader/Extension/FeedAbstract.php
deleted file mode 100644
index dcf7755f57..0000000000
--- a/library/Zend/Feed/Reader/Extension/FeedAbstract.php
+++ /dev/null
@@ -1,189 +0,0 @@
-_domDocument = $dom;
-
- if ($type !== null) {
- $this->_data['type'] = $type;
- } else {
- $this->_data['type'] = Zend_Feed_Reader::detectType($dom);
- }
-
- if ($xpath !== null) {
- $this->_xpath = $xpath;
- } else {
- $this->_xpath = new DOMXPath($this->_domDocument);
- }
-
- $this->_registerNamespaces();
- }
-
- /**
- * Get the DOM
- *
- * @return DOMDocument
- */
- public function getDomDocument()
- {
- return $this->_domDocument;
- }
-
- /**
- * Get the Feed's encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- $assumed = $this->getDomDocument()->encoding;
- return $assumed;
- }
-
- /**
- * Get the feed type
- *
- * @return string
- */
- public function getType()
- {
- return $this->_data['type'];
- }
-
-
- /**
- * Return the feed as an array
- *
- * @return array
- */
- public function toArray() // untested
- {
- return $this->_data;
- }
-
- /**
- * Set the XPath query
- *
- * @param DOMXPath $xpath
- * @return Zend_Feed_Reader_Extension_EntryAbstract
- */
- public function setXpath(DOMXPath $xpath)
- {
- $this->_xpath = $xpath;
- $this->_registerNamespaces();
- return $this;
- }
-
- /**
- * Get the DOMXPath object
- *
- * @return string
- */
- public function getXpath()
- {
- return $this->_xpath;
- }
-
- /**
- * Get the XPath prefix
- *
- * @return string
- */
- public function getXpathPrefix()
- {
- return $this->_xpathPrefix;
- }
-
- /**
- * Set the XPath prefix
- *
- * @return Zend_Feed_Reader_Feed_Atom
- */
- public function setXpathPrefix($prefix)
- {
- $this->_xpathPrefix = $prefix;
- }
-
- /**
- * Register the default namespaces for the current feed format
- */
- abstract protected function _registerNamespaces();
-}
diff --git a/library/Zend/Feed/Reader/Extension/Podcast/Entry.php b/library/Zend/Feed/Reader/Extension/Podcast/Entry.php
deleted file mode 100644
index 158ccf60aa..0000000000
--- a/library/Zend/Feed/Reader/Extension/Podcast/Entry.php
+++ /dev/null
@@ -1,202 +0,0 @@
-_data['author'])) {
- return $this->_data['author'];
- }
-
- $author = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)');
-
- if (!$author) {
- $author = null;
- }
-
- $this->_data['author'] = $author;
-
- return $this->_data['author'];
- }
-
- /**
- * Get the entry block
- *
- * @return string
- */
- public function getBlock()
- {
- if (isset($this->_data['block'])) {
- return $this->_data['block'];
- }
-
- $block = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)');
-
- if (!$block) {
- $block = null;
- }
-
- $this->_data['block'] = $block;
-
- return $this->_data['block'];
- }
-
- /**
- * Get the entry duration
- *
- * @return string
- */
- public function getDuration()
- {
- if (isset($this->_data['duration'])) {
- return $this->_data['duration'];
- }
-
- $duration = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:duration)');
-
- if (!$duration) {
- $duration = null;
- }
-
- $this->_data['duration'] = $duration;
-
- return $this->_data['duration'];
- }
-
- /**
- * Get the entry explicit
- *
- * @return string
- */
- public function getExplicit()
- {
- if (isset($this->_data['explicit'])) {
- return $this->_data['explicit'];
- }
-
- $explicit = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)');
-
- if (!$explicit) {
- $explicit = null;
- }
-
- $this->_data['explicit'] = $explicit;
-
- return $this->_data['explicit'];
- }
-
- /**
- * Get the entry keywords
- *
- * @return string
- */
- public function getKeywords()
- {
- if (isset($this->_data['keywords'])) {
- return $this->_data['keywords'];
- }
-
- $keywords = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)');
-
- if (!$keywords) {
- $keywords = null;
- }
-
- $this->_data['keywords'] = $keywords;
-
- return $this->_data['keywords'];
- }
-
- /**
- * Get the entry subtitle
- *
- * @return string
- */
- public function getSubtitle()
- {
- if (isset($this->_data['subtitle'])) {
- return $this->_data['subtitle'];
- }
-
- $subtitle = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)');
-
- if (!$subtitle) {
- $subtitle = null;
- }
-
- $this->_data['subtitle'] = $subtitle;
-
- return $this->_data['subtitle'];
- }
-
- /**
- * Get the entry summary
- *
- * @return string
- */
- public function getSummary()
- {
- if (isset($this->_data['summary'])) {
- return $this->_data['summary'];
- }
-
- $summary = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)');
-
- if (!$summary) {
- $summary = null;
- }
-
- $this->_data['summary'] = $summary;
-
- return $this->_data['summary'];
- }
-
- /**
- * Register iTunes namespace
- *
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/Podcast/Feed.php b/library/Zend/Feed/Reader/Extension/Podcast/Feed.php
deleted file mode 100644
index 2510f41bdf..0000000000
--- a/library/Zend/Feed/Reader/Extension/Podcast/Feed.php
+++ /dev/null
@@ -1,293 +0,0 @@
-_data['author'])) {
- return $this->_data['author'];
- }
-
- $author = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)');
-
- if (!$author) {
- $author = null;
- }
-
- $this->_data['author'] = $author;
-
- return $this->_data['author'];
- }
-
- /**
- * Get the entry block
- *
- * @return string
- */
- public function getBlock()
- {
- if (isset($this->_data['block'])) {
- return $this->_data['block'];
- }
-
- $block = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)');
-
- if (!$block) {
- $block = null;
- }
-
- $this->_data['block'] = $block;
-
- return $this->_data['block'];
- }
-
- /**
- * Get the entry category
- *
- * @return string
- */
- public function getCategories()
- {
- if (isset($this->_data['categories'])) {
- return $this->_data['categories'];
- }
-
- $categoryList = $this->_xpath->query($this->getXpathPrefix() . '/itunes:category');
-
- $categories = array();
-
- if ($categoryList->length > 0) {
- foreach ($categoryList as $node) {
- $children = null;
-
- if ($node->childNodes->length > 0) {
- $children = array();
-
- foreach ($node->childNodes as $childNode) {
- if (!($childNode instanceof DOMText)) {
- $children[$childNode->getAttribute('text')] = null;
- }
- }
- }
-
- $categories[$node->getAttribute('text')] = $children;
- }
- }
-
-
- if (!$categories) {
- $categories = null;
- }
-
- $this->_data['categories'] = $categories;
-
- return $this->_data['categories'];
- }
-
- /**
- * Get the entry explicit
- *
- * @return string
- */
- public function getExplicit()
- {
- if (isset($this->_data['explicit'])) {
- return $this->_data['explicit'];
- }
-
- $explicit = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)');
-
- if (!$explicit) {
- $explicit = null;
- }
-
- $this->_data['explicit'] = $explicit;
-
- return $this->_data['explicit'];
- }
-
- /**
- * Get the entry image
- *
- * @return string
- */
- public function getImage()
- {
- if (isset($this->_data['image'])) {
- return $this->_data['image'];
- }
-
- $image = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:image/@href)');
-
- if (!$image) {
- $image = null;
- }
-
- $this->_data['image'] = $image;
-
- return $this->_data['image'];
- }
-
- /**
- * Get the entry keywords
- *
- * @return string
- */
- public function getKeywords()
- {
- if (isset($this->_data['keywords'])) {
- return $this->_data['keywords'];
- }
-
- $keywords = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)');
-
- if (!$keywords) {
- $keywords = null;
- }
-
- $this->_data['keywords'] = $keywords;
-
- return $this->_data['keywords'];
- }
-
- /**
- * Get the entry's new feed url
- *
- * @return string
- */
- public function getNewFeedUrl()
- {
- if (isset($this->_data['new-feed-url'])) {
- return $this->_data['new-feed-url'];
- }
-
- $newFeedUrl = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:new-feed-url)');
-
- if (!$newFeedUrl) {
- $newFeedUrl = null;
- }
-
- $this->_data['new-feed-url'] = $newFeedUrl;
-
- return $this->_data['new-feed-url'];
- }
-
- /**
- * Get the entry owner
- *
- * @return string
- */
- public function getOwner()
- {
- if (isset($this->_data['owner'])) {
- return $this->_data['owner'];
- }
-
- $owner = null;
-
- $email = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:owner/itunes:email)');
- $name = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:owner/itunes:name)');
-
- if (!empty($email)) {
- $owner = $email . (empty($name) ? '' : ' (' . $name . ')');
- } else if (!empty($name)) {
- $owner = $name;
- }
-
- if (!$owner) {
- $owner = null;
- }
-
- $this->_data['owner'] = $owner;
-
- return $this->_data['owner'];
- }
-
- /**
- * Get the entry subtitle
- *
- * @return string
- */
- public function getSubtitle()
- {
- if (isset($this->_data['subtitle'])) {
- return $this->_data['subtitle'];
- }
-
- $subtitle = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)');
-
- if (!$subtitle) {
- $subtitle = null;
- }
-
- $this->_data['subtitle'] = $subtitle;
-
- return $this->_data['subtitle'];
- }
-
- /**
- * Get the entry summary
- *
- * @return string
- */
- public function getSummary()
- {
- if (isset($this->_data['summary'])) {
- return $this->_data['summary'];
- }
-
- $summary = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)');
-
- if (!$summary) {
- $summary = null;
- }
-
- $this->_data['summary'] = $summary;
-
- return $this->_data['summary'];
- }
-
- /**
- * Register iTunes namespace
- *
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/Slash/Entry.php b/library/Zend/Feed/Reader/Extension/Slash/Entry.php
deleted file mode 100644
index ee5c0833dc..0000000000
--- a/library/Zend/Feed/Reader/Extension/Slash/Entry.php
+++ /dev/null
@@ -1,144 +0,0 @@
-_getData('section');
- }
-
- /**
- * Get the entry department
- *
- * @return string|null
- */
- public function getDepartment()
- {
- return $this->_getData('department');
- }
-
- /**
- * Get the entry hit_parade
- *
- * @return array
- */
- public function getHitParade()
- {
- $name = 'hit_parade';
-
- if (isset($this->_data[$name])) {
- return $this->_data[$name];
- }
-
- $stringParade = $this->_getData($name);
- $hitParade = array();
-
- if (!empty($stringParade)) {
- $stringParade = explode(',', $stringParade);
-
- foreach ($stringParade as $hit)
- $hitParade[] = $hit + 0; //cast to integer
- }
-
- $this->_data[$name] = $hitParade;
- return $hitParade;
- }
-
- /**
- * Get the entry comments
- *
- * @return int
- */
- public function getCommentCount()
- {
- $name = 'comments';
-
- if (isset($this->_data[$name])) {
- return $this->_data[$name];
- }
-
- $comments = $this->_getData($name, 'string');
-
- if (!$comments) {
- $this->_data[$name] = null;
- return $this->_data[$name];
- }
-
- return $comments;
- }
-
- /**
- * Get the entry data specified by name
- * @param string $name
- * @param string $type
- *
- * @return mixed|null
- */
- protected function _getData($name, $type = 'string')
- {
- if (array_key_exists($name, $this->_data)) {
- return $this->_data[$name];
- }
-
- $data = $this->_xpath->evaluate($type . '(' . $this->getXpathPrefix() . '/slash10:' . $name . ')');
-
- if (!$data) {
- $data = null;
- }
-
- $this->_data[$name] = $data;
-
- return $data;
- }
-
- /**
- * Register Slash namespaces
- *
- * @return void
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('slash10', 'http://purl.org/rss/1.0/modules/slash/');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/Syndication/Feed.php b/library/Zend/Feed/Reader/Extension/Syndication/Feed.php
deleted file mode 100644
index c7684a1e4e..0000000000
--- a/library/Zend/Feed/Reader/Extension/Syndication/Feed.php
+++ /dev/null
@@ -1,168 +0,0 @@
-_getData($name);
-
- if ($period === null) {
- $this->_data[$name] = 'daily';
- return 'daily'; //Default specified by spec
- }
-
- switch ($period)
- {
- case 'hourly':
- case 'daily':
- case 'weekly':
- case 'yearly':
- return $period;
- default:
- throw new Zend_Feed_Exception("Feed specified invalid update period: '$period'."
- . " Must be one of hourly, daily, weekly or yearly"
- );
- }
- }
-
- /**
- * Get update frequency
- * @return int
- */
- public function getUpdateFrequency()
- {
- $name = 'updateFrequency';
- $freq = $this->_getData($name, 'number');
-
- if (!$freq || $freq < 1) {
- $this->_data[$name] = 1;
- return 1;
- }
-
- return $freq;
- }
-
- /**
- * Get update frequency as ticks
- * @return int
- */
- public function getUpdateFrequencyAsTicks()
- {
- $name = 'updateFrequency';
- $freq = $this->_getData($name, 'number');
-
- if (!$freq || $freq < 1) {
- $this->_data[$name] = 1;
- $freq = 1;
- }
-
- $period = $this->getUpdatePeriod();
- $ticks = 1;
-
- switch ($period)
- {
- //intentional fall through
- case 'yearly':
- $ticks *= 52; //TODO: fix generalisation, how?
- case 'weekly':
- $ticks *= 7;
- case 'daily':
- $ticks *= 24;
- case 'hourly':
- $ticks *= 3600;
- break;
- default: //Never arrive here, exception thrown in getPeriod()
- break;
- }
-
- return $ticks / $freq;
- }
-
- /**
- * Get update base
- *
- * @return Zend_Date|null
- */
- public function getUpdateBase()
- {
- $updateBase = $this->_getData('updateBase');
- $date = null;
- if ($updateBase) {
- $date = new Zend_Date;
- $date->set($updateBase, Zend_Date::W3C);
- }
- return $date;
- }
-
- /**
- * Get the entry data specified by name
- *
- * @param string $name
- * @param string $type
- * @return mixed|null
- */
- private function _getData($name, $type = 'string')
- {
- if (array_key_exists($name, $this->_data)) {
- return $this->_data[$name];
- }
-
- $data = $this->_xpath->evaluate($type . '(' . $this->getXpathPrefix() . '/syn10:' . $name . ')');
-
- if (!$data) {
- $data = null;
- }
-
- $this->_data[$name] = $data;
-
- return $data;
- }
-
- /**
- * Register Syndication namespaces
- *
- * @return void
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('syn10', 'http://purl.org/rss/1.0/modules/syndication/');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/Thread/Entry.php b/library/Zend/Feed/Reader/Extension/Thread/Entry.php
deleted file mode 100644
index 0c5dfcbdf6..0000000000
--- a/library/Zend/Feed/Reader/Extension/Thread/Entry.php
+++ /dev/null
@@ -1,91 +0,0 @@
-_getData('total');
- }
-
- /**
- * Get the entry data specified by name
- *
- * @param string $name
- * @param string $type
- * @return mixed|null
- */
- protected function _getData($name)
- {
- if (array_key_exists($name, $this->_data)) {
- return $this->_data[$name];
- }
-
- $data = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/thread10:' . $name . ')');
-
- if (!$data) {
- $data = null;
- }
-
- $this->_data[$name] = $data;
-
- return $data;
- }
-
- /**
- * Register Atom Thread Extension 1.0 namespace
- *
- * @return void
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('thread10', 'http://purl.org/syndication/thread/1.0');
- }
-}
diff --git a/library/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php b/library/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php
deleted file mode 100644
index 9ff3688ba0..0000000000
--- a/library/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php
+++ /dev/null
@@ -1,73 +0,0 @@
-_data)) {
- return $this->_data[$name];
- }
-
- $data = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/wfw:' . $name . ')');
-
- if (!$data) {
- $data = null;
- }
-
- $this->_data[$name] = $data;
-
- return $data;
- }
-
- /**
- * Register Slash namespaces
- *
- * @return void
- */
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('wfw', 'http://wellformedweb.org/CommentAPI/');
- }
-}
diff --git a/library/Zend/Feed/Reader/Feed/Atom.php b/library/Zend/Feed/Reader/Feed/Atom.php
deleted file mode 100644
index 798d05812a..0000000000
--- a/library/Zend/Feed/Reader/Feed/Atom.php
+++ /dev/null
@@ -1,421 +0,0 @@
-getClassName('Atom_Feed');
- $this->_extensions['Atom_Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath);
- $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Feed');
- $this->_extensions['DublinCore_Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath);
- foreach ($this->_extensions as $extension) {
- $extension->setXpathPrefix('/atom:feed');
- }
- }
-
- /**
- * Get a single author
- *
- * @param int $index
- * @return string|null
- */
- public function getAuthor($index = 0)
- {
- $authors = $this->getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $authors = $this->getExtension('Atom')->getAuthors();
-
- $this->_data['authors'] = $authors;
-
- return $this->_data['authors'];
- }
-
- /**
- * Get the copyright entry
- *
- * @return string|null
- */
- public function getCopyright()
- {
- if (array_key_exists('copyright', $this->_data)) {
- return $this->_data['copyright'];
- }
-
- $copyright = $this->getExtension('Atom')->getCopyright();
-
- if (!$copyright) {
- $copyright = null;
- }
-
- $this->_data['copyright'] = $copyright;
-
- return $this->_data['copyright'];
- }
-
- /**
- * Get the feed creation date
- *
- * @return string|null
- */
- public function getDateCreated()
- {
- if (array_key_exists('datecreated', $this->_data)) {
- return $this->_data['datecreated'];
- }
-
- $dateCreated = $this->getExtension('Atom')->getDateCreated();
-
- if (!$dateCreated) {
- $dateCreated = null;
- }
-
- $this->_data['datecreated'] = $dateCreated;
-
- return $this->_data['datecreated'];
- }
-
- /**
- * Get the feed modification date
- *
- * @return string|null
- */
- public function getDateModified()
- {
- if (array_key_exists('datemodified', $this->_data)) {
- return $this->_data['datemodified'];
- }
-
- $dateModified = $this->getExtension('Atom')->getDateModified();
-
- if (!$dateModified) {
- $dateModified = null;
- }
-
- $this->_data['datemodified'] = $dateModified;
-
- return $this->_data['datemodified'];
- }
-
- /**
- * Get the feed lastBuild date. This is not implemented in Atom.
- *
- * @return string|null
- */
- public function getLastBuildDate()
- {
- return null;
- }
-
- /**
- * Get the feed description
- *
- * @return string|null
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = $this->getExtension('Atom')->getDescription();
-
- if (!$description) {
- $description = null;
- }
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the feed generator entry
- *
- * @return string|null
- */
- public function getGenerator()
- {
- if (array_key_exists('generator', $this->_data)) {
- return $this->_data['generator'];
- }
-
- $generator = $this->getExtension('Atom')->getGenerator();
-
- $this->_data['generator'] = $generator;
-
- return $this->_data['generator'];
- }
-
- /**
- * Get the feed ID
- *
- * @return string|null
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = $this->getExtension('Atom')->getId();
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get the feed language
- *
- * @return string|null
- */
- public function getLanguage()
- {
- if (array_key_exists('language', $this->_data)) {
- return $this->_data['language'];
- }
-
- $language = $this->getExtension('Atom')->getLanguage();
-
- if (!$language) {
- $language = $this->_xpath->evaluate('string(//@xml:lang[1])');
- }
-
- if (!$language) {
- $language = null;
- }
-
- $this->_data['language'] = $language;
-
- return $this->_data['language'];
- }
-
- /**
- * Get a link to the source website
- *
- * @return string|null
- */
- public function getBaseUrl()
- {
- if (array_key_exists('baseUrl', $this->_data)) {
- return $this->_data['baseUrl'];
- }
-
- $baseUrl = $this->getExtension('Atom')->getBaseUrl();
-
- $this->_data['baseUrl'] = $baseUrl;
-
- return $this->_data['baseUrl'];
- }
-
- /**
- * Get a link to the source website
- *
- * @return string|null
- */
- public function getLink()
- {
- if (array_key_exists('link', $this->_data)) {
- return $this->_data['link'];
- }
-
- $link = $this->getExtension('Atom')->getLink();
-
- $this->_data['link'] = $link;
-
- return $this->_data['link'];
- }
-
- /**
- * Get feed image data
- *
- * @return array|null
- */
- public function getImage()
- {
- if (array_key_exists('image', $this->_data)) {
- return $this->_data['image'];
- }
-
- $link = $this->getExtension('Atom')->getImage();
-
- $this->_data['image'] = $link;
-
- return $this->_data['image'];
- }
-
- /**
- * Get a link to the feed's XML Url
- *
- * @return string|null
- */
- public function getFeedLink()
- {
- if (array_key_exists('feedlink', $this->_data)) {
- return $this->_data['feedlink'];
- }
-
- $link = $this->getExtension('Atom')->getFeedLink();
-
- if ($link === null || empty($link)) {
- $link = $this->getOriginalSourceUri();
- }
-
- $this->_data['feedlink'] = $link;
-
- return $this->_data['feedlink'];
- }
-
- /**
- * Get the feed title
- *
- * @return string|null
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = $this->getExtension('Atom')->getTitle();
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- * Get an array of any supported Pusubhubbub endpoints
- *
- * @return array|null
- */
- public function getHubs()
- {
- if (array_key_exists('hubs', $this->_data)) {
- return $this->_data['hubs'];
- }
-
- $hubs = $this->getExtension('Atom')->getHubs();
-
- $this->_data['hubs'] = $hubs;
-
- return $this->_data['hubs'];
- }
-
- /**
- * Get all categories
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- $categoryCollection = $this->getExtension('Atom')->getCategories();
-
- if (count($categoryCollection) == 0) {
- $categoryCollection = $this->getExtension('DublinCore')->getCategories();
- }
-
- $this->_data['categories'] = $categoryCollection;
-
- return $this->_data['categories'];
- }
-
- /**
- * Read all entries to the internal entries array
- *
- * @return void
- */
- protected function _indexEntries()
- {
- if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10 ||
- $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03) {
- $entries = array();
- $entries = $this->_xpath->evaluate('//atom:entry');
-
- foreach($entries as $index=>$entry) {
- $this->_entries[$index] = $entry;
- }
- }
- }
-
- /**
- * Register the default namespaces for the current feed format
- *
- */
- protected function _registerNamespaces()
- {
- switch ($this->_data['type']) {
- case Zend_Feed_Reader::TYPE_ATOM_03:
- $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_03);
- break;
- case Zend_Feed_Reader::TYPE_ATOM_10:
- default:
- $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_10);
- }
- }
-}
diff --git a/library/Zend/Feed/Reader/Feed/Atom/Source.php b/library/Zend/Feed/Reader/Feed/Atom/Source.php
deleted file mode 100644
index 88bf888cb8..0000000000
--- a/library/Zend/Feed/Reader/Feed/Atom/Source.php
+++ /dev/null
@@ -1,102 +0,0 @@
-_domDocument = $source->ownerDocument;
- $this->_xpath = new DOMXPath($this->_domDocument);
- $this->_data['type'] = $type;
- $this->_registerNamespaces();
- $this->_loadExtensions();
-
- $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Feed');
- $this->_extensions['Atom_Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath);
- $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Feed');
- $this->_extensions['DublinCore_Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath);
- foreach ($this->_extensions as $extension) {
- $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source');
- }
- }
-
- /**
- * Since this is not an Entry carrier but a vehicle for Feed metadata, any
- * applicable Entry methods are stubbed out and do nothing.
- */
-
- /**
- * @return void
- */
- public function count() {}
-
- /**
- * @return void
- */
- public function current() {}
-
- /**
- * @return void
- */
- public function key() {}
-
- /**
- * @return void
- */
- public function next() {}
-
- /**
- * @return void
- */
- public function rewind() {}
-
- /**
- * @return void
- */
- public function valid() {}
-
- /**
- * @return void
- */
- protected function _indexEntries() {}
-
-}
diff --git a/library/Zend/Feed/Reader/Feed/Rss.php b/library/Zend/Feed/Reader/Feed/Rss.php
deleted file mode 100644
index 35a570f277..0000000000
--- a/library/Zend/Feed/Reader/Feed/Rss.php
+++ /dev/null
@@ -1,733 +0,0 @@
-getClassName('DublinCore_Feed');
- $this->_extensions['DublinCore_Feed'] = new $dublinCoreClass($dom, $this->_data['type'], $this->_xpath);
- $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Feed');
- $this->_extensions['Atom_Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath);
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $xpathPrefix = '/rss/channel';
- } else {
- $xpathPrefix = '/rdf:RDF/rss:channel';
- }
- foreach ($this->_extensions as $extension) {
- $extension->setXpathPrefix($xpathPrefix);
- }
- }
-
- /**
- * Get a single author
- *
- * @param int $index
- * @return string|null
- */
- public function getAuthor($index = 0)
- {
- $authors = $this->getAuthors();
-
- if (isset($authors[$index])) {
- return $authors[$index];
- }
-
- return null;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (array_key_exists('authors', $this->_data)) {
- return $this->_data['authors'];
- }
-
- $authors = array();
- $authors_dc = $this->getExtension('DublinCore')->getAuthors();
- if (!empty($authors_dc)) {
- foreach ($authors_dc as $author) {
- $authors[] = array(
- 'name' => $author['name']
- );
- }
- }
-
- /**
- * Technically RSS doesn't specific author element use at the feed level
- * but it's supported on a "just in case" basis.
- */
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
- && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $list = $this->_xpath->query('//author');
- } else {
- $list = $this->_xpath->query('//rss:author');
- }
- if ($list->length) {
- foreach ($list as $author) {
- $string = trim($author->nodeValue);
- $email = null;
- $name = null;
- $data = array();
- // Pretty rough parsing - but it's a catchall
- if (preg_match("/^.*@[^ ]*/", $string, $matches)) {
- $data['email'] = trim($matches[0]);
- if (preg_match("/\((.*)\)$/", $string, $matches)) {
- $data['name'] = $matches[1];
- }
- $authors[] = $data;
- }
- }
- }
-
- if (count($authors) == 0) {
- $authors = $this->getExtension('Atom')->getAuthors();
- } else {
- $authors = new Zend_Feed_Reader_Collection_Author(
- Zend_Feed_Reader::arrayUnique($authors)
- );
- }
-
- if (count($authors) == 0) {
- $authors = null;
- }
-
- $this->_data['authors'] = $authors;
-
- return $this->_data['authors'];
- }
-
- /**
- * Get the copyright entry
- *
- * @return string|null
- */
- public function getCopyright()
- {
- if (array_key_exists('copyright', $this->_data)) {
- return $this->_data['copyright'];
- }
-
- $copyright = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $copyright = $this->_xpath->evaluate('string(/rss/channel/copyright)');
- }
-
- if (!$copyright && $this->getExtension('DublinCore') !== null) {
- $copyright = $this->getExtension('DublinCore')->getCopyright();
- }
-
- if (empty($copyright)) {
- $copyright = $this->getExtension('Atom')->getCopyright();
- }
-
- if (!$copyright) {
- $copyright = null;
- }
-
- $this->_data['copyright'] = $copyright;
-
- return $this->_data['copyright'];
- }
-
- /**
- * Get the feed creation date
- *
- * @return string|null
- */
- public function getDateCreated()
- {
- return $this->getDateModified();
- }
-
- /**
- * Get the feed modification date
- *
- * @return Zend_Date
- */
- public function getDateModified()
- {
- if (array_key_exists('datemodified', $this->_data)) {
- return $this->_data['datemodified'];
- }
-
- $dateModified = null;
- $date = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $dateModified = $this->_xpath->evaluate('string(/rss/channel/pubDate)');
- if (!$dateModified) {
- $dateModified = $this->_xpath->evaluate('string(/rss/channel/lastBuildDate)');
- }
- if ($dateModified) {
- $dateModifiedParsed = strtotime($dateModified);
- if ($dateModifiedParsed) {
- $date = new Zend_Date($dateModifiedParsed);
- } else {
- $dateStandards = array(Zend_Date::RSS, Zend_Date::RFC_822,
- Zend_Date::RFC_2822, Zend_Date::DATES);
- $date = new Zend_Date;
- foreach ($dateStandards as $standard) {
- try {
- $date->set($dateModified, $standard);
- break;
- } catch (Zend_Date_Exception $e) {
- if ($standard == Zend_Date::DATES) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception(
- 'Could not load date due to unrecognised'
- .' format (should follow RFC 822 or 2822):'
- . $e->getMessage(),
- 0, $e
- );
- }
- }
- }
- }
- }
- }
-
- if (!$date) {
- $date = $this->getExtension('DublinCore')->getDate();
- }
-
- if (!$date) {
- $date = $this->getExtension('Atom')->getDateModified();
- }
-
- if (!$date) {
- $date = null;
- }
-
- $this->_data['datemodified'] = $date;
-
- return $this->_data['datemodified'];
- }
-
- /**
- * Get the feed lastBuild date
- *
- * @return Zend_Date
- */
- public function getLastBuildDate()
- {
- if (array_key_exists('lastBuildDate', $this->_data)) {
- return $this->_data['lastBuildDate'];
- }
-
- $lastBuildDate = null;
- $date = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $lastBuildDate = $this->_xpath->evaluate('string(/rss/channel/lastBuildDate)');
- if ($lastBuildDate) {
- $lastBuildDateParsed = strtotime($lastBuildDate);
- if ($lastBuildDateParsed) {
- $date = new Zend_Date($lastBuildDateParsed);
- } else {
- $dateStandards = array(Zend_Date::RSS, Zend_Date::RFC_822,
- Zend_Date::RFC_2822, Zend_Date::DATES);
- $date = new Zend_Date;
- foreach ($dateStandards as $standard) {
- try {
- $date->set($lastBuildDate, $standard);
- break;
- } catch (Zend_Date_Exception $e) {
- if ($standard == Zend_Date::DATES) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception(
- 'Could not load date due to unrecognised'
- .' format (should follow RFC 822 or 2822):'
- . $e->getMessage(),
- 0, $e
- );
- }
- }
- }
- }
- }
- }
-
- if (!$date) {
- $date = null;
- }
-
- $this->_data['lastBuildDate'] = $date;
-
- return $this->_data['lastBuildDate'];
- }
-
- /**
- * Get the feed description
- *
- * @return string|null
- */
- public function getDescription()
- {
- if (array_key_exists('description', $this->_data)) {
- return $this->_data['description'];
- }
-
- $description = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $description = $this->_xpath->evaluate('string(/rss/channel/description)');
- } else {
- $description = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:description)');
- }
-
- if (!$description && $this->getExtension('DublinCore') !== null) {
- $description = $this->getExtension('DublinCore')->getDescription();
- }
-
- if (empty($description)) {
- $description = $this->getExtension('Atom')->getDescription();
- }
-
- if (!$description) {
- $description = null;
- }
-
- $this->_data['description'] = $description;
-
- return $this->_data['description'];
- }
-
- /**
- * Get the feed ID
- *
- * @return string|null
- */
- public function getId()
- {
- if (array_key_exists('id', $this->_data)) {
- return $this->_data['id'];
- }
-
- $id = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $id = $this->_xpath->evaluate('string(/rss/channel/guid)');
- }
-
- if (!$id && $this->getExtension('DublinCore') !== null) {
- $id = $this->getExtension('DublinCore')->getId();
- }
-
- if (empty($id)) {
- $id = $this->getExtension('Atom')->getId();
- }
-
- if (!$id) {
- if ($this->getLink()) {
- $id = $this->getLink();
- } elseif ($this->getTitle()) {
- $id = $this->getTitle();
- } else {
- $id = null;
- }
- }
-
- $this->_data['id'] = $id;
-
- return $this->_data['id'];
- }
-
- /**
- * Get the feed image data
- *
- * @return array|null
- */
- public function getImage()
- {
- if (array_key_exists('image', $this->_data)) {
- return $this->_data['image'];
- }
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $list = $this->_xpath->query('/rss/channel/image');
- $prefix = '/rss/channel/image[1]';
- } else {
- $list = $this->_xpath->query('/rdf:RDF/rss:channel/rss:image');
- $prefix = '/rdf:RDF/rss:channel/rss:image[1]';
- }
- if ($list->length > 0) {
- $image = array();
- $value = $this->_xpath->evaluate('string(' . $prefix . '/url)');
- if ($value) {
- $image['uri'] = $value;
- }
- $value = $this->_xpath->evaluate('string(' . $prefix . '/link)');
- if ($value) {
- $image['link'] = $value;
- }
- $value = $this->_xpath->evaluate('string(' . $prefix . '/title)');
- if ($value) {
- $image['title'] = $value;
- }
- $value = $this->_xpath->evaluate('string(' . $prefix . '/height)');
- if ($value) {
- $image['height'] = $value;
- }
- $value = $this->_xpath->evaluate('string(' . $prefix . '/width)');
- if ($value) {
- $image['width'] = $value;
- }
- $value = $this->_xpath->evaluate('string(' . $prefix . '/description)');
- if ($value) {
- $image['description'] = $value;
- }
- } else {
- $image = null;
- }
-
- $this->_data['image'] = $image;
-
- return $this->_data['image'];
- }
-
- /**
- * Get the feed language
- *
- * @return string|null
- */
- public function getLanguage()
- {
- if (array_key_exists('language', $this->_data)) {
- return $this->_data['language'];
- }
-
- $language = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $language = $this->_xpath->evaluate('string(/rss/channel/language)');
- }
-
- if (!$language && $this->getExtension('DublinCore') !== null) {
- $language = $this->getExtension('DublinCore')->getLanguage();
- }
-
- if (empty($language)) {
- $language = $this->getExtension('Atom')->getLanguage();
- }
-
- if (!$language) {
- $language = $this->_xpath->evaluate('string(//@xml:lang[1])');
- }
-
- if (!$language) {
- $language = null;
- }
-
- $this->_data['language'] = $language;
-
- return $this->_data['language'];
- }
-
- /**
- * Get a link to the feed
- *
- * @return string|null
- */
- public function getLink()
- {
- if (array_key_exists('link', $this->_data)) {
- return $this->_data['link'];
- }
-
- $link = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $link = $this->_xpath->evaluate('string(/rss/channel/link)');
- } else {
- $link = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:link)');
- }
-
- if (empty($link)) {
- $link = $this->getExtension('Atom')->getLink();
- }
-
- if (!$link) {
- $link = null;
- }
-
- $this->_data['link'] = $link;
-
- return $this->_data['link'];
- }
-
- /**
- * Get a link to the feed XML
- *
- * @return string|null
- */
- public function getFeedLink()
- {
- if (array_key_exists('feedlink', $this->_data)) {
- return $this->_data['feedlink'];
- }
-
- $link = null;
-
- $link = $this->getExtension('Atom')->getFeedLink();
-
- if ($link === null || empty($link)) {
- $link = $this->getOriginalSourceUri();
- }
-
- $this->_data['feedlink'] = $link;
-
- return $this->_data['feedlink'];
- }
-
- /**
- * Get the feed generator entry
- *
- * @return string|null
- */
- public function getGenerator()
- {
- if (array_key_exists('generator', $this->_data)) {
- return $this->_data['generator'];
- }
-
- $generator = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $generator = $this->_xpath->evaluate('string(/rss/channel/generator)');
- }
-
- if (!$generator) {
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $generator = $this->_xpath->evaluate('string(/rss/channel/atom:generator)');
- } else {
- $generator = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/atom:generator)');
- }
- }
-
- if (empty($generator)) {
- $generator = $this->getExtension('Atom')->getGenerator();
- }
-
- if (!$generator) {
- $generator = null;
- }
-
- $this->_data['generator'] = $generator;
-
- return $this->_data['generator'];
- }
-
- /**
- * Get the feed title
- *
- * @return string|null
- */
- public function getTitle()
- {
- if (array_key_exists('title', $this->_data)) {
- return $this->_data['title'];
- }
-
- $title = null;
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $title = $this->_xpath->evaluate('string(/rss/channel/title)');
- } else {
- $title = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:title)');
- }
-
- if (!$title && $this->getExtension('DublinCore') !== null) {
- $title = $this->getExtension('DublinCore')->getTitle();
- }
-
- if (!$title) {
- $title = $this->getExtension('Atom')->getTitle();
- }
-
- if (!$title) {
- $title = null;
- }
-
- $this->_data['title'] = $title;
-
- return $this->_data['title'];
- }
-
- /**
- * Get an array of any supported Pusubhubbub endpoints
- *
- * @return array|null
- */
- public function getHubs()
- {
- if (array_key_exists('hubs', $this->_data)) {
- return $this->_data['hubs'];
- }
-
- $hubs = $this->getExtension('Atom')->getHubs();
-
- if (empty($hubs)) {
- $hubs = null;
- } else {
- $hubs = array_unique($hubs);
- }
-
- $this->_data['hubs'] = $hubs;
-
- return $this->_data['hubs'];
- }
-
- /**
- * Get all categories
- *
- * @return Zend_Feed_Reader_Collection_Category
- */
- public function getCategories()
- {
- if (array_key_exists('categories', $this->_data)) {
- return $this->_data['categories'];
- }
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
- $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $list = $this->_xpath->query('/rss/channel//category');
- } else {
- $list = $this->_xpath->query('/rdf:RDF/rss:channel//rss:category');
- }
-
- if ($list->length) {
- $categoryCollection = new Zend_Feed_Reader_Collection_Category;
- foreach ($list as $category) {
- $categoryCollection[] = array(
- 'term' => $category->nodeValue,
- 'scheme' => $category->getAttribute('domain'),
- 'label' => $category->nodeValue,
- );
- }
- } else {
- $categoryCollection = $this->getExtension('DublinCore')->getCategories();
- }
-
- if (count($categoryCollection) == 0) {
- $categoryCollection = $this->getExtension('Atom')->getCategories();
- }
-
- $this->_data['categories'] = $categoryCollection;
-
- return $this->_data['categories'];
- }
-
- /**
- * Read all entries to the internal entries array
- *
- */
- protected function _indexEntries()
- {
- $entries = array();
-
- if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
- $entries = $this->_xpath->evaluate('//item');
- } else {
- $entries = $this->_xpath->evaluate('//rss:item');
- }
-
- foreach($entries as $index=>$entry) {
- $this->_entries[$index] = $entry;
- }
- }
-
- /**
- * Register the default namespaces for the current feed format
- *
- */
- protected function _registerNamespaces()
- {
- switch ($this->_data['type']) {
- case Zend_Feed_Reader::TYPE_RSS_10:
- $this->_xpath->registerNamespace('rdf', Zend_Feed_Reader::NAMESPACE_RDF);
- $this->_xpath->registerNamespace('rss', Zend_Feed_Reader::NAMESPACE_RSS_10);
- break;
-
- case Zend_Feed_Reader::TYPE_RSS_090:
- $this->_xpath->registerNamespace('rdf', Zend_Feed_Reader::NAMESPACE_RDF);
- $this->_xpath->registerNamespace('rss', Zend_Feed_Reader::NAMESPACE_RSS_090);
- break;
- }
- }
-}
diff --git a/library/Zend/Feed/Reader/FeedAbstract.php b/library/Zend/Feed/Reader/FeedAbstract.php
deleted file mode 100644
index 02dd0b49e4..0000000000
--- a/library/Zend/Feed/Reader/FeedAbstract.php
+++ /dev/null
@@ -1,321 +0,0 @@
-_domDocument = $domDocument;
- $this->_xpath = new DOMXPath($this->_domDocument);
-
- if ($type !== null) {
- $this->_data['type'] = $type;
- } else {
- $this->_data['type'] = Zend_Feed_Reader::detectType($this->_domDocument);
- }
- $this->_registerNamespaces();
- $this->_indexEntries();
- $this->_loadExtensions();
- }
-
- /**
- * Set an original source URI for the feed being parsed. This value
- * is returned from getFeedLink() method if the feed does not carry
- * a self-referencing URI.
- *
- * @param string $uri
- */
- public function setOriginalSourceUri($uri)
- {
- $this->_originalSourceUri = $uri;
- }
-
- /**
- * Get an original source URI for the feed being parsed. Returns null if
- * unset or the feed was not imported from a URI.
- *
- * @return string|null
- */
- public function getOriginalSourceUri()
- {
- return $this->_originalSourceUri;
- }
-
- /**
- * Get the number of feed entries.
- * Required by the Iterator interface.
- *
- * @return int
- */
- public function count()
- {
- return count($this->_entries);
- }
-
- /**
- * Return the current entry
- *
- * @return Zend_Feed_Reader_EntryInterface
- */
- public function current()
- {
- if (substr($this->getType(), 0, 3) == 'rss') {
- $reader = new Zend_Feed_Reader_Entry_Rss($this->_entries[$this->key()], $this->key(), $this->getType());
- } else {
- $reader = new Zend_Feed_Reader_Entry_Atom($this->_entries[$this->key()], $this->key(), $this->getType());
- }
-
- $reader->setXpath($this->_xpath);
-
- return $reader;
- }
-
- /**
- * Get the DOM
- *
- * @return DOMDocument
- */
- public function getDomDocument()
- {
- return $this->_domDocument;
- }
-
- /**
- * Get the Feed's encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- $assumed = $this->getDomDocument()->encoding;
- if (empty($assumed)) {
- $assumed = 'UTF-8';
- }
- return $assumed;
- }
-
- /**
- * Get feed as xml
- *
- * @return string
- */
- public function saveXml()
- {
- return $this->getDomDocument()->saveXml();
- }
-
- /**
- * Get the DOMElement representing the items/feed element
- *
- * @return DOMElement
- */
- public function getElement()
- {
- return $this->getDomDocument()->documentElement;
- }
-
- /**
- * Get the DOMXPath object for this feed
- *
- * @return DOMXPath
- */
- public function getXpath()
- {
- return $this->_xpath;
- }
-
- /**
- * Get the feed type
- *
- * @return string
- */
- public function getType()
- {
- return $this->_data['type'];
- }
-
- /**
- * Return the current feed key
- *
- * @return unknown
- */
- public function key()
- {
- return $this->_entriesKey;
- }
-
- /**
- * Move the feed pointer forward
- *
- */
- public function next()
- {
- ++$this->_entriesKey;
- }
-
- /**
- * Reset the pointer in the feed object
- *
- */
- public function rewind()
- {
- $this->_entriesKey = 0;
- }
-
- /**
- * Check to see if the iterator is still valid
- *
- * @return boolean
- */
- public function valid()
- {
- return 0 <= $this->_entriesKey && $this->_entriesKey < $this->count();
- }
-
- public function getExtensions()
- {
- return $this->_extensions;
- }
-
- public function __call($method, $args)
- {
- foreach ($this->_extensions as $extension) {
- if (method_exists($extension, $method)) {
- return call_user_func_array(array($extension, $method), $args);
- }
- }
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Method: ' . $method
- . 'does not exist and could not be located on a registered Extension');
- }
-
- /**
- * Return an Extension object with the matching name (postfixed with _Feed)
- *
- * @param string $name
- * @return Zend_Feed_Reader_Extension_FeedAbstract
- */
- public function getExtension($name)
- {
- if (array_key_exists($name . '_Feed', $this->_extensions)) {
- return $this->_extensions[$name . '_Feed'];
- }
- return null;
- }
-
- protected function _loadExtensions()
- {
- $all = Zend_Feed_Reader::getExtensions();
- $feed = $all['feed'];
- foreach ($feed as $extension) {
- if (in_array($extension, $all['core'])) {
- continue;
- }
- $className = Zend_Feed_Reader::getPluginLoader()->getClassName($extension);
- $this->_extensions[$extension] = new $className(
- $this->getDomDocument(), $this->_data['type'], $this->_xpath
- );
- }
- }
-
- /**
- * Read all entries to the internal entries array
- *
- */
- abstract protected function _indexEntries();
-
- /**
- * Register the default namespaces for the current feed format
- *
- */
- abstract protected function _registerNamespaces();
-}
diff --git a/library/Zend/Feed/Reader/FeedInterface.php b/library/Zend/Feed/Reader/FeedInterface.php
deleted file mode 100644
index be65c725f1..0000000000
--- a/library/Zend/Feed/Reader/FeedInterface.php
+++ /dev/null
@@ -1,122 +0,0 @@
-getAttribute('rel')) !== 'alternate'
- || !$link->getAttribute('type') || !$link->getAttribute('href')) {
- continue;
- }
- if (!isset($this->rss) && $link->getAttribute('type') == 'application/rss+xml') {
- $this->rss = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri);
- } elseif(!isset($this->atom) && $link->getAttribute('type') == 'application/atom+xml') {
- $this->atom = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri);
- } elseif(!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') {
- $this->rdf = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri);
- }
- $this[] = new self(array(
- 'rel' => 'alternate',
- 'type' => $link->getAttribute('type'),
- 'href' => $this->_absolutiseUri(trim($link->getAttribute('href')), $uri),
- ));
- }
- }
-
- /**
- * Attempt to turn a relative URI into an absolute URI
- */
- protected function _absolutiseUri($link, $uri = null)
- {
- if (!Zend_Uri::check($link)) {
- if ($uri !== null) {
- $uri = Zend_Uri::factory($uri);
-
- if ($link[0] !== '/') {
- $link = $uri->getPath() . '/' . $link;
- }
-
- $link = $uri->getScheme() . '://' . $uri->getHost() . '/' . $this->_canonicalizePath($link);
- if (!Zend_Uri::check($link)) {
- $link = null;
- }
- }
- }
- return $link;
- }
-
- /**
- * Canonicalize relative path
- */
- protected function _canonicalizePath($path)
- {
- $parts = array_filter(explode('/', $path));
- $absolutes = array();
- foreach ($parts as $part) {
- if ('.' == $part) {
- continue;
- }
- if ('..' == $part) {
- array_pop($absolutes);
- } else {
- $absolutes[] = $part;
- }
- }
- return implode('/', $absolutes);
- }
-
- /**
- * Supports lazy loading of feeds using Zend_Feed_Reader::import() but
- * delegates any other operations to the parent class.
- *
- * @param string $offset
- * @return mixed
- * @uses Zend_Feed_Reader
- */
- public function offsetGet($offset)
- {
- if ($offset == 'feed' && !$this->offsetExists('feed')) {
- if (!$this->offsetExists('href')) {
- return null;
- }
- $feed = Zend_Feed_Reader::import($this->offsetGet('href'));
- $this->offsetSet('feed', $feed);
- return $feed;
- }
- return parent::offsetGet($offset);
- }
-
-}
diff --git a/library/Zend/Feed/Rss.php b/library/Zend/Feed/Rss.php
deleted file mode 100644
index 674ba51a1e..0000000000
--- a/library/Zend/Feed/Rss.php
+++ /dev/null
@@ -1,530 +0,0 @@
-s).
- *
- * @var string
- */
- protected $_entryElementName = 'item';
-
- /**
- * The default namespace for RSS channels.
- *
- * @var string
- */
- protected $_defaultNamespace = 'rss';
-
- /**
- * Override Zend_Feed_Abstract to set up the $_element and $_entries aliases.
- *
- * @return void
- * @throws Zend_Feed_Exception
- */
- public function __wakeup()
- {
- parent::__wakeup();
-
- // Find the base channel element and create an alias to it.
- $rdfTags = $this->_element->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'RDF');
- if ($rdfTags->length != 0) {
- $this->_element = $rdfTags->item(0);
- } else {
- $this->_element = $this->_element->getElementsByTagName('channel')->item(0);
- }
- if (!$this->_element) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('No root element found, cannot parse channel.');
- }
-
- // Find the entries and save a pointer to them for speed and
- // simplicity.
- $this->_buildEntryCache();
- }
-
-
- /**
- * Make accessing some individual elements of the channel easier.
- *
- * Special accessors 'item' and 'items' are provided so that if
- * you wish to iterate over an RSS channel's items, you can do so
- * using foreach ($channel->items as $item) or foreach
- * ($channel->item as $item).
- *
- * @param string $var The property to access.
- * @return mixed
- */
- public function __get($var)
- {
- switch ($var) {
- case 'item':
- // fall through to the next case
- case 'items':
- return $this;
-
- default:
- return parent::__get($var);
- }
- }
-
- /**
- * Generate the header of the feed when working in write mode
- *
- * @param array $array the data to use
- * @return DOMElement root node
- */
- protected function _mapFeedHeaders($array)
- {
- $channel = $this->_element->createElement('channel');
-
- $title = $this->_element->createElement('title');
- $title->appendChild($this->_element->createCDATASection($array->title));
- $channel->appendChild($title);
-
- $link = $this->_element->createElement('link', $array->link);
- $channel->appendChild($link);
-
- $desc = isset($array->description) ? $array->description : '';
- $description = $this->_element->createElement('description');
- $description->appendChild($this->_element->createCDATASection($desc));
- $channel->appendChild($description);
-
- $pubdate = isset($array->lastUpdate) ? $array->lastUpdate : time();
- $pubdate = $this->_element->createElement('pubDate', date(DATE_RSS, $pubdate));
- $channel->appendChild($pubdate);
-
- if (isset($array->published)) {
- $lastBuildDate = $this->_element->createElement('lastBuildDate', date(DATE_RSS, $array->published));
- $channel->appendChild($lastBuildDate);
- }
-
- $editor = '';
- if (!empty($array->email)) {
- $editor .= $array->email;
- }
- if (!empty($array->author)) {
- $editor .= ' (' . $array->author . ')';
- }
- if (!empty($editor)) {
- $author = $this->_element->createElement('managingEditor', ltrim($editor));
- $channel->appendChild($author);
- }
- if (isset($array->webmaster)) {
- $channel->appendChild($this->_element->createElement('webMaster', $array->webmaster));
- }
-
- if (!empty($array->copyright)) {
- $copyright = $this->_element->createElement('copyright', $array->copyright);
- $channel->appendChild($copyright);
- }
-
- if (isset($array->category)) {
- $category = $this->_element->createElement('category', $array->category);
- $channel->appendChild($category);
- }
-
- if (!empty($array->image)) {
- $image = $this->_element->createElement('image');
- $url = $this->_element->createElement('url', $array->image);
- $image->appendChild($url);
- $imagetitle = $this->_element->createElement('title');
- $imagetitle->appendChild($this->_element->createCDATASection($array->title));
- $image->appendChild($imagetitle);
- $imagelink = $this->_element->createElement('link', $array->link);
- $image->appendChild($imagelink);
-
- $channel->appendChild($image);
- }
-
- $generator = !empty($array->generator) ? $array->generator : 'Zend_Feed';
- $generator = $this->_element->createElement('generator', $generator);
- $channel->appendChild($generator);
-
- if (!empty($array->language)) {
- $language = $this->_element->createElement('language', $array->language);
- $channel->appendChild($language);
- }
-
- $doc = $this->_element->createElement('docs', 'http://blogs.law.harvard.edu/tech/rss');
- $channel->appendChild($doc);
-
- if (isset($array->cloud)) {
- $cloud = $this->_element->createElement('cloud');
- $cloud->setAttribute('domain', $array->cloud['uri']->getHost());
- $cloud->setAttribute('port', $array->cloud['uri']->getPort());
- $cloud->setAttribute('path', $array->cloud['uri']->getPath());
- $cloud->setAttribute('registerProcedure', $array->cloud['procedure']);
- $cloud->setAttribute('protocol', $array->cloud['protocol']);
- $channel->appendChild($cloud);
- }
-
- if (isset($array->ttl)) {
- $ttl = $this->_element->createElement('ttl', $array->ttl);
- $channel->appendChild($ttl);
- }
-
- if (isset($array->rating)) {
- $rating = $this->_element->createElement('rating', $array->rating);
- $channel->appendChild($rating);
- }
-
- if (isset($array->textInput)) {
- $textinput = $this->_element->createElement('textInput');
- $textinput->appendChild($this->_element->createElement('title', $array->textInput['title']));
- $textinput->appendChild($this->_element->createElement('description', $array->textInput['description']));
- $textinput->appendChild($this->_element->createElement('name', $array->textInput['name']));
- $textinput->appendChild($this->_element->createElement('link', $array->textInput['link']));
- $channel->appendChild($textinput);
- }
-
- if (isset($array->skipHours)) {
- $skipHours = $this->_element->createElement('skipHours');
- foreach ($array->skipHours as $hour) {
- $skipHours->appendChild($this->_element->createElement('hour', $hour));
- }
- $channel->appendChild($skipHours);
- }
-
- if (isset($array->skipDays)) {
- $skipDays = $this->_element->createElement('skipDays');
- foreach ($array->skipDays as $day) {
- $skipDays->appendChild($this->_element->createElement('day', $day));
- }
- $channel->appendChild($skipDays);
- }
-
- if (isset($array->itunes)) {
- $this->_buildiTunes($channel, $array);
- }
-
- return $channel;
- }
-
- /**
- * Adds the iTunes extensions to a root node
- *
- * @param DOMElement $root
- * @param array $array
- * @return void
- */
- private function _buildiTunes(DOMElement $root, $array)
- {
- /* author node */
- $author = '';
- if (isset($array->itunes->author)) {
- $author = $array->itunes->author;
- } elseif (isset($array->author)) {
- $author = $array->author;
- }
- if (!empty($author)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:author', $author);
- $root->appendChild($node);
- }
-
- /* owner node */
- $author = '';
- $email = '';
- if (isset($array->itunes->owner)) {
- if (isset($array->itunes->owner['name'])) {
- $author = $array->itunes->owner['name'];
- }
- if (isset($array->itunes->owner['email'])) {
- $email = $array->itunes->owner['email'];
- }
- }
- if (empty($author) && isset($array->author)) {
- $author = $array->author;
- }
- if (empty($email) && isset($array->email)) {
- $email = $array->email;
- }
- if (!empty($author) || !empty($email)) {
- $owner = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:owner');
- if (!empty($author)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:name', $author);
- $owner->appendChild($node);
- }
- if (!empty($email)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:email', $email);
- $owner->appendChild($node);
- }
- $root->appendChild($owner);
- }
- $image = '';
- if (isset($array->itunes->image)) {
- $image = $array->itunes->image;
- } elseif (isset($array->image)) {
- $image = $array->image;
- }
- if (!empty($image)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:image');
- $node->setAttribute('href', $image);
- $root->appendChild($node);
- }
- $subtitle = '';
- if (isset($array->itunes->subtitle)) {
- $subtitle = $array->itunes->subtitle;
- } elseif (isset($array->description)) {
- $subtitle = $array->description;
- }
- if (!empty($subtitle)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:subtitle', $subtitle);
- $root->appendChild($node);
- }
- $summary = '';
- if (isset($array->itunes->summary)) {
- $summary = $array->itunes->summary;
- } elseif (isset($array->description)) {
- $summary = $array->description;
- }
- if (!empty($summary)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:summary', $summary);
- $root->appendChild($node);
- }
- if (isset($array->itunes->block)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:block', $array->itunes->block);
- $root->appendChild($node);
- }
- if (isset($array->itunes->explicit)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:explicit', $array->itunes->explicit);
- $root->appendChild($node);
- }
- if (isset($array->itunes->keywords)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:keywords', $array->itunes->keywords);
- $root->appendChild($node);
- }
- if (isset($array->itunes->new_feed_url)) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:new-feed-url', $array->itunes->new_feed_url);
- $root->appendChild($node);
- }
- if (isset($array->itunes->category)) {
- foreach ($array->itunes->category as $i => $category) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:category');
- $node->setAttribute('text', $category['main']);
- $root->appendChild($node);
- $add_end_category = false;
- if (!empty($category['sub'])) {
- $add_end_category = true;
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:category');
- $node->setAttribute('text', $category['sub']);
- $root->appendChild($node);
- }
- if ($i > 0 || $add_end_category) {
- $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:category');
- $root->appendChild($node);
- }
- }
- }
- }
-
- /**
- * Generate the entries of the feed when working in write mode
- *
- * The following nodes are constructed for each feed entry
- *
- * entry title
- * url to feed entry
- * url to feed entry
- * short text
- * long version, can contain html
- *
- *
- * @param DOMElement $root the root node to use
- * @param array $array the data to use
- * @return void
- */
- protected function _mapFeedEntries(DOMElement $root, $array)
- {
- Zend_Feed::registerNamespace('content', 'http://purl.org/rss/1.0/modules/content/');
-
- foreach ($array as $dataentry) {
- $item = $this->_element->createElement('item');
-
- $title = $this->_element->createElement('title');
- $title->appendChild($this->_element->createCDATASection($dataentry->title));
- $item->appendChild($title);
-
- if (isset($dataentry->author)) {
- $author = $this->_element->createElement('author', $dataentry->author);
- $item->appendChild($author);
- }
-
- $link = $this->_element->createElement('link', $dataentry->link);
- $item->appendChild($link);
-
- if (isset($dataentry->guid)) {
- $guid = $this->_element->createElement('guid', $dataentry->guid);
- if (!Zend_Uri::check($dataentry->guid)) {
- $guid->setAttribute('isPermaLink', 'false');
- }
- $item->appendChild($guid);
- }
-
- $description = $this->_element->createElement('description');
- $description->appendChild($this->_element->createCDATASection($dataentry->description));
- $item->appendChild($description);
-
- if (isset($dataentry->content)) {
- $content = $this->_element->createElement('content:encoded');
- $content->appendChild($this->_element->createCDATASection($dataentry->content));
- $item->appendChild($content);
- }
-
- $pubdate = isset($dataentry->lastUpdate) ? $dataentry->lastUpdate : time();
- $pubdate = $this->_element->createElement('pubDate', date(DATE_RSS, $pubdate));
- $item->appendChild($pubdate);
-
- if (isset($dataentry->category)) {
- foreach ($dataentry->category as $category) {
- $node = $this->_element->createElement('category');
- $node->appendChild($this->_element->createCDATASection($category['term']));
- if (isset($category['scheme'])) {
- $node->setAttribute('domain', $category['scheme']);
- }
- $item->appendChild($node);
- }
- }
-
- if (isset($dataentry->source)) {
- $source = $this->_element->createElement('source', $dataentry->source['title']);
- $source->setAttribute('url', $dataentry->source['url']);
- $item->appendChild($source);
- }
-
- if (isset($dataentry->comments)) {
- $comments = $this->_element->createElement('comments', $dataentry->comments);
- $item->appendChild($comments);
- }
- if (isset($dataentry->commentRss)) {
- $comments = $this->_element->createElementNS('http://wellformedweb.org/CommentAPI/',
- 'wfw:commentRss',
- $dataentry->commentRss);
- $item->appendChild($comments);
- }
-
-
- if (isset($dataentry->enclosure)) {
- foreach ($dataentry->enclosure as $enclosure) {
- $node = $this->_element->createElement('enclosure');
- $node->setAttribute('url', $enclosure['url']);
- if (isset($enclosure['type'])) {
- $node->setAttribute('type', $enclosure['type']);
- }
- if (isset($enclosure['length'])) {
- $node->setAttribute('length', $enclosure['length']);
- }
- $item->appendChild($node);
- }
- }
-
- $root->appendChild($item);
- }
- }
-
- /**
- * Override Zend_Feed_Element to include root node
- *
- * @return string
- */
- public function saveXml()
- {
- // Return a complete document including XML prologue.
- $doc = new DOMDocument($this->_element->ownerDocument->version,
- $this->_element->ownerDocument->actualEncoding);
- $root = $doc->createElement('rss');
-
- // Use rss version 2.0
- $root->setAttribute('version', '2.0');
-
- // Content namespace
- $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:content', 'http://purl.org/rss/1.0/modules/content/');
- $root->appendChild($doc->importNode($this->_element, true));
-
- // Append root node
- $doc->appendChild($root);
-
- // Format output
- $doc->formatOutput = true;
-
- return $doc->saveXML();
- }
-
- /**
- * Send feed to a http client with the correct header
- *
- * @return void
- * @throws Zend_Feed_Exception if headers have already been sent
- */
- public function send()
- {
- if (headers_sent()) {
- /**
- * @see Zend_Feed_Exception
- */
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Cannot send RSS because headers have already been sent.');
- }
-
- header('Content-Type: application/rss+xml; charset=' . $this->_element->ownerDocument->actualEncoding);
-
- echo $this->saveXml();
- }
-
-}
diff --git a/library/Zend/Feed/Writer.php b/library/Zend/Feed/Writer.php
deleted file mode 100644
index eae26287d8..0000000000
--- a/library/Zend/Feed/Writer.php
+++ /dev/null
@@ -1,267 +0,0 @@
- array(),
- 'feed' => array(),
- 'entryRenderer' => array(),
- 'feedRenderer' => array(),
- );
-
- /**
- * Set plugin loader for use with Extensions
- *
- * @param Zend_Loader_PluginLoader_Interface
- */
- public static function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader)
- {
- self::$_pluginLoader = $loader;
- }
-
- /**
- * Get plugin loader for use with Extensions
- *
- * @return Zend_Loader_PluginLoader_Interface
- */
- public static function getPluginLoader()
- {
- if (!isset(self::$_pluginLoader)) {
- #require_once 'Zend/Loader/PluginLoader.php';
- self::$_pluginLoader = new Zend_Loader_PluginLoader(array(
- 'Zend_Feed_Writer_Extension_' => 'Zend/Feed/Writer/Extension/',
- ));
- }
- return self::$_pluginLoader;
- }
-
- /**
- * Add prefix path for loading Extensions
- *
- * @param string $prefix
- * @param string $path
- * @return void
- */
- public static function addPrefixPath($prefix, $path)
- {
- $prefix = rtrim($prefix, '_');
- $path = rtrim($path, DIRECTORY_SEPARATOR);
- self::getPluginLoader()->addPrefixPath($prefix, $path);
- }
-
- /**
- * Add multiple Extension prefix paths at once
- *
- * @param array $spec
- * @return void
- */
- public static function addPrefixPaths(array $spec)
- {
- if (isset($spec['prefix']) && isset($spec['path'])) {
- self::addPrefixPath($spec['prefix'], $spec['path']);
- }
- foreach ($spec as $prefixPath) {
- if (isset($prefixPath['prefix']) && isset($prefixPath['path'])) {
- self::addPrefixPath($prefixPath['prefix'], $prefixPath['path']);
- }
- }
- }
-
- /**
- * Register an Extension by name
- *
- * @param string $name
- * @return void
- * @throws Zend_Feed_Exception if unable to resolve Extension class
- */
- public static function registerExtension($name)
- {
- $feedName = $name . '_Feed';
- $entryName = $name . '_Entry';
- $feedRendererName = $name . '_Renderer_Feed';
- $entryRendererName = $name . '_Renderer_Entry';
- if (self::isRegistered($name)) {
- if (self::getPluginLoader()->isLoaded($feedName)
- || self::getPluginLoader()->isLoaded($entryName)
- || self::getPluginLoader()->isLoaded($feedRendererName)
- || self::getPluginLoader()->isLoaded($entryRendererName)
- ) {
- return;
- }
- }
- try {
- self::getPluginLoader()->load($feedName);
- self::$_extensions['feed'][] = $feedName;
- } catch (Zend_Loader_PluginLoader_Exception $e) {
- }
- try {
- self::getPluginLoader()->load($entryName);
- self::$_extensions['entry'][] = $entryName;
- } catch (Zend_Loader_PluginLoader_Exception $e) {
- }
- try {
- self::getPluginLoader()->load($feedRendererName);
- self::$_extensions['feedRenderer'][] = $feedRendererName;
- } catch (Zend_Loader_PluginLoader_Exception $e) {
- }
- try {
- self::getPluginLoader()->load($entryRendererName);
- self::$_extensions['entryRenderer'][] = $entryRendererName;
- } catch (Zend_Loader_PluginLoader_Exception $e) {
- }
- if (!self::getPluginLoader()->isLoaded($feedName)
- && !self::getPluginLoader()->isLoaded($entryName)
- && !self::getPluginLoader()->isLoaded($feedRendererName)
- && !self::getPluginLoader()->isLoaded($entryRendererName)
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Could not load extension: ' . $name
- . 'using Plugin Loader. Check prefix paths are configured and extension exists.');
- }
- }
-
- /**
- * Is a given named Extension registered?
- *
- * @param string $extensionName
- * @return boolean
- */
- public static function isRegistered($extensionName)
- {
- $feedName = $extensionName . '_Feed';
- $entryName = $extensionName . '_Entry';
- $feedRendererName = $extensionName . '_Renderer_Feed';
- $entryRendererName = $extensionName . '_Renderer_Entry';
- if (in_array($feedName, self::$_extensions['feed'])
- || in_array($entryName, self::$_extensions['entry'])
- || in_array($feedRendererName, self::$_extensions['feedRenderer'])
- || in_array($entryRendererName, self::$_extensions['entryRenderer'])
- ) {
- return true;
- }
- return false;
- }
-
- /**
- * Get a list of extensions
- *
- * @return array
- */
- public static function getExtensions()
- {
- return self::$_extensions;
- }
-
- /**
- * Reset class state to defaults
- *
- * @return void
- */
- public static function reset()
- {
- self::$_pluginLoader = null;
- self::$_prefixPaths = array();
- self::$_extensions = array(
- 'entry' => array(),
- 'feed' => array(),
- 'entryRenderer' => array(),
- 'feedRenderer' => array(),
- );
- }
-
- /**
- * Register core (default) extensions
- *
- * @return void
- */
- public static function registerCoreExtensions()
- {
- self::registerExtension('DublinCore');
- self::registerExtension('Content');
- self::registerExtension('Atom');
- self::registerExtension('Slash');
- self::registerExtension('WellFormedWeb');
- self::registerExtension('Threading');
- self::registerExtension('ITunes');
- }
-
- public static function lcfirst($str)
- {
- $str[0] = strtolower($str[0]);
- return $str;
- }
-
-}
diff --git a/library/Zend/Feed/Writer/Deleted.php b/library/Zend/Feed/Writer/Deleted.php
deleted file mode 100644
index 938f4549bf..0000000000
--- a/library/Zend/Feed/Writer/Deleted.php
+++ /dev/null
@@ -1,202 +0,0 @@
-_data['encoding'] = $encoding;
- }
-
- /**
- * Get the feed character encoding
- *
- * @return string|null
- */
- public function getEncoding()
- {
- if (!array_key_exists('encoding', $this->_data)) {
- return 'UTF-8';
- }
- return $this->_data['encoding'];
- }
-
- /**
- * Unset a specific data point
- *
- * @param string $name
- */
- public function remove($name)
- {
- if (isset($this->_data[$name])) {
- unset($this->_data[$name]);
- }
- }
-
- /**
- * Set the current feed type being exported to "rss" or "atom". This allows
- * other objects to gracefully choose whether to execute or not, depending
- * on their appropriateness for the current type, e.g. renderers.
- *
- * @param string $type
- */
- public function setType($type)
- {
- $this->_type = $type;
- }
-
- /**
- * Retrieve the current or last feed type exported.
- *
- * @return string Value will be "rss" or "atom"
- */
- public function getType()
- {
- return $this->_type;
- }
-
- public function setReference($reference)
- {
- if (empty($reference) || !is_string($reference)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: reference must be a non-empty string');
- }
- $this->_data['reference'] = $reference;
- }
-
- public function getReference()
- {
- if (!array_key_exists('reference', $this->_data)) {
- return null;
- }
- return $this->_data['reference'];
- }
-
- public function setWhen($date = null)
- {
- $zdate = null;
- if ($date === null) {
- $zdate = new Zend_Date;
- } elseif ($date instanceof Zend_Date) {
- $zdate = $date;
- } elseif (ctype_digit((string)$date)) {
- $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
- }
- $this->_data['when'] = $zdate;
- }
-
- public function getWhen()
- {
- if (!array_key_exists('when', $this->_data)) {
- return null;
- }
- return $this->_data['when'];
- }
-
- public function setBy(array $by)
- {
- $author = array();
- if (!array_key_exists('name', $by)
- || empty($by['name'])
- || !is_string($by['name'])
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value');
- }
- $author['name'] = $by['name'];
- if (isset($by['email'])) {
- if (empty($by['email']) || !is_string($by['email'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "email" array value must be a non-empty string');
- }
- $author['email'] = $by['email'];
- }
- if (isset($by['uri'])) {
- if (empty($by['uri'])
- || !is_string($by['uri'])
- || !Zend_Uri::check($by['uri'])
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI');
- }
- $author['uri'] = $by['uri'];
- }
- $this->_data['by'] = $author;
- }
-
- public function getBy()
- {
- if (!array_key_exists('by', $this->_data)) {
- return null;
- }
- return $this->_data['by'];
- }
-
- public function setComment($comment)
- {
- $this->_data['comment'] = $comment;
- }
-
- public function getComment()
- {
- if (!array_key_exists('comment', $this->_data)) {
- return null;
- }
- return $this->_data['comment'];
- }
-
-}
diff --git a/library/Zend/Feed/Writer/Entry.php b/library/Zend/Feed/Writer/Entry.php
deleted file mode 100644
index 76786ca7a2..0000000000
--- a/library/Zend/Feed/Writer/Entry.php
+++ /dev/null
@@ -1,761 +0,0 @@
-_loadExtensions();
- }
-
- /**
- * Set a single author
- *
- * @param int $index
- * @return string|null
- */
- public function addAuthor($name, $email = null, $uri = null)
- {
- $author = array();
- if (is_array($name)) {
- if (!array_key_exists('name', $name)
- || empty($name['name'])
- || !is_string($name['name'])
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value');
- }
- $author['name'] = $name['name'];
- if (isset($name['email'])) {
- if (empty($name['email']) || !is_string($name['email'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "email" array value must be a non-empty string');
- }
- $author['email'] = $name['email'];
- }
- if (isset($name['uri'])) {
- if (empty($name['uri'])
- || !is_string($name['uri'])
- || !Zend_Uri::check($name['uri'])
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI');
- }
- $author['uri'] = $name['uri'];
- }
- /**
- * @deprecated
- * Array notation (above) is preferred and will be the sole supported input from ZF 2.0
- */
- } else {
- if (empty($name) || !is_string($name)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string value');
- }
- $author['name'] = $name;
- if (isset($email)) {
- if (empty($email) || !is_string($email)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "email" value must be a non-empty string');
- }
- $author['email'] = $email;
- }
- if (isset($uri)) {
- if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "uri" value must be a non-empty string and valid URI/IRI');
- }
- $author['uri'] = $uri;
- }
- }
- $this->_data['authors'][] = $author;
- }
-
- /**
- * Set an array with feed authors
- *
- * @return array
- */
- public function addAuthors(array $authors)
- {
- foreach($authors as $author) {
- $this->addAuthor($author);
- }
- }
-
- /**
- * Set the feed character encoding
- *
- * @return string|null
- */
- public function setEncoding($encoding)
- {
- if (empty($encoding) || !is_string($encoding)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['encoding'] = $encoding;
- }
-
- /**
- * Get the feed character encoding
- *
- * @return string|null
- */
- public function getEncoding()
- {
- if (!array_key_exists('encoding', $this->_data)) {
- return 'UTF-8';
- }
- return $this->_data['encoding'];
- }
-
- /**
- * Set the copyright entry
- *
- * @return string|null
- */
- public function setCopyright($copyright)
- {
- if (empty($copyright) || !is_string($copyright)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['copyright'] = $copyright;
- }
-
- /**
- * Set the entry's content
- *
- * @return string|null
- */
- public function setContent($content)
- {
- if (empty($content) || !is_string($content)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['content'] = $content;
- }
-
- /**
- * Set the feed creation date
- *
- * @return string|null
- */
- public function setDateCreated($date = null)
- {
- $zdate = null;
- if ($date === null) {
- $zdate = new Zend_Date;
- } elseif ($date instanceof Zend_Date) {
- $zdate = $date;
- } elseif (ctype_digit((string)$date)) {
- $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
- }
- $this->_data['dateCreated'] = $zdate;
- }
-
- /**
- * Set the feed modification date
- *
- * @return string|null
- */
- public function setDateModified($date = null)
- {
- $zdate = null;
- if ($date === null) {
- $zdate = new Zend_Date;
- } elseif ($date instanceof Zend_Date) {
- $zdate = $date;
- } elseif (ctype_digit((string)$date)) {
- $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
- }
- $this->_data['dateModified'] = $zdate;
- }
-
- /**
- * Set the feed description
- *
- * @return string|null
- */
- public function setDescription($description)
- {
- if (empty($description) || !is_string($description)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['description'] = $description;
- }
-
- /**
- * Set the feed ID
- *
- * @return string|null
- */
- public function setId($id)
- {
- if (empty($id) || !is_string($id)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['id'] = $id;
- }
-
- /**
- * Set a link to the HTML source of this entry
- *
- * @return string|null
- */
- public function setLink($link)
- {
- if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI');
- }
- $this->_data['link'] = $link;
- }
-
- /**
- * Set the number of comments associated with this entry
- *
- * @return string|null
- */
- public function setCommentCount($count)
- {
- if ( !is_numeric($count) || (int) $count < 0) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "count" must be a non-empty integer number');
- }
- $this->_data['commentCount'] = (int) $count;
- }
-
- /**
- * Set a link to a HTML page containing comments associated with this entry
- *
- * @return string|null
- */
- public function setCommentLink($link)
- {
- if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "link" must be a non-empty string and valid URI/IRI');
- }
- $this->_data['commentLink'] = $link;
- }
-
- /**
- * Set a link to an XML feed for any comments associated with this entry
- *
- * @return string|null
- */
- public function setCommentFeedLink(array $link)
- {
- if (!isset($link['uri']) || !is_string($link['uri']) || !Zend_Uri::check($link['uri'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "link" must be a non-empty string and valid URI/IRI');
- }
- if (!isset($link['type']) || !in_array($link['type'], array('atom', 'rss', 'rdf'))) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "type" must be one'
- . ' of "atom", "rss" or "rdf"');
- }
- if (!isset($this->_data['commentFeedLinks'])) {
- $this->_data['commentFeedLinks'] = array();
- }
- $this->_data['commentFeedLinks'][] = $link;
- }
-
- /**
- * Set a links to an XML feed for any comments associated with this entry.
- * Each link is an array with keys "uri" and "type", where type is one of:
- * "atom", "rss" or "rdf".
- *
- * @return string|null
- */
- public function setCommentFeedLinks(array $links)
- {
- foreach ($links as $link) {
- $this->setCommentFeedLink($link);
- }
- }
-
- /**
- * Set the feed title
- *
- * @return string|null
- */
- public function setTitle($title)
- {
- if (empty($title) || !is_string($title)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['title'] = $title;
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (!array_key_exists('authors', $this->_data)) {
- return null;
- }
- return $this->_data['authors'];
- }
-
- /**
- * Get the entry content
- *
- * @return string
- */
- public function getContent()
- {
- if (!array_key_exists('content', $this->_data)) {
- return null;
- }
- return $this->_data['content'];
- }
-
- /**
- * Get the entry copyright information
- *
- * @return string
- */
- public function getCopyright()
- {
- if (!array_key_exists('copyright', $this->_data)) {
- return null;
- }
- return $this->_data['copyright'];
- }
-
- /**
- * Get the entry creation date
- *
- * @return string
- */
- public function getDateCreated()
- {
- if (!array_key_exists('dateCreated', $this->_data)) {
- return null;
- }
- return $this->_data['dateCreated'];
- }
-
- /**
- * Get the entry modification date
- *
- * @return string
- */
- public function getDateModified()
- {
- if (!array_key_exists('dateModified', $this->_data)) {
- return null;
- }
- return $this->_data['dateModified'];
- }
-
- /**
- * Get the entry description
- *
- * @return string
- */
- public function getDescription()
- {
- if (!array_key_exists('description', $this->_data)) {
- return null;
- }
- return $this->_data['description'];
- }
-
- /**
- * Get the entry ID
- *
- * @return string
- */
- public function getId()
- {
- if (!array_key_exists('id', $this->_data)) {
- return null;
- }
- return $this->_data['id'];
- }
-
- /**
- * Get a link to the HTML source
- *
- * @return string|null
- */
- public function getLink()
- {
- if (!array_key_exists('link', $this->_data)) {
- return null;
- }
- return $this->_data['link'];
- }
-
-
- /**
- * Get all links
- *
- * @return array
- */
- public function getLinks()
- {
- if (!array_key_exists('links', $this->_data)) {
- return null;
- }
- return $this->_data['links'];
- }
-
- /**
- * Get the entry title
- *
- * @return string
- */
- public function getTitle()
- {
- if (!array_key_exists('title', $this->_data)) {
- return null;
- }
- return $this->_data['title'];
- }
-
- /**
- * Get the number of comments/replies for current entry
- *
- * @return integer
- */
- public function getCommentCount()
- {
- if (!array_key_exists('commentCount', $this->_data)) {
- return null;
- }
- return $this->_data['commentCount'];
- }
-
- /**
- * Returns a URI pointing to the HTML page where comments can be made on this entry
- *
- * @return string
- */
- public function getCommentLink()
- {
- if (!array_key_exists('commentLink', $this->_data)) {
- return null;
- }
- return $this->_data['commentLink'];
- }
-
- /**
- * Returns an array of URIs pointing to a feed of all comments for this entry
- * where the array keys indicate the feed type (atom, rss or rdf).
- *
- * @return string
- */
- public function getCommentFeedLinks()
- {
- if (!array_key_exists('commentFeedLinks', $this->_data)) {
- return null;
- }
- return $this->_data['commentFeedLinks'];
- }
-
- /**
- * Add a entry category
- *
- * @param string $category
- */
- public function addCategory(array $category)
- {
- if (!isset($category['term'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Each category must be an array and '
- . 'contain at least a "term" element containing the machine '
- . ' readable category name');
- }
- if (isset($category['scheme'])) {
- if (empty($category['scheme'])
- || !is_string($category['scheme'])
- || !Zend_Uri::check($category['scheme'])
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('The Atom scheme or RSS domain of'
- . ' a category must be a valid URI');
- }
- }
- if (!isset($this->_data['categories'])) {
- $this->_data['categories'] = array();
- }
- $this->_data['categories'][] = $category;
- }
-
- /**
- * Set an array of entry categories
- *
- * @param array $categories
- */
- public function addCategories(array $categories)
- {
- foreach ($categories as $category) {
- $this->addCategory($category);
- }
- }
-
- /**
- * Get the entry categories
- *
- * @return string|null
- */
- public function getCategories()
- {
- if (!array_key_exists('categories', $this->_data)) {
- return null;
- }
- return $this->_data['categories'];
- }
-
- /**
- * Adds an enclosure to the entry. The array parameter may contain the
- * keys 'uri', 'type' and 'length'. Only 'uri' is required for Atom, though the
- * others must also be provided or RSS rendering (where they are required)
- * will throw an Exception.
- *
- * @param array $enclosures
- */
- public function setEnclosure(array $enclosure)
- {
- if (!isset($enclosure['uri'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Enclosure "uri" is not set');
- }
- if (!Zend_Uri::check($enclosure['uri'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Enclosure "uri" is not a valid URI/IRI');
- }
- $this->_data['enclosure'] = $enclosure;
- }
-
- /**
- * Retrieve an array of all enclosures to be added to entry.
- *
- * @return array
- */
- public function getEnclosure()
- {
- if (!array_key_exists('enclosure', $this->_data)) {
- return null;
- }
- return $this->_data['enclosure'];
- }
-
- /**
- * Unset a specific data point
- *
- * @param string $name
- */
- public function remove($name)
- {
- if (isset($this->_data[$name])) {
- unset($this->_data[$name]);
- }
- }
-
- /**
- * Get registered extensions
- *
- * @return array
- */
- public function getExtensions()
- {
- return $this->_extensions;
- }
-
- /**
- * Return an Extension object with the matching name (postfixed with _Entry)
- *
- * @param string $name
- * @return object
- */
- public function getExtension($name)
- {
- if (array_key_exists($name . '_Entry', $this->_extensions)) {
- return $this->_extensions[$name . '_Entry'];
- }
- return null;
- }
-
- /**
- * Set the current feed type being exported to "rss" or "atom". This allows
- * other objects to gracefully choose whether to execute or not, depending
- * on their appropriateness for the current type, e.g. renderers.
- *
- * @param string $type
- */
- public function setType($type)
- {
- $this->_type = $type;
- }
-
- /**
- * Retrieve the current or last feed type exported.
- *
- * @return string Value will be "rss" or "atom"
- */
- public function getType()
- {
- return $this->_type;
- }
-
- /**
- * Method overloading: call given method on first extension implementing it
- *
- * @param string $method
- * @param array $args
- * @return mixed
- * @throws Zend_Feed_Exception if no extensions implements the method
- */
- public function __call($method, $args)
- {
- foreach ($this->_extensions as $extension) {
- try {
- return call_user_func_array(array($extension, $method), $args);
- } catch (Zend_Feed_Writer_Exception_InvalidMethodException $e) {
- }
- }
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Method: ' . $method
- . ' does not exist and could not be located on a registered Extension');
- }
-
- /**
- * Creates a new Zend_Feed_Writer_Source data container for use. This is NOT
- * added to the current feed automatically, but is necessary to create a
- * container with some initial values preset based on the current feed data.
- *
- * @return Zend_Feed_Writer_Source
- */
- public function createSource()
- {
- $source = new Zend_Feed_Writer_Source;
- if ($this->getEncoding()) {
- $source->setEncoding($this->getEncoding());
- }
- $source->setType($this->getType());
- return $source;
- }
-
- /**
- * Appends a Zend_Feed_Writer_Entry object representing a new entry/item
- * the feed data container's internal group of entries.
- *
- * @param Zend_Feed_Writer_Source $source
- */
- public function setSource(Zend_Feed_Writer_Source $source)
- {
- $this->_data['source'] = $source;
- }
-
- /**
- * @return Zend_Feed_Writer_Source
- */
- public function getSource()
- {
- if (isset($this->_data['source'])) {
- return $this->_data['source'];
- }
- return null;
- }
-
- /**
- * Load extensions from Zend_Feed_Writer
- *
- * @return void
- */
- protected function _loadExtensions()
- {
- $all = Zend_Feed_Writer::getExtensions();
- $exts = $all['entry'];
- foreach ($exts as $ext) {
- $className = Zend_Feed_Writer::getPluginLoader()->getClassName($ext);
- $this->_extensions[$ext] = new $className();
- $this->_extensions[$ext]->setEncoding($this->getEncoding());
- }
- }
-}
diff --git a/library/Zend/Feed/Writer/Exception/InvalidMethodException.php b/library/Zend/Feed/Writer/Exception/InvalidMethodException.php
deleted file mode 100644
index ffec8d1038..0000000000
--- a/library/Zend/Feed/Writer/Exception/InvalidMethodException.php
+++ /dev/null
@@ -1,41 +0,0 @@
-getType()) == 'atom') {
- return;
- }
- $this->_setFeedLinks($this->_dom, $this->_base);
- $this->_setHubs($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append namespaces to root element of feed
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:atom',
- 'http://www.w3.org/2005/Atom');
- }
-
- /**
- * Set feed link elements
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setFeedLinks(DOMDocument $dom, DOMElement $root)
- {
- $flinks = $this->getDataContainer()->getFeedLinks();
- if(!$flinks || empty($flinks)) {
- return;
- }
- foreach ($flinks as $type => $href) {
- $mime = 'application/' . strtolower($type) . '+xml';
- $flink = $dom->createElement('atom:link');
- $root->appendChild($flink);
- $flink->setAttribute('rel', 'self');
- $flink->setAttribute('type', $mime);
- $flink->setAttribute('href', $href);
- }
- $this->_called = true;
- }
-
- /**
- * Set PuSH hubs
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setHubs(DOMDocument $dom, DOMElement $root)
- {
- $hubs = $this->getDataContainer()->getHubs();
- if (!$hubs || empty($hubs)) {
- return;
- }
- foreach ($hubs as $hubUrl) {
- $hub = $dom->createElement('atom:link');
- $hub->setAttribute('rel', 'hub');
- $hub->setAttribute('href', $hubUrl);
- $root->appendChild($hub);
- }
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php b/library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php
deleted file mode 100644
index 53a7509669..0000000000
--- a/library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php
+++ /dev/null
@@ -1,92 +0,0 @@
-getType()) == 'atom') {
- return;
- }
- $this->_setContent($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append namespaces to root element
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:content',
- 'http://purl.org/rss/1.0/modules/content/');
- }
-
- /**
- * Set entry content
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setContent(DOMDocument $dom, DOMElement $root)
- {
- $content = $this->getDataContainer()->getContent();
- if (!$content) {
- return;
- }
- $element = $dom->createElement('content:encoded');
- $root->appendChild($element);
- $cdata = $dom->createCDATASection($content);
- $element->appendChild($cdata);
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php b/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php
deleted file mode 100644
index c028314f7a..0000000000
--- a/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php
+++ /dev/null
@@ -1,96 +0,0 @@
-getType()) == 'atom') {
- return;
- }
- $this->_setAuthors($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append namespaces to entry
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:dc',
- 'http://purl.org/dc/elements/1.1/');
- }
-
- /**
- * Set entry author elements
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->getDataContainer()->getAuthors();
- if (!$authors || empty($authors)) {
- return;
- }
- foreach ($authors as $data) {
- $author = $this->_dom->createElement('dc:creator');
- if (array_key_exists('name', $data)) {
- $text = $dom->createTextNode($data['name']);
- $author->appendChild($text);
- $root->appendChild($author);
- }
- }
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php b/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php
deleted file mode 100644
index ba60d2870c..0000000000
--- a/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php
+++ /dev/null
@@ -1,96 +0,0 @@
-getType()) == 'atom') {
- return;
- }
- $this->_setAuthors($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append namespaces to feed element
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:dc',
- 'http://purl.org/dc/elements/1.1/');
- }
-
- /**
- * Set feed authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->getDataContainer()->getAuthors();
- if (!$authors || empty($authors)) {
- return;
- }
- foreach ($authors as $data) {
- $author = $this->_dom->createElement('dc:creator');
- if (array_key_exists('name', $data)) {
- $text = $dom->createTextNode($data['name']);
- $author->appendChild($text);
- $root->appendChild($author);
- }
- }
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/ITunes/Entry.php b/library/Zend/Feed/Writer/Extension/ITunes/Entry.php
deleted file mode 100644
index 63c0d97dc2..0000000000
--- a/library/Zend/Feed/Writer/Extension/ITunes/Entry.php
+++ /dev/null
@@ -1,242 +0,0 @@
-_encoding = $enc;
- return $this;
- }
-
- /**
- * Get feed encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- return $this->_encoding;
- }
-
- /**
- * Set a block value of "yes" or "no". You may also set an empty string.
- *
- * @param string
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function setItunesBlock($value)
- {
- if (!ctype_alpha($value) && strlen($value) > 0) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "block" may only'
- . ' contain alphabetic characters');
- }
- if (iconv_strlen($value, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "block" may only'
- . ' contain a maximum of 255 characters');
- }
- $this->_data['block'] = $value;
- }
-
- /**
- * Add authors to itunes entry
- *
- * @param array $values
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function addItunesAuthors(array $values)
- {
- foreach ($values as $value) {
- $this->addItunesAuthor($value);
- }
- return $this;
- }
-
- /**
- * Add author to itunes entry
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function addItunesAuthor($value)
- {
- if (iconv_strlen($value, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: any "author" may only'
- . ' contain a maximum of 255 characters each');
- }
- if (!isset($this->_data['authors'])) {
- $this->_data['authors'] = array();
- }
- $this->_data['authors'][] = $value;
- return $this;
- }
-
- /**
- * Set duration
- *
- * @param int $value
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function setItunesDuration($value)
- {
- $value = (string) $value;
- if (!ctype_digit($value)
- && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value)
- && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value)
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "duration" may only'
- . ' be of a specified [[HH:]MM:]SS format');
- }
- $this->_data['duration'] = $value;
- return $this;
- }
-
- /**
- * Set "explicit" flag
- *
- * @param bool $value
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function setItunesExplicit($value)
- {
- if (!in_array($value, array('yes','no','clean'))) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "explicit" may only'
- . ' be one of "yes", "no" or "clean"');
- }
- $this->_data['explicit'] = $value;
- return $this;
- }
-
- /**
- * Set keywords
- *
- * @param array $value
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function setItunesKeywords(array $value)
- {
- if (count($value) > 12) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "keywords" may only'
- . ' contain a maximum of 12 terms');
- }
- $concat = implode(',', $value);
- if (iconv_strlen($concat, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "keywords" may only'
- . ' have a concatenated length of 255 chars where terms are delimited'
- . ' by a comma');
- }
- $this->_data['keywords'] = $value;
- return $this;
- }
-
- /**
- * Set subtitle
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function setItunesSubtitle($value)
- {
- if (iconv_strlen($value, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "subtitle" may only'
- . ' contain a maximum of 255 characters');
- }
- $this->_data['subtitle'] = $value;
- return $this;
- }
-
- /**
- * Set summary
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Entry
- */
- public function setItunesSummary($value)
- {
- if (iconv_strlen($value, $this->getEncoding()) > 4000) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "summary" may only'
- . ' contain a maximum of 4000 characters');
- }
- $this->_data['summary'] = $value;
- return $this;
- }
-
- /**
- * Overloading to itunes specific setters
- *
- * @param string $method
- * @param array $params
- * @return mixed
- */
- public function __call($method, array $params)
- {
- $point = Zend_Feed_Writer::lcfirst(substr($method, 9));
- if (!method_exists($this, 'setItunes' . ucfirst($point))
- && !method_exists($this, 'addItunes' . ucfirst($point))
- ) {
- #require_once 'Zend/Feed/Writer/Exception/InvalidMethodException.php';
- throw new Zend_Feed_Writer_Exception_InvalidMethodException(
- 'invalid method: ' . $method
- );
- }
- if (!array_key_exists($point, $this->_data)
- || empty($this->_data[$point])
- ) {
- return null;
- }
- return $this->_data[$point];
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/ITunes/Feed.php b/library/Zend/Feed/Writer/Extension/ITunes/Feed.php
deleted file mode 100644
index d6bc3a5cb8..0000000000
--- a/library/Zend/Feed/Writer/Extension/ITunes/Feed.php
+++ /dev/null
@@ -1,361 +0,0 @@
-_encoding = $enc;
- return $this;
- }
-
- /**
- * Get feed encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- return $this->_encoding;
- }
-
- /**
- * Set a block value of "yes" or "no". You may also set an empty string.
- *
- * @param string
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesBlock($value)
- {
- if (!ctype_alpha($value) && strlen($value) > 0) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "block" may only'
- . ' contain alphabetic characters');
- }
- if (iconv_strlen($value, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "block" may only'
- . ' contain a maximum of 255 characters');
- }
- $this->_data['block'] = $value;
- return $this;
- }
-
- /**
- * Add feed authors
- *
- * @param array $values
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function addItunesAuthors(array $values)
- {
- foreach ($values as $value) {
- $this->addItunesAuthor($value);
- }
- return $this;
- }
-
- /**
- * Add feed author
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function addItunesAuthor($value)
- {
- if (iconv_strlen($value, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: any "author" may only'
- . ' contain a maximum of 255 characters each');
- }
- if (!isset($this->_data['authors'])) {
- $this->_data['authors'] = array();
- }
- $this->_data['authors'][] = $value;
- return $this;
- }
-
- /**
- * Set feed categories
- *
- * @param array $values
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesCategories(array $values)
- {
- if (!isset($this->_data['categories'])) {
- $this->_data['categories'] = array();
- }
- foreach ($values as $key=>$value) {
- if (!is_array($value)) {
- if (iconv_strlen($value, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: any "category" may only'
- . ' contain a maximum of 255 characters each');
- }
- $this->_data['categories'][] = $value;
- } else {
- if (iconv_strlen($key, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: any "category" may only'
- . ' contain a maximum of 255 characters each');
- }
- $this->_data['categories'][$key] = array();
- foreach ($value as $val) {
- if (iconv_strlen($val, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: any "category" may only'
- . ' contain a maximum of 255 characters each');
- }
- $this->_data['categories'][$key][] = $val;
- }
- }
- }
- return $this;
- }
-
- /**
- * Set feed image (icon)
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesImage($value)
- {
- if (!Zend_Uri::check($value)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "image" may only'
- . ' be a valid URI/IRI');
- }
- if (!in_array(substr($value, -3), array('jpg','png'))) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "image" may only'
- . ' use file extension "jpg" or "png" which must be the last three'
- . ' characters of the URI (i.e. no query string or fragment)');
- }
- $this->_data['image'] = $value;
- return $this;
- }
-
- /**
- * Set feed cumulative duration
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesDuration($value)
- {
- $value = (string) $value;
- if (!ctype_digit($value)
- && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value)
- && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value)
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "duration" may only'
- . ' be of a specified [[HH:]MM:]SS format');
- }
- $this->_data['duration'] = $value;
- return $this;
- }
-
- /**
- * Set "explicit" flag
- *
- * @param string $value Valid values: "yes", "no" or "clean"
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesExplicit($value)
- {
- if (!in_array($value, array('yes','no','clean'))) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "explicit" may only'
- . ' be one of "yes", "no" or "clean"');
- }
- $this->_data['explicit'] = $value;
- return $this;
- }
-
- /**
- * Set feed keywords
- *
- * @param array $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesKeywords(array $value)
- {
- if (count($value) > 12) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "keywords" may only'
- . ' contain a maximum of 12 terms');
- }
- $concat = implode(',', $value);
- if (iconv_strlen($concat, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "keywords" may only'
- . ' have a concatenated length of 255 chars where terms are delimited'
- . ' by a comma');
- }
- $this->_data['keywords'] = $value;
- return $this;
- }
-
- /**
- * Set new feed URL
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesNewFeedUrl($value)
- {
- if (!Zend_Uri::check($value)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "newFeedUrl" may only'
- . ' be a valid URI/IRI');
- }
- $this->_data['newFeedUrl'] = $value;
- return $this;
- }
-
- /**
- * Add feed owners
- *
- * @param array $values
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function addItunesOwners(array $values)
- {
- foreach ($values as $value) {
- $this->addItunesOwner($value);
- }
- return $this;
- }
-
- /**
- * Add feed owner
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function addItunesOwner(array $value)
- {
- if (!isset($value['name']) || !isset($value['email'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: any "owner" must'
- . ' be an array containing keys "name" and "email"');
- }
- if (iconv_strlen($value['name'], $this->getEncoding()) > 255
- || iconv_strlen($value['email'], $this->getEncoding()) > 255
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: any "owner" may only'
- . ' contain a maximum of 255 characters each for "name" and "email"');
- }
- if (!isset($this->_data['owners'])) {
- $this->_data['owners'] = array();
- }
- $this->_data['owners'][] = $value;
- return $this;
- }
-
- /**
- * Set feed subtitle
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesSubtitle($value)
- {
- if (iconv_strlen($value, $this->getEncoding()) > 255) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "subtitle" may only'
- . ' contain a maximum of 255 characters');
- }
- $this->_data['subtitle'] = $value;
- return $this;
- }
-
- /**
- * Set feed summary
- *
- * @param string $value
- * @return Zend_Feed_Writer_Extension_ITunes_Feed
- */
- public function setItunesSummary($value)
- {
- if (iconv_strlen($value, $this->getEncoding()) > 4000) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('invalid parameter: "summary" may only'
- . ' contain a maximum of 4000 characters');
- }
- $this->_data['summary'] = $value;
- return $this;
- }
-
- /**
- * Overloading: proxy to internal setters
- *
- * @param string $method
- * @param array $params
- * @return mixed
- */
- public function __call($method, array $params)
- {
- $point = Zend_Feed_Writer::lcfirst(substr($method, 9));
- if (!method_exists($this, 'setItunes' . ucfirst($point))
- && !method_exists($this, 'addItunes' . ucfirst($point))
- ) {
- #require_once 'Zend/Feed/Writer/Exception/InvalidMethodException.php';
- throw new Zend_Feed_Writer_Exception_InvalidMethodException(
- 'invalid method: ' . $method
- );
- }
- if (!array_key_exists($point, $this->_data) || empty($this->_data[$point])) {
- return null;
- }
- return $this->_data[$point];
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php b/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php
deleted file mode 100644
index 861a21e54c..0000000000
--- a/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php
+++ /dev/null
@@ -1,216 +0,0 @@
-_setAuthors($this->_dom, $this->_base);
- $this->_setBlock($this->_dom, $this->_base);
- $this->_setDuration($this->_dom, $this->_base);
- $this->_setExplicit($this->_dom, $this->_base);
- $this->_setKeywords($this->_dom, $this->_base);
- $this->_setSubtitle($this->_dom, $this->_base);
- $this->_setSummary($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append namespaces to entry root
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:itunes',
- 'http://www.itunes.com/dtds/podcast-1.0.dtd');
- }
-
- /**
- * Set entry authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->getDataContainer()->getItunesAuthors();
- if (!$authors || empty($authors)) {
- return;
- }
- foreach ($authors as $author) {
- $el = $dom->createElement('itunes:author');
- $text = $dom->createTextNode($author);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
- }
-
- /**
- * Set itunes block
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setBlock(DOMDocument $dom, DOMElement $root)
- {
- $block = $this->getDataContainer()->getItunesBlock();
- if ($block === null) {
- return;
- }
- $el = $dom->createElement('itunes:block');
- $text = $dom->createTextNode($block);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set entry duration
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDuration(DOMDocument $dom, DOMElement $root)
- {
- $duration = $this->getDataContainer()->getItunesDuration();
- if (!$duration) {
- return;
- }
- $el = $dom->createElement('itunes:duration');
- $text = $dom->createTextNode($duration);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set explicit flag
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setExplicit(DOMDocument $dom, DOMElement $root)
- {
- $explicit = $this->getDataContainer()->getItunesExplicit();
- if ($explicit === null) {
- return;
- }
- $el = $dom->createElement('itunes:explicit');
- $text = $dom->createTextNode($explicit);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set entry keywords
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setKeywords(DOMDocument $dom, DOMElement $root)
- {
- $keywords = $this->getDataContainer()->getItunesKeywords();
- if (!$keywords || empty($keywords)) {
- return;
- }
- $el = $dom->createElement('itunes:keywords');
- $text = $dom->createTextNode(implode(',', $keywords));
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set entry subtitle
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setSubtitle(DOMDocument $dom, DOMElement $root)
- {
- $subtitle = $this->getDataContainer()->getItunesSubtitle();
- if (!$subtitle) {
- return;
- }
- $el = $dom->createElement('itunes:subtitle');
- $text = $dom->createTextNode($subtitle);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set entry summary
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setSummary(DOMDocument $dom, DOMElement $root)
- {
- $summary = $this->getDataContainer()->getItunesSummary();
- if (!$summary) {
- return;
- }
- $el = $dom->createElement('itunes:summary');
- $text = $dom->createTextNode($summary);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php b/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php
deleted file mode 100644
index 39d71f1530..0000000000
--- a/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php
+++ /dev/null
@@ -1,320 +0,0 @@
-_setAuthors($this->_dom, $this->_base);
- $this->_setBlock($this->_dom, $this->_base);
- $this->_setCategories($this->_dom, $this->_base);
- $this->_setImage($this->_dom, $this->_base);
- $this->_setDuration($this->_dom, $this->_base);
- $this->_setExplicit($this->_dom, $this->_base);
- $this->_setKeywords($this->_dom, $this->_base);
- $this->_setNewFeedUrl($this->_dom, $this->_base);
- $this->_setOwners($this->_dom, $this->_base);
- $this->_setSubtitle($this->_dom, $this->_base);
- $this->_setSummary($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append feed namespaces
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:itunes',
- 'http://www.itunes.com/dtds/podcast-1.0.dtd');
- }
-
- /**
- * Set feed authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->getDataContainer()->getItunesAuthors();
- if (!$authors || empty($authors)) {
- return;
- }
- foreach ($authors as $author) {
- $el = $dom->createElement('itunes:author');
- $text = $dom->createTextNode($author);
- $el->appendChild($text);
- $root->appendChild($el);
- }
- $this->_called = true;
- }
-
- /**
- * Set feed itunes block
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setBlock(DOMDocument $dom, DOMElement $root)
- {
- $block = $this->getDataContainer()->getItunesBlock();
- if ($block === null) {
- return;
- }
- $el = $dom->createElement('itunes:block');
- $text = $dom->createTextNode($block);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set feed categories
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCategories(DOMDocument $dom, DOMElement $root)
- {
- $cats = $this->getDataContainer()->getItunesCategories();
- if (!$cats || empty($cats)) {
- return;
- }
- foreach ($cats as $key=>$cat) {
- if (!is_array($cat)) {
- $el = $dom->createElement('itunes:category');
- $el->setAttribute('text', $cat);
- $root->appendChild($el);
- } else {
- $el = $dom->createElement('itunes:category');
- $el->setAttribute('text', $key);
- $root->appendChild($el);
- foreach ($cat as $subcat) {
- $el2 = $dom->createElement('itunes:category');
- $el2->setAttribute('text', $subcat);
- $el->appendChild($el2);
- }
- }
- }
- $this->_called = true;
- }
-
- /**
- * Set feed image (icon)
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setImage(DOMDocument $dom, DOMElement $root)
- {
- $image = $this->getDataContainer()->getItunesImage();
- if (!$image) {
- return;
- }
- $el = $dom->createElement('itunes:image');
- $el->setAttribute('href', $image);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set feed cumulative duration
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDuration(DOMDocument $dom, DOMElement $root)
- {
- $duration = $this->getDataContainer()->getItunesDuration();
- if (!$duration) {
- return;
- }
- $el = $dom->createElement('itunes:duration');
- $text = $dom->createTextNode($duration);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set explicit flag
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setExplicit(DOMDocument $dom, DOMElement $root)
- {
- $explicit = $this->getDataContainer()->getItunesExplicit();
- if ($explicit === null) {
- return;
- }
- $el = $dom->createElement('itunes:explicit');
- $text = $dom->createTextNode($explicit);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set feed keywords
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setKeywords(DOMDocument $dom, DOMElement $root)
- {
- $keywords = $this->getDataContainer()->getItunesKeywords();
- if (!$keywords || empty($keywords)) {
- return;
- }
- $el = $dom->createElement('itunes:keywords');
- $text = $dom->createTextNode(implode(',', $keywords));
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set feed's new URL
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setNewFeedUrl(DOMDocument $dom, DOMElement $root)
- {
- $url = $this->getDataContainer()->getItunesNewFeedUrl();
- if (!$url) {
- return;
- }
- $el = $dom->createElement('itunes:new-feed-url');
- $text = $dom->createTextNode($url);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set feed owners
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setOwners(DOMDocument $dom, DOMElement $root)
- {
- $owners = $this->getDataContainer()->getItunesOwners();
- if (!$owners || empty($owners)) {
- return;
- }
- foreach ($owners as $owner) {
- $el = $dom->createElement('itunes:owner');
- $name = $dom->createElement('itunes:name');
- $text = $dom->createTextNode($owner['name']);
- $name->appendChild($text);
- $email = $dom->createElement('itunes:email');
- $text = $dom->createTextNode($owner['email']);
- $email->appendChild($text);
- $root->appendChild($el);
- $el->appendChild($name);
- $el->appendChild($email);
- }
- $this->_called = true;
- }
-
- /**
- * Set feed subtitle
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setSubtitle(DOMDocument $dom, DOMElement $root)
- {
- $subtitle = $this->getDataContainer()->getItunesSubtitle();
- if (!$subtitle) {
- return;
- }
- $el = $dom->createElement('itunes:subtitle');
- $text = $dom->createTextNode($subtitle);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-
- /**
- * Set feed summary
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setSummary(DOMDocument $dom, DOMElement $root)
- {
- $summary = $this->getDataContainer()->getItunesSummary();
- if (!$summary) {
- return;
- }
- $el = $dom->createElement('itunes:summary');
- $text = $dom->createTextNode($summary);
- $el->appendChild($text);
- $root->appendChild($el);
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/RendererAbstract.php b/library/Zend/Feed/Writer/Extension/RendererAbstract.php
deleted file mode 100644
index 79da301aaf..0000000000
--- a/library/Zend/Feed/Writer/Extension/RendererAbstract.php
+++ /dev/null
@@ -1,180 +0,0 @@
-_container = $container;
- }
-
- /**
- * Set feed encoding
- *
- * @param string $enc
- * @return Zend_Feed_Writer_Extension_RendererAbstract
- */
- public function setEncoding($enc)
- {
- $this->_encoding = $enc;
- return $this;
- }
-
- /**
- * Get feed encoding
- *
- * @return void
- */
- public function getEncoding()
- {
- return $this->_encoding;
- }
-
- /**
- * Set DOMDocument and DOMElement on which to operate
- *
- * @param DOMDocument $dom
- * @param DOMElement $base
- * @return Zend_Feed_Writer_Extension_RendererAbstract
- */
- public function setDomDocument(DOMDocument $dom, DOMElement $base)
- {
- $this->_dom = $dom;
- $this->_base = $base;
- return $this;
- }
-
- /**
- * Get data container being rendered
- *
- * @return mixed
- */
- public function getDataContainer()
- {
- return $this->_container;
- }
-
- /**
- * Set feed type
- *
- * @param string $type
- * @return Zend_Feed_Writer_Extension_RendererAbstract
- */
- public function setType($type)
- {
- $this->_type = $type;
- return $this;
- }
-
- /**
- * Get feedtype
- *
- * @return string
- */
- public function getType()
- {
- return $this->_type;
- }
-
- /**
- * Set root element of document
- *
- * @param DOMElement $root
- * @return Zend_Feed_Writer_Extension_RendererAbstract
- */
- public function setRootElement(DOMElement $root)
- {
- $this->_rootElement = $root;
- return $this;
- }
-
- /**
- * Get root element
- *
- * @return DOMElement
- */
- public function getRootElement()
- {
- return $this->_rootElement;
- }
-
- /**
- * Append namespaces to feed
- *
- * @return void
- */
- abstract protected function _appendNamespaces();
-}
diff --git a/library/Zend/Feed/Writer/Extension/RendererInterface.php b/library/Zend/Feed/Writer/Extension/RendererInterface.php
deleted file mode 100644
index 4c4e9ccbbb..0000000000
--- a/library/Zend/Feed/Writer/Extension/RendererInterface.php
+++ /dev/null
@@ -1,60 +0,0 @@
-getType()) == 'atom') {
- return; // RSS 2.0 only
- }
- $this->_setCommentCount($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append entry namespaces
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:slash',
- 'http://purl.org/rss/1.0/modules/slash/');
- }
-
- /**
- * Set entry comment count
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCommentCount(DOMDocument $dom, DOMElement $root)
- {
- $count = $this->getDataContainer()->getCommentCount();
- if (!$count) {
- return;
- }
- $tcount = $this->_dom->createElement('slash:comments');
- $tcount->nodeValue = $count;
- $root->appendChild($tcount);
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php b/library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php
deleted file mode 100644
index 2f02601981..0000000000
--- a/library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php
+++ /dev/null
@@ -1,145 +0,0 @@
-getType()) == 'rss') {
- return; // Atom 1.0 only
- }
- $this->_setCommentLink($this->_dom, $this->_base);
- $this->_setCommentFeedLinks($this->_dom, $this->_base);
- $this->_setCommentCount($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append entry namespaces
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:thr',
- 'http://purl.org/syndication/thread/1.0');
- }
-
- /**
- * Set comment link
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCommentLink(DOMDocument $dom, DOMElement $root)
- {
- $link = $this->getDataContainer()->getCommentLink();
- if (!$link) {
- return;
- }
- $clink = $this->_dom->createElement('link');
- $clink->setAttribute('rel', 'replies');
- $clink->setAttribute('type', 'text/html');
- $clink->setAttribute('href', $link);
- $count = $this->getDataContainer()->getCommentCount();
- if ($count !== null) {
- $clink->setAttribute('thr:count', $count);
- }
- $root->appendChild($clink);
- $this->_called = true;
- }
-
- /**
- * Set comment feed links
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root)
- {
- $links = $this->getDataContainer()->getCommentFeedLinks();
- if (!$links || empty($links)) {
- return;
- }
- foreach ($links as $link) {
- $flink = $this->_dom->createElement('link');
- $flink->setAttribute('rel', 'replies');
- $flink->setAttribute('type', 'application/'. $link['type'] .'+xml');
- $flink->setAttribute('href', $link['uri']);
- $count = $this->getDataContainer()->getCommentCount();
- if ($count !== null) {
- $flink->setAttribute('thr:count', $count);
- }
- $root->appendChild($flink);
- $this->_called = true;
- }
- }
-
- /**
- * Set entry comment count
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCommentCount(DOMDocument $dom, DOMElement $root)
- {
- $count = $this->getDataContainer()->getCommentCount();
- if ($count === null) {
- return;
- }
- $tcount = $this->_dom->createElement('thr:total');
- $tcount->nodeValue = $count;
- $root->appendChild($tcount);
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php b/library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php
deleted file mode 100644
index ad82cc1e3f..0000000000
--- a/library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php
+++ /dev/null
@@ -1,96 +0,0 @@
-getType()) == 'atom') {
- return; // RSS 2.0 only
- }
- $this->_setCommentFeedLinks($this->_dom, $this->_base);
- if ($this->_called) {
- $this->_appendNamespaces();
- }
- }
-
- /**
- * Append entry namespaces
- *
- * @return void
- */
- protected function _appendNamespaces()
- {
- $this->getRootElement()->setAttribute('xmlns:wfw',
- 'http://wellformedweb.org/CommentAPI/');
- }
-
- /**
- * Set entry comment feed links
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root)
- {
- $links = $this->getDataContainer()->getCommentFeedLinks();
- if (!$links || empty($links)) {
- return;
- }
- foreach ($links as $link) {
- if ($link['type'] == 'rss') {
- $flink = $this->_dom->createElement('wfw:commentRss');
- $text = $dom->createTextNode($link['uri']);
- $flink->appendChild($text);
- $root->appendChild($flink);
- }
- }
- $this->_called = true;
- }
-}
diff --git a/library/Zend/Feed/Writer/Feed.php b/library/Zend/Feed/Writer/Feed.php
deleted file mode 100644
index a637394e75..0000000000
--- a/library/Zend/Feed/Writer/Feed.php
+++ /dev/null
@@ -1,282 +0,0 @@
-getEncoding()) {
- $entry->setEncoding($this->getEncoding());
- }
- $entry->setType($this->getType());
- return $entry;
- }
-
- /**
- * Appends a Zend_Feed_Writer_Deleted object representing a new entry tombstone
- * to the feed data container's internal group of entries.
- *
- * @param Zend_Feed_Writer_Deleted $entry
- */
- public function addTombstone(Zend_Feed_Writer_Deleted $deleted)
- {
- $this->_entries[] = $deleted;
- }
-
- /**
- * Creates a new Zend_Feed_Writer_Deleted data container for use. This is NOT
- * added to the current feed automatically, but is necessary to create a
- * container with some initial values preset based on the current feed data.
- *
- * @return Zend_Feed_Writer_Deleted
- */
- public function createTombstone()
- {
- $deleted = new Zend_Feed_Writer_Deleted;
- if ($this->getEncoding()) {
- $deleted->setEncoding($this->getEncoding());
- }
- $deleted->setType($this->getType());
- return $deleted;
- }
-
- /**
- * Appends a Zend_Feed_Writer_Entry object representing a new entry/item
- * the feed data container's internal group of entries.
- *
- * @param Zend_Feed_Writer_Entry $entry
- */
- public function addEntry(Zend_Feed_Writer_Entry $entry)
- {
- $this->_entries[] = $entry;
- }
-
- /**
- * Removes a specific indexed entry from the internal queue. Entries must be
- * added to a feed container in order to be indexed.
- *
- * @param int $index
- */
- public function removeEntry($index)
- {
- if (isset($this->_entries[$index])) {
- unset($this->_entries[$index]);
- }
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Undefined index: ' . $index . '. Entry does not exist.');
- }
-
- /**
- * Retrieve a specific indexed entry from the internal queue. Entries must be
- * added to a feed container in order to be indexed.
- *
- * @param int $index
- */
- public function getEntry($index = 0)
- {
- if (isset($this->_entries[$index])) {
- return $this->_entries[$index];
- }
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Undefined index: ' . $index . '. Entry does not exist.');
- }
-
- /**
- * Orders all indexed entries by date, thus offering date ordered readable
- * content where a parser (or Homo Sapien) ignores the generic rule that
- * XML element order is irrelevant and has no intrinsic meaning.
- *
- * Using this method will alter the original indexation.
- *
- * @return void
- */
- public function orderByDate()
- {
- /**
- * Could do with some improvement for performance perhaps
- */
- $timestamp = time();
- $entries = array();
- foreach ($this->_entries as $entry) {
- if ($entry->getDateModified()) {
- $timestamp = (int) $entry->getDateModified()->get(Zend_Date::TIMESTAMP);
- } elseif ($entry->getDateCreated()) {
- $timestamp = (int) $entry->getDateCreated()->get(Zend_Date::TIMESTAMP);
- }
- $entries[$timestamp] = $entry;
- }
- krsort($entries, SORT_NUMERIC);
- $this->_entries = array_values($entries);
- }
-
- /**
- * Get the number of feed entries.
- * Required by the Iterator interface.
- *
- * @return int
- */
- public function count()
- {
- return count($this->_entries);
- }
-
- /**
- * Return the current entry
- *
- * @return Zend_Feed_Reader_Entry_Interface
- */
- public function current()
- {
- return $this->_entries[$this->key()];
- }
-
- /**
- * Return the current feed key
- *
- * @return unknown
- */
- public function key()
- {
- return $this->_entriesKey;
- }
-
- /**
- * Move the feed pointer forward
- *
- * @return void
- */
- public function next()
- {
- ++$this->_entriesKey;
- }
-
- /**
- * Reset the pointer in the feed object
- *
- * @return void
- */
- public function rewind()
- {
- $this->_entriesKey = 0;
- }
-
- /**
- * Check to see if the iterator is still valid
- *
- * @return boolean
- */
- public function valid()
- {
- return 0 <= $this->_entriesKey && $this->_entriesKey < $this->count();
- }
-
- /**
- * Attempt to build and return the feed resulting from the data set
- *
- * @param string $type The feed type "rss" or "atom" to export as
- * @param bool $ignoreExceptions
- * @return string
- */
- public function export($type, $ignoreExceptions = false)
- {
- $this->setType(strtolower($type));
- $type = ucfirst($this->getType());
- if ($type !== 'Rss' && $type !== 'Atom') {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid feed type specified: ' . $type . '.'
- . ' Should be one of "rss" or "atom".');
- }
- $renderClass = 'Zend_Feed_Writer_Renderer_Feed_' . $type;
- $renderer = new $renderClass($this);
- if ($ignoreExceptions) {
- $renderer->ignoreExceptions();
- }
- return $renderer->render()->saveXml();
- }
-
-}
diff --git a/library/Zend/Feed/Writer/Feed/FeedAbstract.php b/library/Zend/Feed/Writer/Feed/FeedAbstract.php
deleted file mode 100644
index e4a2551cfe..0000000000
--- a/library/Zend/Feed/Writer/Feed/FeedAbstract.php
+++ /dev/null
@@ -1,872 +0,0 @@
-_loadExtensions();
- }
-
- /**
- * Set a single author
- *
- * @param int $index
- * @return string|null
- */
- public function addAuthor($name, $email = null, $uri = null)
- {
- $author = array();
- if (is_array($name)) {
- if (!array_key_exists('name', $name) || empty($name['name']) || !is_string($name['name'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value');
- }
- $author['name'] = $name['name'];
- if (isset($name['email'])) {
- if (empty($name['email']) || !is_string($name['email'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "email" array value must be a non-empty string');
- }
- $author['email'] = $name['email'];
- }
- if (isset($name['uri'])) {
- if (empty($name['uri']) || !is_string($name['uri']) || !Zend_Uri::check($name['uri'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI');
- }
- $author['uri'] = $name['uri'];
- }
- } else {
- if (empty($name) || !is_string($name)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string value');
- }
- $author['name'] = $name;
- if (isset($email)) {
- if (empty($email) || !is_string($email)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "email" value must be a non-empty string');
- }
- $author['email'] = $email;
- }
- if (isset($uri)) {
- if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "uri" value must be a non-empty string and valid URI/IRI');
- }
- $author['uri'] = $uri;
- }
- }
- $this->_data['authors'][] = $author;
- }
-
- /**
- * Set an array with feed authors
- *
- * @return array
- */
- public function addAuthors(array $authors)
- {
- foreach($authors as $author) {
- $this->addAuthor($author);
- }
- }
-
- /**
- * Set the copyright entry
- *
- * @return string|null
- */
- public function setCopyright($copyright)
- {
- if (empty($copyright) || !is_string($copyright)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['copyright'] = $copyright;
- }
-
- /**
- * Set the feed creation date
- *
- * @param null|integer|Zend_Date
- */
- public function setDateCreated($date = null)
- {
- $zdate = null;
- if ($date === null) {
- $zdate = new Zend_Date;
- } elseif ($date instanceof Zend_Date) {
- $zdate = $date;
- } elseif (ctype_digit((string)$date)) {
- $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
- }
- $this->_data['dateCreated'] = $zdate;
- }
-
- /**
- * Set the feed modification date
- *
- * @param null|integer|Zend_Date
- */
- public function setDateModified($date = null)
- {
- $zdate = null;
- if ($date === null) {
- $zdate = new Zend_Date;
- } elseif ($date instanceof Zend_Date) {
- $zdate = $date;
- } elseif (ctype_digit((string)$date)) {
- $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
- }
- $this->_data['dateModified'] = $zdate;
- }
-
- /**
- * Set the feed last-build date. Ignored for Atom 1.0.
- *
- * @param null|integer|Zend_Date
- */
- public function setLastBuildDate($date = null)
- {
- $zdate = null;
- if ($date === null) {
- $zdate = new Zend_Date;
- } elseif ($date instanceof Zend_Date) {
- $zdate = $date;
- } elseif (ctype_digit((string)$date)) {
- $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
- } else {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
- }
- $this->_data['lastBuildDate'] = $zdate;
- }
-
- /**
- * Set the feed description
- *
- * @return string|null
- */
- public function setDescription($description)
- {
- if (empty($description) || !is_string($description)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['description'] = $description;
- }
-
- /**
- * Set the feed generator entry
- *
- * @return string|null
- */
- public function setGenerator($name, $version = null, $uri = null)
- {
- if (is_array($name)) {
- $data = $name;
- if (empty($data['name']) || !is_string($data['name'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string');
- }
- $generator = array('name' => $data['name']);
- if (isset($data['version'])) {
- if (empty($data['version']) || !is_string($data['version'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "version" must be a non-empty string');
- }
- $generator['version'] = $data['version'];
- }
- if (isset($data['uri'])) {
- if (empty($data['uri']) || !is_string($data['uri']) || !Zend_Uri::check($data['uri'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI');
- }
- $generator['uri'] = $data['uri'];
- }
- } else {
- if (empty($name) || !is_string($name)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string');
- }
- $generator = array('name' => $name);
- if (isset($version)) {
- if (empty($version) || !is_string($version)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "version" must be a non-empty string');
- }
- $generator['version'] = $version;
- }
- if (isset($uri)) {
- if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI');
- }
- $generator['uri'] = $uri;
- }
- }
- $this->_data['generator'] = $generator;
- }
-
- /**
- * Set the feed ID - URI or URN (via PCRE pattern) supported
- *
- * @param string $id
- */
- public function setId($id)
- {
- if ((empty($id) || !is_string($id) || !Zend_Uri::check($id)) &&
- !preg_match("#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#", $id)
- && !$this->_validateTagUri($id)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI');
- }
- $this->_data['id'] = $id;
- }
-
- /**
- * Validate a URI using the tag scheme (RFC 4151)
- *
- * @param string $id
- * @return bool
- */
- protected function _validateTagUri($id)
- {
- if (preg_match('/^tag:(?.*),(?\d{4}-?\d{0,2}-?\d{0,2}):(?.*)(.*:)*$/', $id, $matches)) {
- $dvalid = false;
- $nvalid = false;
- $date = $matches['date'];
- $d6 = strtotime($date);
- if ((strlen($date) == 4) && $date <= date('Y')) {
- $dvalid = true;
- } elseif ((strlen($date) == 7) && ($d6 < strtotime("now"))) {
- $dvalid = true;
- } elseif ((strlen($date) == 10) && ($d6 < strtotime("now"))) {
- $dvalid = true;
- }
- $validator = new Zend_Validate_EmailAddress;
- if ($validator->isValid($matches['name'])) {
- $nvalid = true;
- } else {
- $nvalid = $validator->isValid('info@' . $matches['name']);
- }
- return $dvalid && $nvalid;
-
- }
- return false;
- }
-
- /**
- * Set a feed image (URI at minimum). Parameter is a single array with the
- * required key 'uri'. When rendering as RSS, the required keys are 'uri',
- * 'title' and 'link'. RSS also specifies three optional parameters 'width',
- * 'height' and 'description'. Only 'uri' is required and used for Atom rendering.
- *
- * @param array $data
- */
- public function setImage(array $data)
- {
- if (empty($data['uri']) || !is_string($data['uri'])
- || !Zend_Uri::check($data['uri'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter \'uri\''
- . ' must be a non-empty string and valid URI/IRI');
- }
- $this->_data['image'] = $data;
- }
-
- /**
- * Set a feed icon (URI at minimum). Parameter is a single array with the
- * required key 'uri'. Only 'uri' is required and used for Atom rendering.
- * RSS does not support an Icon tag except via Atom 1.0 as an extension.
- *
- * @param array $data
- */
- public function setIcon(array $data)
- {
- if (empty($data['uri']) || !is_string($data['uri'])
- || !Zend_Uri::check($data['uri'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter \'uri\''
- . ' must be a non-empty string and valid URI/IRI');
- }
- $this->_data['icon'] = $data;
- }
-
- /**
- * Set the feed language
- *
- * @return string|null
- */
- public function setLanguage($language)
- {
- if (empty($language) || !is_string($language)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['language'] = $language;
- }
-
- /**
- * Set a link to the HTML source
- *
- * @param string $link
- */
- public function setLink($link)
- {
- if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI');
- }
- $this->_data['link'] = $link;
- }
-
- /**
- * Set a link to an XML feed for any feed type/version
- *
- * @return string|null
- */
- public function setFeedLink($link, $type)
- {
- if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "link"" must be a non-empty string and valid URI/IRI');
- }
- if (!in_array(strtolower($type), array('rss', 'rdf', 'atom'))) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "type"; You must declare the type of feed the link points to, i.e. RSS, RDF or Atom');
- }
- $this->_data['feedLinks'][strtolower($type)] = $link;
- }
-
- /**
- * Set the feed title
- *
- * @return string|null
- */
- public function setTitle($title)
- {
- if (empty($title) || !is_string($title)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['title'] = $title;
- }
-
- /**
- * Set the feed character encoding
- *
- * @param string $encoding
- */
- public function setEncoding($encoding)
- {
- if (empty($encoding) || !is_string($encoding)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
- }
- $this->_data['encoding'] = $encoding;
- }
-
- /**
- * Set the feed's base URL
- *
- * @param string $url
- */
- public function setBaseUrl($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "url" array value'
- . ' must be a non-empty string and valid URI/IRI');
- }
- $this->_data['baseUrl'] = $url;
- }
-
- /**
- * Add a Pubsubhubbub hub endpoint URL
- *
- * @param string $url
- */
- public function addHub($url)
- {
- if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: "url" array value'
- . ' must be a non-empty string and valid URI/IRI');
- }
- if (!isset($this->_data['hubs'])) {
- $this->_data['hubs'] = array();
- }
- $this->_data['hubs'][] = $url;
- }
-
- /**
- * Add Pubsubhubbub hub endpoint URLs
- *
- * @param array $urls
- */
- public function addHubs(array $urls)
- {
- foreach ($urls as $url) {
- $this->addHub($url);
- }
- }
-
- /**
- * Add a feed category
- *
- * @param string $category
- */
- public function addCategory(array $category)
- {
- if (!isset($category['term'])) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Each category must be an array and '
- . 'contain at least a "term" element containing the machine '
- . ' readable category name');
- }
- if (isset($category['scheme'])) {
- if (empty($category['scheme'])
- || !is_string($category['scheme'])
- || !Zend_Uri::check($category['scheme'])
- ) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('The Atom scheme or RSS domain of'
- . ' a category must be a valid URI');
- }
- }
- if (!isset($this->_data['categories'])) {
- $this->_data['categories'] = array();
- }
- $this->_data['categories'][] = $category;
- }
-
- /**
- * Set an array of feed categories
- *
- * @param array $categories
- */
- public function addCategories(array $categories)
- {
- foreach ($categories as $category) {
- $this->addCategory($category);
- }
- }
-
- /**
- * Get a single author
- *
- * @param int $index
- * @return string|null
- */
- public function getAuthor($index = 0)
- {
- if (isset($this->_data['authors'][$index])) {
- return $this->_data['authors'][$index];
- } else {
- return null;
- }
- }
-
- /**
- * Get an array with feed authors
- *
- * @return array
- */
- public function getAuthors()
- {
- if (!array_key_exists('authors', $this->_data)) {
- return null;
- }
- return $this->_data['authors'];
- }
-
- /**
- * Get the copyright entry
- *
- * @return string|null
- */
- public function getCopyright()
- {
- if (!array_key_exists('copyright', $this->_data)) {
- return null;
- }
- return $this->_data['copyright'];
- }
-
- /**
- * Get the feed creation date
- *
- * @return string|null
- */
- public function getDateCreated()
- {
- if (!array_key_exists('dateCreated', $this->_data)) {
- return null;
- }
- return $this->_data['dateCreated'];
- }
-
- /**
- * Get the feed modification date
- *
- * @return string|null
- */
- public function getDateModified()
- {
- if (!array_key_exists('dateModified', $this->_data)) {
- return null;
- }
- return $this->_data['dateModified'];
- }
-
- /**
- * Get the feed last-build date
- *
- * @return string|null
- */
- public function getLastBuildDate()
- {
- if (!array_key_exists('lastBuildDate', $this->_data)) {
- return null;
- }
- return $this->_data['lastBuildDate'];
- }
-
- /**
- * Get the feed description
- *
- * @return string|null
- */
- public function getDescription()
- {
- if (!array_key_exists('description', $this->_data)) {
- return null;
- }
- return $this->_data['description'];
- }
-
- /**
- * Get the feed generator entry
- *
- * @return string|null
- */
- public function getGenerator()
- {
- if (!array_key_exists('generator', $this->_data)) {
- return null;
- }
- return $this->_data['generator'];
- }
-
- /**
- * Get the feed ID
- *
- * @return string|null
- */
- public function getId()
- {
- if (!array_key_exists('id', $this->_data)) {
- return null;
- }
- return $this->_data['id'];
- }
-
- /**
- * Get the feed image URI
- *
- * @return array
- */
- public function getImage()
- {
- if (!array_key_exists('image', $this->_data)) {
- return null;
- }
- return $this->_data['image'];
- }
-
- /**
- * Get the feed icon URI
- *
- * @return array
- */
- public function getIcon()
- {
- if (!array_key_exists('icon', $this->_data)) {
- return null;
- }
- return $this->_data['icon'];
- }
-
- /**
- * Get the feed language
- *
- * @return string|null
- */
- public function getLanguage()
- {
- if (!array_key_exists('language', $this->_data)) {
- return null;
- }
- return $this->_data['language'];
- }
-
- /**
- * Get a link to the HTML source
- *
- * @return string|null
- */
- public function getLink()
- {
- if (!array_key_exists('link', $this->_data)) {
- return null;
- }
- return $this->_data['link'];
- }
-
- /**
- * Get a link to the XML feed
- *
- * @return string|null
- */
- public function getFeedLinks()
- {
- if (!array_key_exists('feedLinks', $this->_data)) {
- return null;
- }
- return $this->_data['feedLinks'];
- }
-
- /**
- * Get the feed title
- *
- * @return string|null
- */
- public function getTitle()
- {
- if (!array_key_exists('title', $this->_data)) {
- return null;
- }
- return $this->_data['title'];
- }
-
- /**
- * Get the feed character encoding
- *
- * @return string|null
- */
- public function getEncoding()
- {
- if (!array_key_exists('encoding', $this->_data)) {
- return 'UTF-8';
- }
- return $this->_data['encoding'];
- }
-
- /**
- * Get the feed's base url
- *
- * @return string|null
- */
- public function getBaseUrl()
- {
- if (!array_key_exists('baseUrl', $this->_data)) {
- return null;
- }
- return $this->_data['baseUrl'];
- }
-
- /**
- * Get the URLs used as Pubsubhubbub hubs endpoints
- *
- * @return string|null
- */
- public function getHubs()
- {
- if (!array_key_exists('hubs', $this->_data)) {
- return null;
- }
- return $this->_data['hubs'];
- }
-
- /**
- * Get the feed categories
- *
- * @return string|null
- */
- public function getCategories()
- {
- if (!array_key_exists('categories', $this->_data)) {
- return null;
- }
- return $this->_data['categories'];
- }
-
- /**
- * Resets the instance and deletes all data
- *
- * @return void
- */
- public function reset()
- {
- $this->_data = array();
- }
-
- /**
- * Set the current feed type being exported to "rss" or "atom". This allows
- * other objects to gracefully choose whether to execute or not, depending
- * on their appropriateness for the current type, e.g. renderers.
- *
- * @param string $type
- */
- public function setType($type)
- {
- $this->_type = $type;
- }
-
- /**
- * Retrieve the current or last feed type exported.
- *
- * @return string Value will be "rss" or "atom"
- */
- public function getType()
- {
- return $this->_type;
- }
-
- /**
- * Unset a specific data point
- *
- * @param string $name
- */
- public function remove($name)
- {
- if (isset($this->_data[$name])) {
- unset($this->_data[$name]);
- }
- }
-
- /**
- * Method overloading: call given method on first extension implementing it
- *
- * @param string $method
- * @param array $args
- * @return mixed
- * @throws Zend_Feed_Exception if no extensions implements the method
- */
- public function __call($method, $args)
- {
- foreach ($this->_extensions as $extension) {
- try {
- return call_user_func_array(array($extension, $method), $args);
- } catch (Zend_Feed_Writer_Exception_InvalidMethodException $e) {
- }
- }
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Method: ' . $method
- . ' does not exist and could not be located on a registered Extension');
- }
-
- /**
- * Load extensions from Zend_Feed_Writer
- *
- * @return void
- */
- protected function _loadExtensions()
- {
- $all = Zend_Feed_Writer::getExtensions();
- $exts = $all['feed'];
- foreach ($exts as $ext) {
- $className = Zend_Feed_Writer::getPluginLoader()->getClassName($ext);
- $this->_extensions[$ext] = new $className();
- $this->_extensions[$ext]->setEncoding($this->getEncoding());
- }
- }
-}
diff --git a/library/Zend/Feed/Writer/Renderer/Entry/Atom.php b/library/Zend/Feed/Writer/Renderer/Entry/Atom.php
deleted file mode 100644
index ee4ce524e0..0000000000
--- a/library/Zend/Feed/Writer/Renderer/Entry/Atom.php
+++ /dev/null
@@ -1,448 +0,0 @@
-_dom = new DOMDocument('1.0', $this->_container->getEncoding());
- $this->_dom->formatOutput = true;
- $entry = $this->_dom->createElementNS(Zend_Feed_Writer::NAMESPACE_ATOM_10, 'entry');
- $this->_dom->appendChild($entry);
-
- $this->_setSource($this->_dom, $entry);
- $this->_setTitle($this->_dom, $entry);
- $this->_setDescription($this->_dom, $entry);
- $this->_setDateCreated($this->_dom, $entry);
- $this->_setDateModified($this->_dom, $entry);
- $this->_setLink($this->_dom, $entry);
- $this->_setId($this->_dom, $entry);
- $this->_setAuthors($this->_dom, $entry);
- $this->_setEnclosure($this->_dom, $entry);
- $this->_setContent($this->_dom, $entry);
- $this->_setCategories($this->_dom, $entry);
-
- foreach ($this->_extensions as $ext) {
- $ext->setType($this->getType());
- $ext->setRootElement($this->getRootElement());
- $ext->setDomDocument($this->getDomDocument(), $entry);
- $ext->render();
- }
-
- return $this;
- }
-
- /**
- * Set entry title
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setTitle(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getTitle()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 entry elements MUST contain exactly one'
- . ' atom:title element but a title has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $title = $dom->createElement('title');
- $root->appendChild($title);
- $title->setAttribute('type', 'html');
- $cdata = $dom->createCDATASection($this->getDataContainer()->getTitle());
- $title->appendChild($cdata);
- }
-
- /**
- * Set entry description
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDescription(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDescription()) {
- return; // unless src content or base64
- }
- $subtitle = $dom->createElement('summary');
- $root->appendChild($subtitle);
- $subtitle->setAttribute('type', 'html');
- $cdata = $dom->createCDATASection(
- $this->getDataContainer()->getDescription()
- );
- $subtitle->appendChild($cdata);
- }
-
- /**
- * Set date entry was modified
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateModified(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDateModified()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 entry elements MUST contain exactly one'
- . ' atom:updated element but a modification date has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
-
- $updated = $dom->createElement('updated');
- $root->appendChild($updated);
- $text = $dom->createTextNode(
- $this->getDataContainer()->getDateModified()->get(Zend_Date::ISO_8601)
- );
- $updated->appendChild($text);
- }
-
- /**
- * Set date entry was created
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
- {
- if (!$this->getDataContainer()->getDateCreated()) {
- return;
- }
- $el = $dom->createElement('published');
- $root->appendChild($el);
- $text = $dom->createTextNode(
- $this->getDataContainer()->getDateCreated()->get(Zend_Date::ISO_8601)
- );
- $el->appendChild($text);
- }
-
- /**
- * Set entry authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->_container->getAuthors();
- if ((!$authors || empty($authors))) {
- /**
- * This will actually trigger an Exception at the feed level if
- * a feed level author is not set.
- */
- return;
- }
- foreach ($authors as $data) {
- $author = $this->_dom->createElement('author');
- $name = $this->_dom->createElement('name');
- $author->appendChild($name);
- $root->appendChild($author);
- $text = $dom->createTextNode($data['name']);
- $name->appendChild($text);
- if (array_key_exists('email', $data)) {
- $email = $this->_dom->createElement('email');
- $author->appendChild($email);
- $text = $dom->createTextNode($data['email']);
- $email->appendChild($text);
- }
- if (array_key_exists('uri', $data)) {
- $uri = $this->_dom->createElement('uri');
- $author->appendChild($uri);
- $text = $dom->createTextNode($data['uri']);
- $uri->appendChild($text);
- }
- }
- }
-
- /**
- * Set entry enclosure
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setEnclosure(DOMDocument $dom, DOMElement $root)
- {
- $data = $this->_container->getEnclosure();
- if ((!$data || empty($data))) {
- return;
- }
- $enclosure = $this->_dom->createElement('link');
- $enclosure->setAttribute('rel', 'enclosure');
- if (isset($data['type'])) {
- $enclosure->setAttribute('type', $data['type']);
- }
- if (isset($data['length'])) {
- $enclosure->setAttribute('length', $data['length']);
- }
- $enclosure->setAttribute('href', $data['uri']);
- $root->appendChild($enclosure);
- }
-
- protected function _setLink(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getLink()) {
- return;
- }
- $link = $dom->createElement('link');
- $root->appendChild($link);
- $link->setAttribute('rel', 'alternate');
- $link->setAttribute('type', 'text/html');
- $link->setAttribute('href', $this->getDataContainer()->getLink());
- }
-
- /**
- * Set entry identifier
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setId(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getId()
- && !$this->getDataContainer()->getLink()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 entry elements MUST contain exactly one '
- . 'atom:id element, or as an alternative, we can use the same '
- . 'value as atom:link however neither a suitable link nor an '
- . 'id have been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
-
- if (!$this->getDataContainer()->getId()) {
- $this->getDataContainer()->setId(
- $this->getDataContainer()->getLink());
- }
- if (!Zend_Uri::check($this->getDataContainer()->getId()) &&
- !preg_match("#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#",
- $this->getDataContainer()->getId()
- ) && !$this->_validateTagUri($this->getDataContainer()->getId())) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Atom 1.0 IDs must be a valid URI/IRI');
- }
- $id = $dom->createElement('id');
- $root->appendChild($id);
- $text = $dom->createTextNode($this->getDataContainer()->getId());
- $id->appendChild($text);
- }
-
- /**
- * Validate a URI using the tag scheme (RFC 4151)
- *
- * @param string $id
- * @return bool
- */
- protected function _validateTagUri($id)
- {
- if (preg_match('/^tag:(?.*),(?\d{4}-?\d{0,2}-?\d{0,2}):(?.*)(.*:)*$/', $id, $matches)) {
- $dvalid = false;
- $nvalid = false;
- $date = $matches['date'];
- $d6 = strtotime($date);
- if ((strlen($date) == 4) && $date <= date('Y')) {
- $dvalid = true;
- } elseif ((strlen($date) == 7) && ($d6 < strtotime("now"))) {
- $dvalid = true;
- } elseif ((strlen($date) == 10) && ($d6 < strtotime("now"))) {
- $dvalid = true;
- }
- $validator = new Zend_Validate_EmailAddress;
- if ($validator->isValid($matches['name'])) {
- $nvalid = true;
- } else {
- $nvalid = $validator->isValid('info@' . $matches['name']);
- }
- return $dvalid && $nvalid;
-
- }
- return false;
- }
-
- /**
- * Set entry content
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setContent(DOMDocument $dom, DOMElement $root)
- {
- $content = $this->getDataContainer()->getContent();
- if (!$content && !$this->getDataContainer()->getLink()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 entry elements MUST contain exactly one '
- . 'atom:content element, or as an alternative, at least one link '
- . 'with a rel attribute of "alternate" to indicate an alternate '
- . 'method to consume the content.';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- if (!$content) {
- return;
- }
- $element = $dom->createElement('content');
- $element->setAttribute('type', 'xhtml');
- $xhtmlElement = $this->_loadXhtml($content);
- $xhtml = $dom->importNode($xhtmlElement, true);
- $element->appendChild($xhtml);
- $root->appendChild($element);
- }
-
- /**
- * Load a HTML string and attempt to normalise to XML
- */
- protected function _loadXhtml($content)
- {
- $xhtml = '';
- if (class_exists('tidy', false)) {
- $tidy = new tidy;
- $config = array(
- 'output-xhtml' => true,
- 'show-body-only' => true,
- 'quote-nbsp' => false
- );
- $encoding = str_replace('-', '', $this->getEncoding());
- $tidy->parseString($content, $config, $encoding);
- $tidy->cleanRepair();
- $xhtml = (string) $tidy;
- } else {
- $xhtml = $content;
- }
- $xhtml = preg_replace(array(
- "/(<[\/]?)([a-zA-Z]+)/"
- ), '$1xhtml:$2', $xhtml);
- $dom = new DOMDocument('1.0', $this->getEncoding());
-
- $dom = Zend_Xml_Security::scan(''
- . $xhtml . '', $dom);
- return $dom->documentElement;
- }
-
- /**
- * Set entry cateories
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCategories(DOMDocument $dom, DOMElement $root)
- {
- $categories = $this->getDataContainer()->getCategories();
- if (!$categories) {
- return;
- }
- foreach ($categories as $cat) {
- $category = $dom->createElement('category');
- $category->setAttribute('term', $cat['term']);
- if (isset($cat['label'])) {
- $category->setAttribute('label', $cat['label']);
- } else {
- $category->setAttribute('label', $cat['term']);
- }
- if (isset($cat['scheme'])) {
- $category->setAttribute('scheme', $cat['scheme']);
- }
- $root->appendChild($category);
- }
- }
-
- /**
- * Append Source element (Atom 1.0 Feed Metadata)
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setSource(DOMDocument $dom, DOMElement $root)
- {
- $source = $this->getDataContainer()->getSource();
- if (!$source) {
- return;
- }
- $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom_Source($source);
- $renderer->setType($this->getType());
- $element = $renderer->render()->getElement();
- $imported = $dom->importNode($element, true);
- $root->appendChild($imported);
- }
-}
diff --git a/library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php b/library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php
deleted file mode 100644
index 98ff5bd6b7..0000000000
--- a/library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php
+++ /dev/null
@@ -1,121 +0,0 @@
-_dom = new DOMDocument('1.0', $this->_container->getEncoding());
- $this->_dom->formatOutput = true;
- $entry = $this->_dom->createElement('at:deleted-entry');
- $this->_dom->appendChild($entry);
-
- $entry->setAttribute('ref', $this->_container->getReference());
- $entry->setAttribute('when', $this->_container->getWhen()->get(Zend_Date::ISO_8601));
-
- $this->_setBy($this->_dom, $entry);
- $this->_setComment($this->_dom, $entry);
-
- return $this;
- }
-
- /**
- * Set tombstone comment
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setComment(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getComment()) {
- return;
- }
- $c = $dom->createElement('at:comment');
- $root->appendChild($c);
- $c->setAttribute('type', 'html');
- $cdata = $dom->createCDATASection($this->getDataContainer()->getComment());
- $c->appendChild($cdata);
- }
-
- /**
- * Set entry authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setBy(DOMDocument $dom, DOMElement $root)
- {
- $data = $this->_container->getBy();
- if ((!$data || empty($data))) {
- return;
- }
- $author = $this->_dom->createElement('at:by');
- $name = $this->_dom->createElement('name');
- $author->appendChild($name);
- $root->appendChild($author);
- $text = $dom->createTextNode($data['name']);
- $name->appendChild($text);
- if (array_key_exists('email', $data)) {
- $email = $this->_dom->createElement('email');
- $author->appendChild($email);
- $text = $dom->createTextNode($data['email']);
- $email->appendChild($text);
- }
- if (array_key_exists('uri', $data)) {
- $uri = $this->_dom->createElement('uri');
- $author->appendChild($uri);
- $text = $dom->createTextNode($data['uri']);
- $uri->appendChild($text);
- }
- }
-
-}
diff --git a/library/Zend/Feed/Writer/Renderer/Entry/Rss.php b/library/Zend/Feed/Writer/Renderer/Entry/Rss.php
deleted file mode 100644
index cd03ced56d..0000000000
--- a/library/Zend/Feed/Writer/Renderer/Entry/Rss.php
+++ /dev/null
@@ -1,346 +0,0 @@
-_dom = new DOMDocument('1.0', $this->_container->getEncoding());
- $this->_dom->formatOutput = true;
- $this->_dom->substituteEntities = false;
- $entry = $this->_dom->createElement('item');
- $this->_dom->appendChild($entry);
-
- $this->_setTitle($this->_dom, $entry);
- $this->_setDescription($this->_dom, $entry);
- $this->_setDateCreated($this->_dom, $entry);
- $this->_setDateModified($this->_dom, $entry);
- $this->_setLink($this->_dom, $entry);
- $this->_setId($this->_dom, $entry);
- $this->_setAuthors($this->_dom, $entry);
- $this->_setEnclosure($this->_dom, $entry);
- $this->_setCommentLink($this->_dom, $entry);
- $this->_setCategories($this->_dom, $entry);
- foreach ($this->_extensions as $ext) {
- $ext->setType($this->getType());
- $ext->setRootElement($this->getRootElement());
- $ext->setDomDocument($this->getDomDocument(), $entry);
- $ext->render();
- }
-
- return $this;
- }
-
- /**
- * Set entry title
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setTitle(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDescription()
- && !$this->getDataContainer()->getTitle()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'RSS 2.0 entry elements SHOULD contain exactly one'
- . ' title element but a title has not been set. In addition, there'
- . ' is no description as required in the absence of a title.';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $title = $dom->createElement('title');
- $root->appendChild($title);
- $text = $dom->createTextNode($this->getDataContainer()->getTitle());
- $title->appendChild($text);
- }
-
- /**
- * Set entry description
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDescription(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDescription()
- && !$this->getDataContainer()->getTitle()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'RSS 2.0 entry elements SHOULD contain exactly one'
- . ' description element but a description has not been set. In'
- . ' addition, there is no title element as required in the absence'
- . ' of a description.';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- if (!$this->getDataContainer()->getDescription()) {
- return;
- }
- $subtitle = $dom->createElement('description');
- $root->appendChild($subtitle);
- $text = $dom->createCDATASection($this->getDataContainer()->getDescription());
- $subtitle->appendChild($text);
- }
-
- /**
- * Set date entry was last modified
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateModified(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDateModified()) {
- return;
- }
-
- $updated = $dom->createElement('pubDate');
- $root->appendChild($updated);
- $text = $dom->createTextNode(
- $this->getDataContainer()->getDateModified()->get(Zend_Date::RSS)
- );
- $updated->appendChild($text);
- }
-
- /**
- * Set date entry was created
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
- {
- if (!$this->getDataContainer()->getDateCreated()) {
- return;
- }
- if (!$this->getDataContainer()->getDateModified()) {
- $this->getDataContainer()->setDateModified(
- $this->getDataContainer()->getDateCreated()
- );
- }
- }
-
- /**
- * Set entry authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->_container->getAuthors();
- if ((!$authors || empty($authors))) {
- return;
- }
- foreach ($authors as $data) {
- $author = $this->_dom->createElement('author');
- $name = $data['name'];
- if (array_key_exists('email', $data)) {
- $name = $data['email'] . ' (' . $data['name'] . ')';
- }
- $text = $dom->createTextNode($name);
- $author->appendChild($text);
- $root->appendChild($author);
- }
- }
-
- /**
- * Set entry enclosure
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setEnclosure(DOMDocument $dom, DOMElement $root)
- {
- $data = $this->_container->getEnclosure();
- if ((!$data || empty($data))) {
- return;
- }
- if (!isset($data['type'])) {
- #require_once 'Zend/Feed/Exception.php';
- $exception = new Zend_Feed_Exception('Enclosure "type" is not set');
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- if (!isset($data['length'])) {
- #require_once 'Zend/Feed/Exception.php';
- $exception = new Zend_Feed_Exception('Enclosure "length" is not set');
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- if (isset($data['length']) && (int) $data['length'] <= 0) {
- #require_once 'Zend/Feed/Exception.php';
- $exception = new Zend_Feed_Exception('Enclosure "length" must be an integer'
- . ' indicating the content\'s length in bytes');
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $enclosure = $this->_dom->createElement('enclosure');
- $enclosure->setAttribute('type', $data['type']);
- $enclosure->setAttribute('length', $data['length']);
- $enclosure->setAttribute('url', $data['uri']);
- $root->appendChild($enclosure);
- }
-
- /**
- * Set link to entry
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setLink(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getLink()) {
- return;
- }
- $link = $dom->createElement('link');
- $root->appendChild($link);
- $text = $dom->createTextNode($this->getDataContainer()->getLink());
- $link->appendChild($text);
- }
-
- /**
- * Set entry identifier
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setId(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getId()
- && !$this->getDataContainer()->getLink()) {
- return;
- }
-
- $id = $dom->createElement('guid');
- $root->appendChild($id);
- if (!$this->getDataContainer()->getId()) {
- $this->getDataContainer()->setId(
- $this->getDataContainer()->getLink());
- }
- $text = $dom->createTextNode($this->getDataContainer()->getId());
- $id->appendChild($text);
- if (!Zend_Uri::check($this->getDataContainer()->getId())) {
- $id->setAttribute('isPermaLink', 'false');
- }
- }
-
- /**
- * Set link to entry comments
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCommentLink(DOMDocument $dom, DOMElement $root)
- {
- $link = $this->getDataContainer()->getCommentLink();
- if (!$link) {
- return;
- }
- $clink = $this->_dom->createElement('comments');
- $text = $dom->createTextNode($link);
- $clink->appendChild($text);
- $root->appendChild($clink);
- }
-
- /**
- * Set entry categories
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCategories(DOMDocument $dom, DOMElement $root)
- {
- $categories = $this->getDataContainer()->getCategories();
- if (!$categories) {
- return;
- }
- foreach ($categories as $cat) {
- $category = $dom->createElement('category');
- if (isset($cat['scheme'])) {
- $category->setAttribute('domain', $cat['scheme']);
- }
- $text = $dom->createCDATASection($cat['term']);
- $category->appendChild($text);
- $root->appendChild($category);
- }
- }
-}
diff --git a/library/Zend/Feed/Writer/Renderer/Feed/Atom.php b/library/Zend/Feed/Writer/Renderer/Feed/Atom.php
deleted file mode 100644
index 975ea7a2eb..0000000000
--- a/library/Zend/Feed/Writer/Renderer/Feed/Atom.php
+++ /dev/null
@@ -1,131 +0,0 @@
-_container->getEncoding()) {
- $this->_container->setEncoding('UTF-8');
- }
- $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding());
- $this->_dom->formatOutput = true;
- $root = $this->_dom->createElementNS(
- Zend_Feed_Writer::NAMESPACE_ATOM_10, 'feed'
- );
- $this->setRootElement($root);
- $this->_dom->appendChild($root);
- $this->_setLanguage($this->_dom, $root);
- $this->_setBaseUrl($this->_dom, $root);
- $this->_setTitle($this->_dom, $root);
- $this->_setDescription($this->_dom, $root);
- $this->_setImage($this->_dom, $root);
- $this->_setIcon($this->_dom, $root);
- $this->_setDateCreated($this->_dom, $root);
- $this->_setDateModified($this->_dom, $root);
- $this->_setGenerator($this->_dom, $root);
- $this->_setLink($this->_dom, $root);
- $this->_setFeedLinks($this->_dom, $root);
- $this->_setId($this->_dom, $root);
- $this->_setAuthors($this->_dom, $root);
- $this->_setCopyright($this->_dom, $root);
- $this->_setCategories($this->_dom, $root);
- $this->_setHubs($this->_dom, $root);
-
- foreach ($this->_extensions as $ext) {
- $ext->setType($this->getType());
- $ext->setRootElement($this->getRootElement());
- $ext->setDomDocument($this->getDomDocument(), $root);
- $ext->render();
- }
-
- foreach ($this->_container as $entry) {
- if ($this->getDataContainer()->getEncoding()) {
- $entry->setEncoding($this->getDataContainer()->getEncoding());
- }
- if ($entry instanceof Zend_Feed_Writer_Entry) {
- $renderer = new Zend_Feed_Writer_Renderer_Entry_Atom($entry);
- } else {
- if (!$this->_dom->documentElement->hasAttribute('xmlns:at')) {
- $this->_dom->documentElement->setAttribute(
- 'xmlns:at', 'http://purl.org/atompub/tombstones/1.0'
- );
- }
- $renderer = new Zend_Feed_Writer_Renderer_Entry_Atom_Deleted($entry);
- }
- if ($this->_ignoreExceptions === true) {
- $renderer->ignoreExceptions();
- }
- $renderer->setType($this->getType());
- $renderer->setRootElement($this->_dom->documentElement);
- $renderer->render();
- $element = $renderer->getElement();
- $imported = $this->_dom->importNode($element, true);
- $root->appendChild($imported);
- }
- return $this;
- }
-
-}
diff --git a/library/Zend/Feed/Writer/Renderer/Feed/Atom/AtomAbstract.php b/library/Zend/Feed/Writer/Renderer/Feed/Atom/AtomAbstract.php
deleted file mode 100644
index d8ff05f64e..0000000000
--- a/library/Zend/Feed/Writer/Renderer/Feed/Atom/AtomAbstract.php
+++ /dev/null
@@ -1,446 +0,0 @@
-getDataContainer()->getLanguage()) {
- $root->setAttribute('xml:lang', $this->getDataContainer()
- ->getLanguage());
- }
- }
-
- /**
- * Set feed title
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setTitle(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getTitle()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 feed elements MUST contain exactly one'
- . ' atom:title element but a title has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
-
- $title = $dom->createElement('title');
- $root->appendChild($title);
- $title->setAttribute('type', 'text');
- $text = $dom->createTextNode($this->getDataContainer()->getTitle());
- $title->appendChild($text);
- }
-
- /**
- * Set feed description
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDescription(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDescription()) {
- return;
- }
- $subtitle = $dom->createElement('subtitle');
- $root->appendChild($subtitle);
- $subtitle->setAttribute('type', 'text');
- $text = $dom->createTextNode($this->getDataContainer()->getDescription());
- $subtitle->appendChild($text);
- }
-
- /**
- * Set date feed was last modified
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateModified(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDateModified()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 feed elements MUST contain exactly one'
- . ' atom:updated element but a modification date has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
-
- $updated = $dom->createElement('updated');
- $root->appendChild($updated);
- $text = $dom->createTextNode(
- $this->getDataContainer()->getDateModified()->get(Zend_Date::ISO_8601)
- );
- $updated->appendChild($text);
- }
-
- /**
- * Set feed generator string
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setGenerator(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getGenerator()) {
- $this->getDataContainer()->setGenerator('Zend_Feed_Writer',
- Zend_Version::VERSION, 'http://framework.zend.com');
- }
-
- $gdata = $this->getDataContainer()->getGenerator();
- $generator = $dom->createElement('generator');
- $root->appendChild($generator);
- $text = $dom->createTextNode($gdata['name']);
- $generator->appendChild($text);
- if (array_key_exists('uri', $gdata)) {
- $generator->setAttribute('uri', $gdata['uri']);
- }
- if (array_key_exists('version', $gdata)) {
- $generator->setAttribute('version', $gdata['version']);
- }
- }
-
- /**
- * Set link to feed
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setLink(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getLink()) {
- return;
- }
- $link = $dom->createElement('link');
- $root->appendChild($link);
- $link->setAttribute('rel', 'alternate');
- $link->setAttribute('type', 'text/html');
- $link->setAttribute('href', $this->getDataContainer()->getLink());
- }
-
- /**
- * Set feed links
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setFeedLinks(DOMDocument $dom, DOMElement $root)
- {
- $flinks = $this->getDataContainer()->getFeedLinks();
- if(!$flinks || !array_key_exists('atom', $flinks)) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 feed elements SHOULD contain one atom:link '
- . 'element with a rel attribute value of "self". This is the '
- . 'preferred URI for retrieving Atom Feed Documents representing '
- . 'this Atom feed but a feed link has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
-
- foreach ($flinks as $type => $href) {
- $mime = 'application/' . strtolower($type) . '+xml';
- $flink = $dom->createElement('link');
- $root->appendChild($flink);
- $flink->setAttribute('rel', 'self');
- $flink->setAttribute('type', $mime);
- $flink->setAttribute('href', $href);
- }
- }
-
- /**
- * Set feed authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->_container->getAuthors();
- if (!$authors || empty($authors)) {
- /**
- * Technically we should defer an exception until we can check
- * that all entries contain an author. If any entry is missing
- * an author, then a missing feed author element is invalid
- */
- return;
- }
- foreach ($authors as $data) {
- $author = $this->_dom->createElement('author');
- $name = $this->_dom->createElement('name');
- $author->appendChild($name);
- $root->appendChild($author);
- $text = $dom->createTextNode($data['name']);
- $name->appendChild($text);
- if (array_key_exists('email', $data)) {
- $email = $this->_dom->createElement('email');
- $author->appendChild($email);
- $text = $dom->createTextNode($data['email']);
- $email->appendChild($text);
- }
- if (array_key_exists('uri', $data)) {
- $uri = $this->_dom->createElement('uri');
- $author->appendChild($uri);
- $text = $dom->createTextNode($data['uri']);
- $uri->appendChild($text);
- }
- }
- }
-
- /**
- * Set feed identifier
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setId(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getId()
- && !$this->getDataContainer()->getLink()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Atom 1.0 feed elements MUST contain exactly one '
- . 'atom:id element, or as an alternative, we can use the same '
- . 'value as atom:link however neither a suitable link nor an '
- . 'id have been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
-
- if (!$this->getDataContainer()->getId()) {
- $this->getDataContainer()->setId(
- $this->getDataContainer()->getLink());
- }
- $id = $dom->createElement('id');
- $root->appendChild($id);
- $text = $dom->createTextNode($this->getDataContainer()->getId());
- $id->appendChild($text);
- }
-
- /**
- * Set feed copyright
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCopyright(DOMDocument $dom, DOMElement $root)
- {
- $copyright = $this->getDataContainer()->getCopyright();
- if (!$copyright) {
- return;
- }
- $copy = $dom->createElement('rights');
- $root->appendChild($copy);
- $text = $dom->createTextNode($copyright);
- $copy->appendChild($text);
- }
-
- /**
- * Set feed level logo (image)
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setImage(DOMDocument $dom, DOMElement $root)
- {
- $image = $this->getDataContainer()->getImage();
- if (!$image) {
- return;
- }
- $img = $dom->createElement('logo');
- $root->appendChild($img);
- $text = $dom->createTextNode($image['uri']);
- $img->appendChild($text);
- }
-
- /**
- * Set feed level icon (image)
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setIcon(DOMDocument $dom, DOMElement $root)
- {
- $image = $this->getDataContainer()->getIcon();
- if (!$image) {
- return;
- }
- $img = $dom->createElement('icon');
- $root->appendChild($img);
- $text = $dom->createTextNode($image['uri']);
- $img->appendChild($text);
- }
-
- /**
- * Set date feed was created
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDateCreated()) {
- return;
- }
- if(!$this->getDataContainer()->getDateModified()) {
- $this->getDataContainer()->setDateModified(
- $this->getDataContainer()->getDateCreated()
- );
- }
- }
-
- /**
- * Set base URL to feed links
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setBaseUrl(DOMDocument $dom, DOMElement $root)
- {
- $baseUrl = $this->getDataContainer()->getBaseUrl();
- if (!$baseUrl) {
- return;
- }
- $root->setAttribute('xml:base', $baseUrl);
- }
-
- /**
- * Set hubs to which this feed pushes
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setHubs(DOMDocument $dom, DOMElement $root)
- {
- $hubs = $this->getDataContainer()->getHubs();
- if (!$hubs) {
- return;
- }
- foreach ($hubs as $hubUrl) {
- $hub = $dom->createElement('link');
- $hub->setAttribute('rel', 'hub');
- $hub->setAttribute('href', $hubUrl);
- $root->appendChild($hub);
- }
- }
-
- /**
- * Set feed cateories
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCategories(DOMDocument $dom, DOMElement $root)
- {
- $categories = $this->getDataContainer()->getCategories();
- if (!$categories) {
- return;
- }
- foreach ($categories as $cat) {
- $category = $dom->createElement('category');
- $category->setAttribute('term', $cat['term']);
- if (isset($cat['label'])) {
- $category->setAttribute('label', $cat['label']);
- } else {
- $category->setAttribute('label', $cat['term']);
- }
- if (isset($cat['scheme'])) {
- $category->setAttribute('scheme', $cat['scheme']);
- }
- $root->appendChild($category);
- }
- }
-}
diff --git a/library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php b/library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php
deleted file mode 100644
index a97bfedea7..0000000000
--- a/library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php
+++ /dev/null
@@ -1,110 +0,0 @@
-_container->getEncoding()) {
- $this->_container->setEncoding('UTF-8');
- }
- $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding());
- $this->_dom->formatOutput = true;
- $root = $this->_dom->createElement('source');
- $this->setRootElement($root);
- $this->_dom->appendChild($root);
- $this->_setLanguage($this->_dom, $root);
- $this->_setBaseUrl($this->_dom, $root);
- $this->_setTitle($this->_dom, $root);
- $this->_setDescription($this->_dom, $root);
- $this->_setDateCreated($this->_dom, $root);
- $this->_setDateModified($this->_dom, $root);
- $this->_setGenerator($this->_dom, $root);
- $this->_setLink($this->_dom, $root);
- $this->_setFeedLinks($this->_dom, $root);
- $this->_setId($this->_dom, $root);
- $this->_setAuthors($this->_dom, $root);
- $this->_setCopyright($this->_dom, $root);
- $this->_setCategories($this->_dom, $root);
-
- foreach ($this->_extensions as $ext) {
- $ext->setType($this->getType());
- $ext->setRootElement($this->getRootElement());
- $ext->setDomDocument($this->getDomDocument(), $root);
- $ext->render();
- }
- return $this;
- }
-
- /**
- * Set feed generator string
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setGenerator(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getGenerator()) {
- return;
- }
-
- $gdata = $this->getDataContainer()->getGenerator();
- $generator = $dom->createElement('generator');
- $root->appendChild($generator);
- $text = $dom->createTextNode($gdata['name']);
- $generator->appendChild($text);
- if (array_key_exists('uri', $gdata)) {
- $generator->setAttribute('uri', $gdata['uri']);
- }
- if (array_key_exists('version', $gdata)) {
- $generator->setAttribute('version', $gdata['version']);
- }
- }
-
-}
diff --git a/library/Zend/Feed/Writer/Renderer/Feed/Rss.php b/library/Zend/Feed/Writer/Renderer/Feed/Rss.php
deleted file mode 100644
index 5068ca9df3..0000000000
--- a/library/Zend/Feed/Writer/Renderer/Feed/Rss.php
+++ /dev/null
@@ -1,505 +0,0 @@
-_container->getEncoding()) {
- $this->_container->setEncoding('UTF-8');
- }
- $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding());
- $this->_dom->formatOutput = true;
- $this->_dom->substituteEntities = false;
- $rss = $this->_dom->createElement('rss');
- $this->setRootElement($rss);
- $rss->setAttribute('version', '2.0');
-
- $channel = $this->_dom->createElement('channel');
- $rss->appendChild($channel);
- $this->_dom->appendChild($rss);
- $this->_setLanguage($this->_dom, $channel);
- $this->_setBaseUrl($this->_dom, $channel);
- $this->_setTitle($this->_dom, $channel);
- $this->_setDescription($this->_dom, $channel);
- $this->_setImage($this->_dom, $channel);
- $this->_setDateCreated($this->_dom, $channel);
- $this->_setDateModified($this->_dom, $channel);
- $this->_setLastBuildDate($this->_dom, $channel);
- $this->_setGenerator($this->_dom, $channel);
- $this->_setLink($this->_dom, $channel);
- $this->_setAuthors($this->_dom, $channel);
- $this->_setCopyright($this->_dom, $channel);
- $this->_setCategories($this->_dom, $channel);
-
- foreach ($this->_extensions as $ext) {
- $ext->setType($this->getType());
- $ext->setRootElement($this->getRootElement());
- $ext->setDomDocument($this->getDomDocument(), $channel);
- $ext->render();
- }
-
- foreach ($this->_container as $entry) {
- if ($this->getDataContainer()->getEncoding()) {
- $entry->setEncoding($this->getDataContainer()->getEncoding());
- }
- if ($entry instanceof Zend_Feed_Writer_Entry) {
- $renderer = new Zend_Feed_Writer_Renderer_Entry_Rss($entry);
- } else {
- continue;
- }
- if ($this->_ignoreExceptions === true) {
- $renderer->ignoreExceptions();
- }
- $renderer->setType($this->getType());
- $renderer->setRootElement($this->_dom->documentElement);
- $renderer->render();
- $element = $renderer->getElement();
- $imported = $this->_dom->importNode($element, true);
- $channel->appendChild($imported);
- }
- return $this;
- }
-
- /**
- * Set feed language
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setLanguage(DOMDocument $dom, DOMElement $root)
- {
- $lang = $this->getDataContainer()->getLanguage();
- if (!$lang) {
- return;
- }
- $language = $dom->createElement('language');
- $root->appendChild($language);
- $language->nodeValue = $lang;
- }
-
- /**
- * Set feed title
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setTitle(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getTitle()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'RSS 2.0 feed elements MUST contain exactly one'
- . ' title element but a title has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
-
- $title = $dom->createElement('title');
- $root->appendChild($title);
- $text = $dom->createTextNode($this->getDataContainer()->getTitle());
- $title->appendChild($text);
- }
-
- /**
- * Set feed description
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDescription(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDescription()) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'RSS 2.0 feed elements MUST contain exactly one'
- . ' description element but one has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $subtitle = $dom->createElement('description');
- $root->appendChild($subtitle);
- $text = $dom->createTextNode($this->getDataContainer()->getDescription());
- $subtitle->appendChild($text);
- }
-
- /**
- * Set date feed was last modified
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateModified(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDateModified()) {
- return;
- }
-
- $updated = $dom->createElement('pubDate');
- $root->appendChild($updated);
- $text = $dom->createTextNode(
- $this->getDataContainer()->getDateModified()->get(Zend_Date::RSS)
- );
- $updated->appendChild($text);
- }
-
- /**
- * Set feed generator string
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setGenerator(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getGenerator()) {
- $this->getDataContainer()->setGenerator('Zend_Feed_Writer',
- Zend_Version::VERSION, 'http://framework.zend.com');
- }
-
- $gdata = $this->getDataContainer()->getGenerator();
- $generator = $dom->createElement('generator');
- $root->appendChild($generator);
- $name = $gdata['name'];
- if (array_key_exists('version', $gdata)) {
- $name .= ' ' . $gdata['version'];
- }
- if (array_key_exists('uri', $gdata)) {
- $name .= ' (' . $gdata['uri'] . ')';
- }
- $text = $dom->createTextNode($name);
- $generator->appendChild($text);
- }
-
- /**
- * Set link to feed
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setLink(DOMDocument $dom, DOMElement $root)
- {
- $value = $this->getDataContainer()->getLink();
- if(!$value) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'RSS 2.0 feed elements MUST contain exactly one'
- . ' link element but one has not been set';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $link = $dom->createElement('link');
- $root->appendChild($link);
- $text = $dom->createTextNode($value);
- $link->appendChild($text);
- if (!Zend_Uri::check($value)) {
- $link->setAttribute('isPermaLink', 'false');
- }
- }
-
- /**
- * Set feed authors
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setAuthors(DOMDocument $dom, DOMElement $root)
- {
- $authors = $this->getDataContainer()->getAuthors();
- if (!$authors || empty($authors)) {
- return;
- }
- foreach ($authors as $data) {
- $author = $this->_dom->createElement('author');
- $name = $data['name'];
- if (array_key_exists('email', $data)) {
- $name = $data['email'] . ' (' . $data['name'] . ')';
- }
- $text = $dom->createTextNode($name);
- $author->appendChild($text);
- $root->appendChild($author);
- }
- }
-
- /**
- * Set feed copyright
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCopyright(DOMDocument $dom, DOMElement $root)
- {
- $copyright = $this->getDataContainer()->getCopyright();
- if (!$copyright) {
- return;
- }
- $copy = $dom->createElement('copyright');
- $root->appendChild($copy);
- $text = $dom->createTextNode($copyright);
- $copy->appendChild($text);
- }
-
- /**
- * Set feed channel image
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setImage(DOMDocument $dom, DOMElement $root)
- {
- $image = $this->getDataContainer()->getImage();
- if (!$image) {
- return;
- }
- if (!isset($image['title']) || empty($image['title'])
- || !is_string($image['title'])) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'RSS 2.0 feed images must include a title';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- if (empty($image['link']) || !is_string($image['link'])
- || !Zend_Uri::check($image['link'])) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Invalid parameter: parameter \'link\''
- . ' must be a non-empty string and valid URI/IRI';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $img = $dom->createElement('image');
- $root->appendChild($img);
- $url = $dom->createElement('url');
- $text = $dom->createTextNode($image['uri']);
- $url->appendChild($text);
- $title = $dom->createElement('title');
- $text = $dom->createTextNode($image['title']);
- $title->appendChild($text);
- $link = $dom->createElement('link');
- $text = $dom->createTextNode($image['link']);
- $link->appendChild($text);
- $img->appendChild($url);
- $img->appendChild($title);
- $img->appendChild($link);
- if (isset($image['height'])) {
- if (!ctype_digit((string) $image['height']) || $image['height'] > 400) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Invalid parameter: parameter \'height\''
- . ' must be an integer not exceeding 400';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $height = $dom->createElement('height');
- $text = $dom->createTextNode($image['height']);
- $height->appendChild($text);
- $img->appendChild($height);
- }
- if (isset($image['width'])) {
- if (!ctype_digit((string) $image['width']) || $image['width'] > 144) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Invalid parameter: parameter \'width\''
- . ' must be an integer not exceeding 144';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $width = $dom->createElement('width');
- $text = $dom->createTextNode($image['width']);
- $width->appendChild($text);
- $img->appendChild($width);
- }
- if (isset($image['description'])) {
- if (empty($image['description']) || !is_string($image['description'])) {
- #require_once 'Zend/Feed/Exception.php';
- $message = 'Invalid parameter: parameter \'description\''
- . ' must be a non-empty string';
- $exception = new Zend_Feed_Exception($message);
- if (!$this->_ignoreExceptions) {
- throw $exception;
- } else {
- $this->_exceptions[] = $exception;
- return;
- }
- }
- $desc = $dom->createElement('description');
- $text = $dom->createTextNode($image['description']);
- $desc->appendChild($text);
- $img->appendChild($desc);
- }
- }
-
- /**
- * Set date feed was created
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getDateCreated()) {
- return;
- }
- if(!$this->getDataContainer()->getDateModified()) {
- $this->getDataContainer()->setDateModified(
- $this->getDataContainer()->getDateCreated()
- );
- }
- }
-
- /**
- * Set date feed last build date
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setLastBuildDate(DOMDocument $dom, DOMElement $root)
- {
- if(!$this->getDataContainer()->getLastBuildDate()) {
- return;
- }
-
- $lastBuildDate = $dom->createElement('lastBuildDate');
- $root->appendChild($lastBuildDate);
- $text = $dom->createTextNode(
- $this->getDataContainer()->getLastBuildDate()->get(Zend_Date::RSS)
- );
- $lastBuildDate->appendChild($text);
- }
-
- /**
- * Set base URL to feed links
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setBaseUrl(DOMDocument $dom, DOMElement $root)
- {
- $baseUrl = $this->getDataContainer()->getBaseUrl();
- if (!$baseUrl) {
- return;
- }
- $root->setAttribute('xml:base', $baseUrl);
- }
-
- /**
- * Set feed categories
- *
- * @param DOMDocument $dom
- * @param DOMElement $root
- * @return void
- */
- protected function _setCategories(DOMDocument $dom, DOMElement $root)
- {
- $categories = $this->getDataContainer()->getCategories();
- if (!$categories) {
- return;
- }
- foreach ($categories as $cat) {
- $category = $dom->createElement('category');
- if (isset($cat['scheme'])) {
- $category->setAttribute('domain', $cat['scheme']);
- }
- $text = $dom->createTextNode($cat['term']);
- $category->appendChild($text);
- $root->appendChild($category);
- }
- }
-}
diff --git a/library/Zend/Feed/Writer/Renderer/RendererAbstract.php b/library/Zend/Feed/Writer/Renderer/RendererAbstract.php
deleted file mode 100644
index 50b0760238..0000000000
--- a/library/Zend/Feed/Writer/Renderer/RendererAbstract.php
+++ /dev/null
@@ -1,250 +0,0 @@
-_container = $container;
- $this->setType($container->getType());
- $this->_loadExtensions();
- }
-
- /**
- * Save XML to string
- *
- * @return string
- */
- public function saveXml()
- {
- return $this->getDomDocument()->saveXml();
- }
-
- /**
- * Get DOM document
- *
- * @return DOMDocument
- */
- public function getDomDocument()
- {
- return $this->_dom;
- }
-
- /**
- * Get document element from DOM
- *
- * @return DOMElement
- */
- public function getElement()
- {
- return $this->getDomDocument()->documentElement;
- }
-
- /**
- * Get data container of items being rendered
- *
- * @return mixed
- */
- public function getDataContainer()
- {
- return $this->_container;
- }
-
- /**
- * Set feed encoding
- *
- * @param string $enc
- * @return Zend_Feed_Writer_Renderer_RendererAbstract
- */
- public function setEncoding($enc)
- {
- $this->_encoding = $enc;
- return $this;
- }
-
- /**
- * Get feed encoding
- *
- * @return string
- */
- public function getEncoding()
- {
- return $this->_encoding;
- }
-
- /**
- * Indicate whether or not to ignore exceptions
- *
- * @param bool $bool
- * @return Zend_Feed_Writer_Renderer_RendererAbstract
- */
- public function ignoreExceptions($bool = true)
- {
- if (!is_bool($bool)) {
- #require_once 'Zend/Feed/Exception.php';
- throw new Zend_Feed_Exception('Invalid parameter: $bool. Should be TRUE or FALSE (defaults to TRUE if null)');
- }
- $this->_ignoreExceptions = $bool;
- return $this;
- }
-
- /**
- * Get exception list
- *
- * @return array
- */
- public function getExceptions()
- {
- return $this->_exceptions;
- }
-
- /**
- * Set the current feed type being exported to "rss" or "atom". This allows
- * other objects to gracefully choose whether to execute or not, depending
- * on their appropriateness for the current type, e.g. renderers.
- *
- * @param string $type
- */
- public function setType($type)
- {
- $this->_type = $type;
- }
-
- /**
- * Retrieve the current or last feed type exported.
- *
- * @return string Value will be "rss" or "atom"
- */
- public function getType()
- {
- return $this->_type;
- }
-
- /**
- * Sets the absolute root element for the XML feed being generated. This
- * helps simplify the appending of namespace declarations, but also ensures
- * namespaces are added to the root element - not scattered across the entire
- * XML file - may assist namespace unsafe parsers and looks pretty ;).
- *
- * @param DOMElement $root
- */
- public function setRootElement(DOMElement $root)
- {
- $this->_rootElement = $root;
- }
-
- /**
- * Retrieve the absolute root element for the XML feed being generated.
- *
- * @return DOMElement
- */
- public function getRootElement()
- {
- return $this->_rootElement;
- }
-
- /**
- * Load extensions from Zend_Feed_Writer
- *
- * @return void
- */
- protected function _loadExtensions()
- {
- Zend_Feed_Writer::registerCoreExtensions();
- $all = Zend_Feed_Writer::getExtensions();
- if (stripos(get_class($this), 'entry')) {
- $exts = $all['entryRenderer'];
- } else {
- $exts = $all['feedRenderer'];
- }
- foreach ($exts as $extension) {
- $className = Zend_Feed_Writer::getPluginLoader()->getClassName($extension);
- $this->_extensions[$extension] = new $className(
- $this->getDataContainer()
- );
- $this->_extensions[$extension]->setEncoding($this->getEncoding());
- }
- }
-}
diff --git a/library/Zend/Feed/Writer/Renderer/RendererInterface.php b/library/Zend/Feed/Writer/Renderer/RendererInterface.php
deleted file mode 100644
index 7bd04a012a..0000000000
--- a/library/Zend/Feed/Writer/Renderer/RendererInterface.php
+++ /dev/null
@@ -1,111 +0,0 @@
-markTestSkipped('ONLINE feed tests are not enabled');
- }
- $this->baseUri = rtrim(constant('TESTS_ZEND_FEED_IMPORT_ONLINE_BASEURI'), '/');
- Zend_Feed::setHttpClient(new Zend_Http_Client());
- }
-
- public function tearDown()
- {
- if (!$this->baseUri) {
- return parent::tearDown();
- }
-
- $basePath = dirname(__FILE__) . '/_files/';
- foreach ($this->remoteFeedNames as $file) {
- $filename = $basePath . $file;
- if (!file_exists($filename)) {
- continue;
- }
- unlink($filename);
- }
- }
-
- public function prepareFeed($filename)
- {
- $basePath = dirname(__FILE__) . '/_files/';
- $path = $basePath . $filename;
- $remote = str_replace('.xml', '.remote.xml', $filename);
- $string = file_get_contents($path);
- $string = str_replace('XXE_URI', $this->baseUri . '/xxe-info.txt', $string);
- file_put_contents($basePath . '/' . $remote, $string);
- return $remote;
- }
-}
diff --git a/tests/Zend/Feed/AllTests.php b/tests/Zend/Feed/AllTests.php
deleted file mode 100644
index 24eb242b07..0000000000
--- a/tests/Zend/Feed/AllTests.php
+++ /dev/null
@@ -1,143 +0,0 @@
-addTestSuite('Zend_Feed_ArrayAccessTest');
- $suite->addTestSuite('Zend_Feed_AtomEntryOnlyTest');
- $suite->addTestSuite('Zend_Feed_AtomPublishingTest');
- $suite->addTestSuite('Zend_Feed_CountTest');
- $suite->addTestSuite('Zend_Feed_ElementTest');
- $suite->addTestSuite('Zend_Feed_ImportTest');
- $suite->addTestSuite('Zend_Feed_IteratorTest');
- $suite->addTestSuite('Zend_Feed_Entry_RssTest');
- $suite->addTestSuite('Zend_Feed_AtomTest');
- $suite->addTestSuite('Zend_Feed_RssTest');
-
- /* Zend_Feed_Reader tests */
- // Base parent class
- $suite->addTestSuite('Zend_Feed_ReaderTest');
- // RSS - Feed Level
- $suite->addTestSuite('Zend_Feed_Reader_Feed_RssTest');
- // RSS - Item Level
- $suite->addTestSuite('Zend_Feed_Reader_Entry_RssTest');
- // ATOM - Feed Level
- $suite->addTestSuite('Zend_Feed_Reader_Feed_AtomTest');
- // ATOM - Item Level
- $suite->addTestSuite('Zend_Feed_Reader_Entry_AtomTest');
- // COMMON - Feed Level
- $suite->addTestSuite('Zend_Feed_Reader_Feed_CommonTest');
- // COMMON - Entry Level
- $suite->addTestSuite('Zend_Feed_Reader_Entry_CommonTest');
- // ATOM - Entry Level (Source Feed Metadata)
- $suite->addTestSuite('Zend_Feed_Reader_Feed_AtomSourceTest');
- // ATOM - Entry Level (Standalone Entry Documents)
- $suite->addTestSuite('Zend_Feed_Reader_Entry_AtomStandaloneEntryTest');
- /**
- * Real World Feed Tests
- */
- $suite->addTestSuite('Zend_Feed_Reader_Integration_WordpressRss2DcAtomTest');
- $suite->addTestSuite('Zend_Feed_Reader_Integration_WordpressAtom10Test');
- $suite->addTestSuite('Zend_Feed_Reader_Integration_LautDeRdfTest');
- $suite->addTestSuite('Zend_Feed_Reader_Integration_HOnlineComAtom10Test');
-
- $suite->addTestSuite('Zend_Feed_Writer_FeedTest');
- $suite->addTestSuite('Zend_Feed_Writer_EntryTest');
- $suite->addTestSuite('Zend_Feed_Writer_DeletedTest');
- $suite->addTestSuite('Zend_Feed_Writer_Renderer_Feed_AtomTest');
- $suite->addTestSuite('Zend_Feed_Writer_Renderer_Feed_RssTest');
- $suite->addTestSuite('Zend_Feed_Writer_Renderer_Entry_AtomTest');
- $suite->addTestSuite('Zend_Feed_Writer_Renderer_Entry_RssTest');
-
- $suite->addTestSuite('Zend_Feed_Writer_Extension_ITunes_EntryTest');
- $suite->addTestSuite('Zend_Feed_Writer_Extension_ITunes_FeedTest');
-
- $suite->addTest(Zend_Feed_Pubsubhubbub_AllTests::suite());
-
- return $suite;
- }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Zend_Feed_AllTests::main') {
- Zend_Feed_AllTests::main();
-}
diff --git a/tests/Zend/Feed/ArrayAccessTest.php b/tests/Zend/Feed/ArrayAccessTest.php
deleted file mode 100644
index 5ecd6e4e11..0000000000
--- a/tests/Zend/Feed/ArrayAccessTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-_feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml');
- $this->_nsfeed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeedNamespaced.xml');
- }
-
- public function testExists()
- {
- $this->assertFalse(isset($this->_feed[-1]), 'Negative array access should fail');
- $this->assertTrue(isset($this->_feed['version']), 'Feed version should be set');
-
- $this->assertFalse(isset($this->_nsfeed[-1]), 'Negative array access should fail');
- $this->assertTrue(isset($this->_nsfeed['version']), 'Feed version should be set');
- }
-
- public function testGet()
- {
- $this->assertEquals($this->_feed['version'], '1.0', 'Feed version should be 1.0');
- $this->assertEquals($this->_nsfeed['version'], '1.0', 'Feed version should be 1.0');
- }
-
- public function testSet()
- {
- $this->_feed['category'] = 'tests';
- $this->assertTrue(isset($this->_feed['category']), 'Feed category should be set');
- $this->assertEquals($this->_feed['category'], 'tests', 'Feed category should be tests');
-
- $this->_nsfeed['atom:category'] = 'tests';
- $this->assertTrue(isset($this->_nsfeed['atom:category']), 'Feed category should be set');
- $this->assertEquals($this->_nsfeed['atom:category'], 'tests', 'Feed category should be tests');
-
- // Changing an existing index.
- $oldEntry = $this->_feed['version'];
- $this->_feed['version'] = '1.1';
- $this->assertTrue($oldEntry != $this->_feed['version'], 'Version should have changed');
- }
-
- public function testUnset()
- {
- $feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml');
- unset($feed['version']);
- $this->assertFalse(isset($feed['version']), 'Version should be unset');
- $this->assertEquals('', $feed['version'], 'Version should be equal to the empty string');
-
- $nsfeed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeedNamespaced.xml');
- unset($nsfeed['version']);
- $this->assertFalse(isset($nsfeed['version']), 'Version should be unset');
- $this->assertEquals('', $nsfeed['version'], 'Version should be equal to the empty string');
- }
-
- /**
- * @group ZF-5354
- */
- public function testGetsLinkWithEmptyOrMissingRelAsAlternateRel()
- {
- $feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/AtomHOnline.xml');
- $entry = $feed->current();
- $this->assertEquals('http://www.h-online.com/security/Google-acquires-reCAPTCHA--/news/114266/from/rss', $entry->link('alternate'));
- }
-
-}
diff --git a/tests/Zend/Feed/AtomEntryOnlyTest.php b/tests/Zend/Feed/AtomEntryOnlyTest.php
deleted file mode 100644
index efe858ea86..0000000000
--- a/tests/Zend/Feed/AtomEntryOnlyTest.php
+++ /dev/null
@@ -1,58 +0,0 @@
-assertEquals(1, $feed->count(), 'The entry-only feed should report one entry.');
-
- foreach ($feed as $entry);
- $this->assertEquals('Zend_Feed_Entry_Atom', get_class($entry),
- 'The single entry should be an instance of Zend_Feed_Entry_Atom');
-
- $this->assertEquals('1', $entry->id(), 'The single entry should have id 1');
- $this->assertEquals('Bug', $entry->title(), 'The entry\'s title should be "Bug"');
- }
-
-}
diff --git a/tests/Zend/Feed/AtomPublishingTest.php b/tests/Zend/Feed/AtomPublishingTest.php
deleted file mode 100644
index 53d5be42c7..0000000000
--- a/tests/Zend/Feed/AtomPublishingTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-_uri = 'http://fubar.com/myFeed';
- }
-
- public function tearDown()
- {
- Zend_Feed::setHttpClient(new Zend_Http_Client());
- }
-
- public function testPost()
- {
- Zend_Feed::setHttpClient(new TestClient());
-
- $entry = new Zend_Feed_Entry_Atom();
-
- /* Give the entry its initial values. */
- $entry->title = 'Entry 1';
- $entry->content = '1.1';
- $entry->content['type'] = 'text';
-
- /* Do the initial post. The base feed URI is the same as the
- * POST URI, so just supply save() with that. */
- $entry->save($this->_uri);
-
- /* $entry will be filled in with any elements returned by the
- * server (id, updated, link rel="edit", etc). */
- $this->assertEquals('1', $entry->id(), 'Expected id to be 1');
- $this->assertEquals('Entry 1', $entry->title(), 'Expected title to be "Entry 1"');
- $this->assertEquals('1.1', $entry->content(), 'Expected content to be "1.1"');
- $this->assertEquals('text', $entry->content['type'], 'Expected content/type to be "text"');
- $this->assertEquals('2005-05-23T16:26:00-08:00', $entry->updated(), 'Expected updated date of 2005-05-23T16:26:00-08:00');
- $this->assertEquals('http://fubar.com/myFeed/1/1/', $entry->link('edit'), 'Expected edit URI of http://fubar.com/myFeed/1/1/');
- }
-
- public function testEdit()
- {
- Zend_Feed::setHttpClient(new TestClient());
- $contents = file_get_contents(dirname(__FILE__) . '/_files/AtomPublishingTest-before-update.xml');
-
- /* The base feed URI is the same as the POST URI, so just supply the
- * Zend_Feed_Entry_Atom object with that. */
- $entry = new Zend_Feed_Entry_Atom($this->_uri, $contents);
-
- /* Initial state. */
- $this->assertEquals('2005-05-23T16:26:00-08:00', $entry->updated(), 'Initial state of updated timestamp does not match');
- $this->assertEquals('http://fubar.com/myFeed/1/1/', $entry->link('edit'), 'Initial state of edit link does not match');
-
- /* Just change the entry's properties directly. */
- $entry->content = '1.2';
-
- /* Then save the changes. */
- $entry->save();
-
- /* New state. */
- $this->assertEquals('1.2', $entry->content(), 'Content change did not stick');
- $this->assertEquals('2005-05-23T16:27:00-08:00', $entry->updated(), 'New updated link is not correct');
- $this->assertEquals('http://fubar.com/myFeed/1/2/', $entry->link('edit'), 'New edit link is not correct');
- }
-}
-
-/**
- * A test wrapper around Zend_Http_Client, not actually performing
- * the request.
- *
- */
-class TestClient extends Zend_Http_Client
-{
- public function request($method = null)
- {
- $code = 400;
- $body = '';
-
- switch ($method) {
- case self::POST:
- $code = 201;
- $body = file_get_contents(dirname(__FILE__) . '/_files/AtomPublishingTest-created-entry.xml');
- break;
-
- case self::PUT:
- $doc1 = new DOMDocument();
- $doc1->load(dirname(__FILE__) . '/_files/AtomPublishingTest-expected-update.xml');
- $doc2 = new DOMDocument();
- $doc2->loadXML($this->raw_post_data);
- if ($doc1->saveXml() == $doc2->saveXml()) {
- $code = 200;
- $body = file_get_contents(dirname(__FILE__) . '/_files/AtomPublishingTest-updated-entry.xml');
- }
- break;
-
- default:
- break;
- }
-
- return new Zend_Http_Response($code, array(), $body);
- }
-}
diff --git a/tests/Zend/Feed/AtomTest.php b/tests/Zend/Feed/AtomTest.php
deleted file mode 100644
index abd3ba5870..0000000000
--- a/tests/Zend/Feed/AtomTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-baseUri . '/' . $this->prepareFeed('zend_feed_atom_xxe.xml');
- $this->setExpectedException('Zend_Feed_Exception', 'parse');
- $feed = new Zend_Feed_Atom($uri);
- }
-}
-
diff --git a/tests/Zend/Feed/CountTest.php b/tests/Zend/Feed/CountTest.php
deleted file mode 100644
index da1b12cb26..0000000000
--- a/tests/Zend/Feed/CountTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-assertEquals($f->count(), 2, 'Feed count should be 2');
- }
-
- /**
- * ZF-3848
- */
- public function testCountableInterface()
- {
- $f = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml');
- $this->assertEquals(count($f), 2, 'Feed count should be 2');
- }
-
-}
diff --git a/tests/Zend/Feed/ElementTest.php b/tests/Zend/Feed/ElementTest.php
deleted file mode 100644
index 6baec5505f..0000000000
--- a/tests/Zend/Feed/ElementTest.php
+++ /dev/null
@@ -1,165 +0,0 @@
-author->name['last'] = 'hagenbuch';
- $e->author->name['first'] = 'chuck';
- $e->author->name->{'chuck:url'} = 'marina.horde.org';
-
- $e->author->title['foo'] = 'bar';
- if ($e->pants()) {
- $this->fail(' does not exist, it should not have a true value');
- // This should not create an element in the actual tree.
- }
- if ($e->pants()) {
- $this->fail(' should not have been created by testing for it');
- // This should not create an element in the actual tree.
- }
-
- $xml = $e->saveXml();
-
- $this->assertFalse(strpos($xml, 'pants'), ' should not be in the xml output');
- $this->assertTrue(strpos($xml, 'marina.horde.org') !== false, 'the url attribute should be set');
- }
-
- public function testStrings()
- {
- $xml = "
- Using C++ Intrinsic Functions for Pipelined Text Processing
- http://www.oreillynet.com/pub/wlg/8356
-
-
-
- A good C++ programming technique that has almost no published material available on the WWW relates to using the special pipeline instructions in modern CPUs for faster text processing. Here's example code using C++ intrinsic functions to give a fourfold speed increase for a UTF-8 to UTF-16 converter compared to the original C/C++ code.
-
-
- Rick Jelliffe
- 2005-11-07T08:15:57-08:00
-";
-
- $entry = new Zend_Feed_Entry_Atom('uri', $xml);
-
- $this->assertTrue($entry->summary instanceof Zend_Feed_Element, '__get access should return an Zend_Feed_Element instance');
- $this->assertFalse($entry->summary() instanceof Zend_Feed_Element, 'method access should not return an Zend_Feed_Element instance');
- $this->assertTrue(is_string($entry->summary()), 'method access should return a string');
- $this->assertFalse(is_string($entry->summary), '__get access should not return a string');
- }
-
- public function testSetNamespacedAttributes()
- {
- $value = 'value';
-
- $e = new Zend_Feed_Entry_Atom();
- $e->test['attr'] = $value;
- $e->test['namespace1:attr'] = $value;
- $e->test['namespace2:attr'] = $value;
-
- $this->assertEquals($value, $e->test['attr']);
- $this->assertEquals($value, $e->test['namespace1:attr']);
- $this->assertEquals($value, $e->test['namespace2:attr']);
- }
-
- public function testUnsetNamespacedAttributes()
- {
- $value = 'value';
-
- $e = new Zend_Feed_Entry_Atom();
- $e->test['attr'] = $value;
- $e->test['namespace1:attr'] = $value;
- $e->test['namespace2:attr'] = $value;
-
- $this->assertEquals($value, $e->test['attr']);
- $this->assertEquals($value, $e->test['namespace1:attr']);
- $this->assertEquals($value, $e->test['namespace2:attr']);
-
- unset($e->test['attr']);
- unset($e->test['namespace1:attr']);
- unset($e->test['namespace2:attr']);
-
- $this->assertEquals('', $e->test['attr']);
- $this->assertEquals('', $e->test['namespace1:attr']);
- $this->assertEquals('', $e->test['namespace1:attr']);
- }
-
- /**
- * @group ZF-2606
- */
- public function testValuesWithXmlSpecialChars()
- {
- $testAmp = '&';
- $testLt = '<';
- $testGt = '>';
-
- $e = new Zend_Feed_Entry_Atom();
- $e->testAmp = $testAmp;
- $e->{'namespace1:lt'} = $testLt;
- $e->{'namespace1:gt'} = $testGt;
-
- $this->assertEquals($testAmp, $e->testAmp());
- $this->assertEquals($testLt, $e->{'namespace1:lt'}());
- $this->assertEquals($testGt, $e->{'namespace1:gt'}());
- }
-
- /**
- * @group ZF-2606
- */
- public function testAttributesWithXmlSpecialChars()
- {
- $testAmp = '&';
- $testLt = '<';
- $testGt = '>';
- $testQuot = '"';
- $testSquot = "'";
-
- $e = new Zend_Feed_Entry_Atom();
- $e->test['amp'] = $testAmp;
- $e->test['namespace1:lt'] = $testLt;
- $e->test['namespace1:gt'] = $testGt;
- $e->test['namespace1:quot'] = $testQuot;
- $e->test['namespace1:squot'] = $testSquot;
-
- $this->assertEquals($testAmp, $e->test['amp']);
- $this->assertEquals($testLt, $e->test['namespace1:lt']);
- $this->assertEquals($testGt, $e->test['namespace1:gt']);
- $this->assertEquals($testQuot, $e->test['namespace1:quot']);
- $this->assertEquals($testSquot, $e->test['namespace1:squot']);
- }
-
-}
diff --git a/tests/Zend/Feed/Entry/RssTest.php b/tests/Zend/Feed/Entry/RssTest.php
deleted file mode 100644
index 0240e15f42..0000000000
--- a/tests/Zend/Feed/Entry/RssTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-assertTrue($feed instanceof Zend_Feed_Rss);
-
- $item = $feed->current();
- $this->assertTrue($item instanceof Zend_Feed_Entry_Rss);
-
- $this->assertTrue(isset($item->content));
- $this->assertContains(
- 'http://framework.zend.com/fisheye/changelog/Zend_Framework/?cs=7757',
- $item->content->__toString()
- );
- $this->assertContains(
- 'http://framework.zend.com/fisheye/changelog/Zend_Framework/?cs=7757',
- $item->content()
- );
- $item->content = 'foo';
- $this->assertEquals('foo', $item->content->__toString());
- }
-
- public function testContentEncodedNullIfEmpty()
- {
- $feed = Zend_Feed::importFile(dirname(__FILE__) . '/../_files/TestFeedEntryRssContentEncoded.xml');
- $this->assertTrue($feed instanceof Zend_Feed_Rss);
-
- $feed->next();
- $item = $feed->current();
- $this->assertTrue($item instanceof Zend_Feed_Entry_Rss);
- $this->assertFalse(isset($item->content));
- $this->assertNull($item->content());
- // $this->assertNull($item->content); // always return DOMElement Object
- }
-
-}
diff --git a/tests/Zend/Feed/ImportTest.php b/tests/Zend/Feed/ImportTest.php
deleted file mode 100644
index 859ab47e8c..0000000000
--- a/tests/Zend/Feed/ImportTest.php
+++ /dev/null
@@ -1,468 +0,0 @@
-_adapter = new Zend_Http_Client_Adapter_Test();
- Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('adapter' => $this->_adapter)));
- $this->_client = Zend_Feed::getHttpClient();
- $this->_feedDir = dirname(__FILE__) . '/_files';
- }
-
- /**
- * Test an atom feed generated by google's Blogger platform
- */
- public function testAtomGoogle()
- {
- $this->_importAtomValid('AtomTestGoogle.xml');
- }
-
- /**
- * Test an atom feed generated by mozillaZine.org
- */
- public function testAtomMozillazine()
- {
- $this->_importAtomValid('AtomTestMozillazine.xml');
- }
-
- /**
- * Test an atom feed generated by O'Reilly
- */
- public function testAtomOReilly()
- {
- $this->_importAtomValid('AtomTestOReilly.xml');
- }
-
- /**
- * Test an atom feed generated by PlanetPHP
- */
- public function testAtomPlanetPHP()
- {
- $this->_importAtomValid('AtomTestPlanetPHP.xml');
- }
-
- /**
- * Test a small atom feed
- */
- public function testAtomSample1()
- {
- $this->_importAtomValid('AtomTestSample1.xml');
- }
-
- /**
- * Test a small atom feed without any entries
- */
- public function testAtomSample2()
- {
- $this->_importAtomValid('AtomTestSample2.xml');
- }
-
- /**
- * Test an atom feed with a tag missing
- */
- public function testAtomSample3()
- {
- $this->_importInvalid('AtomTestSample3.xml');
- }
-
- /**
- * Test an atom feed with links within entries
- */
- public function testAtomSample4()
- {
- $this->_importAtomValid('AtomTestSample4.xml');
- }
-
- /**
- * Test a RSS feed generated by UserLand Frontier v9.5
- */
- public function testRssHarvardLaw()
- {
- $this->_importRssValid('RssTestHarvardLaw.xml');
- }
-
- /**
- * Test a RSS feed generated by PlanetPHP
- */
- public function testRssPlanetPHP()
- {
- $this->_importRssValid('RssTestPlanetPHP.xml');
- }
-
- /**
- * Test a RSS feed generated by Slashdot
- */
- public function testRssSlashdot()
- {
- $this->_importRssValid('RssTestSlashdot.xml');
- }
-
- /**
- * Test a RSS feed generated by CNN
- */
- public function testRssCNN()
- {
- $this->_importRssValid('RssTestCNN.xml');
- }
-
- /**
- * Test a valid RSS 0.91 sample
- */
- public function testRss091Sample1()
- {
- $this->_importRssValid('RssTest091Sample1.xml');
- }
-
- /**
- * Test a valid RSS 0.91 sample
- */
- public function testRss092Sample1()
- {
- $this->_importRssValid('RssTest092Sample1.xml');
- }
-
- /**
- * Test a valid RSS 1.0 sample
- */
- public function testRss100Sample1()
- {
- $feed = $this->_importRssValid('RssTest100Sample1.xml');
- $this->assertEquals(2, $feed->count());
- }
-
- /**
- * Test a valid RSS 1.0 sample with some extensions in it
- */
- public function testRss100Sample2()
- {
- $feed = $this->_importRssValid('RssTest100Sample2.xml');
- $this->assertEquals(1, $feed->count());
- }
-
- /**
- * Test a valid RSS 2.0 sample
- */
- public function testRss200Sample1()
- {
- $this->_importRssValid('RssTest200Sample1.xml');
- }
-
- /**
- * Test the import of a RSS feed from an array
- */
- public function testRssImportFullArray()
- {
- $feed = Zend_Feed::importArray($this->_getFullArray(), 'rss');
- $this->assertTrue($feed instanceof Zend_Feed_Rss);
- }
-
- /**
- * Test the import of a RSS feed from an array
- * @group ZF-5833
- */
- public function testRssImportSetsIsPermaLinkAsFalseIfGuidNotAUri()
- {
- $feed = Zend_Feed::importArray($this->_getFullArray(), 'rss');
- $entry = $feed->current();
- $this->assertEquals('false', $entry->guid['isPermaLink']);
- }
-
- /**
- * Test the import of a RSS feed from an array
- */
- public function testAtomImportFullArray()
- {
- $feed = Zend_Feed::importArray($this->_getFullArray(), 'atom');
- }
-
- /**
- * Test the import of a RSS feed from a builder
- */
- public function testRssImportFullBuilder()
- {
- $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'rss');
- $this->assertTrue($feed instanceof Zend_Feed_Rss);
- }
-
- /**
- * Test the import of a full iTunes RSS feed from a builder
- */
- public function testRssImportFulliTunesBuilder()
- {
- $array = $this->_getFullArray();
- $array['itunes']['author'] = 'iTunes Author';
- $array['itunes']['owner'] = array('name' => 'iTunes Owner',
- 'email' => 'itunes@example.com');
- $array['itunes']['image'] = 'http://www.example/itunes.png';
- $array['itunes']['subtitle'] = 'iTunes subtitle';
- $array['itunes']['summary'] = 'iTunes summary';
- $array['itunes']['explicit'] = 'clean';
- $array['itunes']['block'] = 'no';
- $array['itunes']['new-feed-url'] = 'http://www.example/itunes.xml';
- $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($array), 'rss');
- $this->assertTrue($feed instanceof Zend_Feed_Rss);
- }
-
- /**
- * Test the import of an Atom feed from a builder
- */
- public function testAtomImportFullBuilder()
- {
- $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'atom');
-
- }
-
- /**
- * Test the import of an Atom feed from a builder
- */
- public function testAtomImportFullBuilderValid()
- {
- $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'atom');
-
- $feed = Zend_Feed::importString($feed->saveXml());
- $this->assertTrue($feed instanceof Zend_Feed_Atom);
- }
-
- /**
- * Check the validity of the builder import (rss)
- */
- public function testRssImportFullBuilderValid()
- {
- $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'rss');
- $this->assertTrue($feed instanceof Zend_Feed_Rss);
- $feed = Zend_Feed::importString($feed->saveXml());
- $this->assertTrue($feed instanceof Zend_Feed_Rss);
- }
-
- /**
- * Test the return of a link() call (atom)
- */
- public function testAtomGetLink()
- {
- $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'atom');
- $this->assertTrue($feed instanceof Zend_Feed_Atom);
- $feed = Zend_Feed::importString($feed->saveXml());
- $this->assertTrue($feed instanceof Zend_Feed_Atom);
- $href = $feed->link('self');
- $this->assertEquals('http://www.example.com', $href);
- }
-
- /**
- * Imports an invalid feed and ensure everything works as expected
- * even if XDebug is running (ZF-2590).
- */
- public function testImportInvalidIsXdebugAware()
- {
- if (!function_exists('xdebug_is_enabled')) {
- $this->markTestIncomplete('XDebug not installed');
- }
-
- $response = new Zend_Http_Response(200, array(), '');
- $this->_adapter->setResponse($response);
-
- try {
- $feed = Zend_Feed::import('http://localhost');
- $this->fail('Expected Zend_Feed_Exception not thrown');
- } catch (Zend_Feed_Exception $e) {
- $this->assertTrue($e instanceof Zend_Feed_Exception);
- $this->assertRegExp('/(XDebug is running|Empty string)/', $e->getMessage());
- }
- }
-
- /**
- * Returns the array used by Zend_Feed::importArray
- * and Zend_Feed::importBuilder tests
- *
- * @return array
- */
- protected function _getFullArray()
- {
- $array = array('title' => 'Title of the feed',
- 'link' => 'http://www.example.com',
- 'description' => 'Description of the feed',
- 'author' => 'Olivier Sirven',
- 'email' => 'olivier@elma.fr',
- 'webmaster' => 'olivier@elma.fr',
- 'charset' => 'iso-8859-15',
- 'lastUpdate' => time(),
- 'published' => strtotime('2007-02-27'),
- 'copyright' => 'Common Creative',
- 'image' => 'http://www.example/images/icon.png',
- 'language' => 'en',
- 'ttl' => 60,
- 'rating' => ' (PICS-1.1 "http://www.gcf.org/v2.5" labels
- on "1994.11.05T08:15-0500"
- exp "1995.12.31T23:59-0000"
- for "http://www.greatdocs.com/foo.html"
- by "George Sanderson, Jr."
- ratings (suds 0.5 density 0 color/hue 1))',
- 'cloud' => array('domain' => 'rpc.sys.com',
- 'path' => '/rpc',
- 'registerProcedure' => 'webServices.pingMe',
- 'protocol' => 'xml-rpc'),
- 'textInput' => array('title' => 'subscribe',
- 'description' => 'enter your email address to subscribe by mail',
- 'name' => 'email',
- 'link' => 'http://www.example.com/subscribe'),
- 'skipHours' => array(1, 13, 17),
- 'skipDays' => array('Saturday', 'Sunday'),
- 'itunes' => array('block' => 'no',
- 'keywords' => 'example,itunes,podcast',
- 'category' => array(array('main' => 'Technology',
- 'sub' => 'Gadgets'),
- array('main' => 'Music'))),
- 'entries' => array(array('guid' => time(),
- 'title' => 'First article',
- 'link' => 'http://www.example.com',
- 'description' => 'First article description',
- 'content' => 'First article content',
- 'lastUpdate' => time(),
- 'comments' => 'http://www.example.com/#comments',
- 'commentRss' => 'http://www.example.com/comments.xml',
- 'source' => array('title' => 'Original title',
- 'url' => 'http://www.domain.com'),
- 'category' => array(array('term' => 'test category',
- 'scheme' => 'http://www.example.com/scheme'),
- array('term' => 'another category')
- ),
- 'enclosure' => array(array('url' => 'http://www.example.com/podcast.mp3',
- 'type' => 'audio/mpeg',
- 'length' => '12216320'
- ),
- array('url' => 'http://www.example.com/podcast2.mp3',
- 'type' => 'audio/mpeg',
- 'length' => '1221632'
- )
- )
- ),
- array('title' => 'Second article',
- 'link' => 'http://www.example.com/two',
- 'description' => 'Second article description',
- 'content' => 'Second article content',
- 'lastUpdate' => time(),
- 'comments' => 'http://www.example.com/two/#comments',
- 'category' => array(array('term' => 'test category')),
- )
- )
- );
- return $array;
- }
-
- /**
- * Import an invalid atom feed
- */
- protected function _importAtomValid($filename)
- {
- $response = new Zend_Http_Response(200, array(), file_get_contents("$this->_feedDir/$filename"));
- $this->_adapter->setResponse($response);
-
- $feed = Zend_Feed::import('http://localhost');
- $this->assertTrue($feed instanceof Zend_Feed_Atom);
- }
-
- /**
- * Import a valid rss feed
- */
- protected function _importRssValid($filename)
- {
- $response = new Zend_Http_Response(200, array(), file_get_contents("$this->_feedDir/$filename"));
- $this->_adapter->setResponse($response);
-
- $feed = Zend_Feed::import('http://localhost');
- $this->assertTrue($feed instanceof Zend_Feed_Rss);
- return $feed;
- }
-
- /**
- * Imports an invalid feed
- */
- protected function _importInvalid($filename)
- {
- $response = new Zend_Http_Response(200, array(), file_get_contents("$this->_feedDir/$filename"));
- $this->_adapter->setResponse($response);
-
- try {
- $feed = Zend_Feed::import('http://localhost');
- $this->fail('Expected Zend_Feed_Exception not thrown');
- } catch (Zend_Feed_Exception $e) {
- $this->assertTrue($e instanceof Zend_Feed_Exception);
- }
- }
-
- /**
- * @group ZF-5903
- */
- public function testFindFeedsIncludesUriAsArrayKey()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testFindFeedsIncludesUriAsArrayKey() requires a network connection');
- return;
- }
- Zend_Feed::setHttpClient(new Zend_Http_Client);
- $feeds = Zend_Feed::findFeeds('http://www.planet-php.net');
- $this->assertEquals(array(
- 'http://www.planet-php.org:80/rss/', 'http://www.planet-php.org:80/rdf/'
- ), array_keys($feeds));
- }
-}
diff --git a/tests/Zend/Feed/IteratorTest.php b/tests/Zend/Feed/IteratorTest.php
deleted file mode 100644
index 8fdf2403a4..0000000000
--- a/tests/Zend/Feed/IteratorTest.php
+++ /dev/null
@@ -1,123 +0,0 @@
-_feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml');
- $this->_nsfeed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeedNamespaced.xml');
- }
-
- public function testRewind()
- {
- $times = 0;
- foreach ($this->_feed as $f) {
- ++$times;
- }
-
- $times2 = 0;
- foreach ($this->_feed as $f) {
- ++$times2;
- }
-
- $this->assertEquals($times, $times2, 'Feed should have the same number of iterations multiple times through');
-
- $times = 0;
- foreach ($this->_nsfeed as $f) {
- ++$times;
- }
-
- $times2 = 0;
- foreach ($this->_nsfeed as $f) {
- ++$times2;
- }
-
- $this->assertEquals($times, $times2, 'Feed should have the same number of iterations multiple times through');
- }
-
- public function testCurrent()
- {
- foreach ($this->_feed as $f) {
- $this->assertTrue(
- $f instanceof Zend_Feed_Entry_Atom,
- 'Each feed entry should be an instance of Zend_Feed_Entry_Atom'
- );
- break;
- }
-
- foreach ($this->_nsfeed as $f) {
- $this->assertTrue(
- $f instanceof Zend_Feed_Entry_Atom,
- 'Each feed entry should be an instance of Zend_Feed_Entry_Atom'
- );
- break;
- }
- }
-
- public function testKey()
- {
- $keys = array();
- foreach ($this->_feed as $k => $f) {
- $keys[] = $k;
- }
- $this->assertEquals($keys, array(0, 1), 'Feed should have keys 0 and 1');
-
- $keys = array();
- foreach ($this->_nsfeed as $k => $f) {
- $keys[] = $k;
- }
- $this->assertEquals($keys, array(0, 1), 'Feed should have keys 0 and 1');
- }
-
- public function testNext()
- {
- $last = null;
- foreach ($this->_feed as $current) {
- $this->assertFalse($last === $current, 'Iteration should produce a new object each entry');
- $last = $current;
- }
-
- $last = null;
- foreach ($this->_nsfeed as $current) {
- $this->assertFalse($last === $current, 'Iteration should produce a new object each entry');
- $last = $current;
- }
- }
-
-}
diff --git a/tests/Zend/Feed/Pubsubhubbub/AllTests.php b/tests/Zend/Feed/Pubsubhubbub/AllTests.php
deleted file mode 100644
index 46e40c9fc9..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/AllTests.php
+++ /dev/null
@@ -1,67 +0,0 @@
-addTestSuite('Zend_Feed_Pubsubhubbub_PubsubhubbubTest');
- $suite->addTestSuite('Zend_Feed_Pubsubhubbub_PublisherTest');
- $suite->addTestSuite('Zend_Feed_Pubsubhubbub_SubscriberTest');
- $suite->addTestSuite('Zend_Feed_Pubsubhubbub_SubscriberHttpTest');
- $suite->addTest(Zend_Feed_Pubsubhubbub_Model_AllTests::suite());
- $suite->addTestSuite('Zend_Feed_Pubsubhubbub_Subscriber_CallbackTest');
-
- return $suite;
- }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Zend_Feed_Pubsubhubbub_AllTests::main') {
- Zend_Feed_Pubsubhubbub_AllTests::main();
-}
diff --git a/tests/Zend/Feed/Pubsubhubbub/Model/AllTests.php b/tests/Zend/Feed/Pubsubhubbub/Model/AllTests.php
deleted file mode 100644
index 5952ac08f2..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/Model/AllTests.php
+++ /dev/null
@@ -1,54 +0,0 @@
-addTestSuite('Zend_Feed_Pubsubhubbub_Model_SubscriptionTest');
- return $suite;
- }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Zend_Feed_Pubsubhubbub_Model_AllTests::main') {
- Zend_Feed_Pubsubhubbub_AllTests::main();
-}
diff --git a/tests/Zend/Feed/Pubsubhubbub/Model/SubscriptionTest.php b/tests/Zend/Feed/Pubsubhubbub/Model/SubscriptionTest.php
deleted file mode 100644
index 27603a1027..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/Model/SubscriptionTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-_initDb();
- $subscription = new Zend_Feed_Pubsubhubbub_Model_Subscription();
- $id = uniqid();
- $this->assertFalse($subscription->hasSubscription($id));
- $this->assertFalse($subscription->getSubscription($id));
- $this->assertFalse($subscription->deleteSubscription($id));
- $this->assertTrue($subscription->setSubscription(array('id' => $id)));
-
- $this->assertTrue($subscription->hasSubscription($id));
- $dataSubscription = $subscription->getSubscription($id);
- $this->assertTrue(is_array($dataSubscription));
- $keys = array('id', 'topic_url', 'hub_url',
- 'created_time', 'lease_seconds',
- 'verify_token', 'secret',
- 'expiration_time', 'subscription_state');
-
- $this->assertSame($keys, array_keys($dataSubscription));
- $this->assertFalse($subscription->setSubscription(array('id' => $id)));
- $this->assertTrue($subscription->deleteSubscription($id));
- }
-
- public function testImpemetsSubscriptionInterface()
- {
- $reflection = new ReflectionClass('Zend_Feed_Pubsubhubbub_Model_Subscription');
- $this->assertTrue($reflection->implementsInterface('Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface'));
- unset($reflection);
- }
-
- protected function _initDb()
- {
- if (!extension_loaded('pdo')) {
- $this->markTestSkipped("extension 'PDO' is not loaded");
- }
-
- if (!in_array('sqlite', PDO::getAvailableDrivers())) {
- $this->markTestSkipped("PDO driver 'sqlite' is not available");
- }
-
- $db = Zend_Db::factory('Pdo_Sqlite', array('dbname' => ':memory:'));
- Zend_Db_Table::setDefaultAdapter($db);
- $this->_createTable();
- }
-
- protected function _createTable()
- {
- $sql = "CREATE TABLE subscription ("
- . "id varchar(32) NOT NULL DEFAULT '', "
- . "topic_url varchar(255) DEFAULT NULL, "
- . "hub_url varchar(255) DEFAULT NULL, "
- . "created_time datetime DEFAULT NULL, "
- . "lease_seconds bigint(20) DEFAULT NULL, "
- . "verify_token varchar(255) DEFAULT NULL, "
- . "secret varchar(255) DEFAULT NULL, "
- . "expiration_time datetime DEFAULT NULL, "
- . "subscription_state varchar(12) DEFAULT NULL, "
- . "PRIMARY KEY (id) "
- . ");";
-
- Zend_Db_Table::getDefaultAdapter()->getConnection()->query($sql);
- }
-}
diff --git a/tests/Zend/Feed/Pubsubhubbub/PublisherTest.php b/tests/Zend/Feed/Pubsubhubbub/PublisherTest.php
deleted file mode 100644
index 801afbd519..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/PublisherTest.php
+++ /dev/null
@@ -1,322 +0,0 @@
-_publisher = new Zend_Feed_Pubsubhubbub_Publisher;
- }
-
- public function testAddsHubServerUrl()
- {
- $this->_publisher->addHubUrl('http://www.example.com/hub');
- $this->assertEquals(array('http://www.example.com/hub'), $this->_publisher->getHubUrls());
- }
-
- public function testAddsHubServerUrlsFromArray()
- {
- $this->_publisher->addHubUrls(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ));
- $this->assertEquals(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ), $this->_publisher->getHubUrls());
- }
-
- public function testAddsHubServerUrlsFromArrayUsingSetConfig()
- {
- $this->_publisher->setConfig(array('hubUrls' => array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- )));
- $this->assertEquals(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ), $this->_publisher->getHubUrls());
- }
-
- public function testRemovesHubServerUrl()
- {
- $this->_publisher->addHubUrls(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ));
- $this->_publisher->removeHubUrl('http://www.example.com/hub');
- $this->assertEquals(array(
- 1 => 'http://www.example.com/hub2'
- ), $this->_publisher->getHubUrls());
- }
-
- public function testRetrievesUniqueHubServerUrlsOnly()
- {
- $this->_publisher->addHubUrls(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2',
- 'http://www.example.com/hub'
- ));
- $this->assertEquals(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ), $this->_publisher->getHubUrls());
- }
-
- public function testThrowsExceptionOnSettingEmptyHubServerUrl()
- {
- try {
- $this->_publisher->addHubUrl('');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingNonStringHubServerUrl()
- {
- try {
- $this->_publisher->addHubUrl(123);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingInvalidHubServerUrl()
- {
- try {
- $this->_publisher->addHubUrl('http://');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testAddsUpdatedTopicUrl()
- {
- $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic');
- $this->assertEquals(array('http://www.example.com/topic'), $this->_publisher->getUpdatedTopicUrls());
- }
-
- public function testAddsUpdatedTopicUrlsFromArray()
- {
- $this->_publisher->addUpdatedTopicUrls(array(
- 'http://www.example.com/topic', 'http://www.example.com/topic2'
- ));
- $this->assertEquals(array(
- 'http://www.example.com/topic', 'http://www.example.com/topic2'
- ), $this->_publisher->getUpdatedTopicUrls());
- }
-
- public function testAddsUpdatedTopicUrlsFromArrayUsingSetConfig()
- {
- $this->_publisher->setConfig(array('updatedTopicUrls' => array(
- 'http://www.example.com/topic', 'http://www.example.com/topic2'
- )));
- $this->assertEquals(array(
- 'http://www.example.com/topic', 'http://www.example.com/topic2'
- ), $this->_publisher->getUpdatedTopicUrls());
- }
-
- public function testRemovesUpdatedTopicUrl()
- {
- $this->_publisher->addUpdatedTopicUrls(array(
- 'http://www.example.com/topic', 'http://www.example.com/topic2'
- ));
- $this->_publisher->removeUpdatedTopicUrl('http://www.example.com/topic');
- $this->assertEquals(array(
- 1 => 'http://www.example.com/topic2'
- ), $this->_publisher->getUpdatedTopicUrls());
- }
-
- public function testRetrievesUniqueUpdatedTopicUrlsOnly()
- {
- $this->_publisher->addUpdatedTopicUrls(array(
- 'http://www.example.com/topic', 'http://www.example.com/topic2',
- 'http://www.example.com/topic'
- ));
- $this->assertEquals(array(
- 'http://www.example.com/topic', 'http://www.example.com/topic2'
- ), $this->_publisher->getUpdatedTopicUrls());
- }
-
- public function testThrowsExceptionOnSettingEmptyUpdatedTopicUrl()
- {
- try {
- $this->_publisher->addUpdatedTopicUrl('');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingNonStringUpdatedTopicUrl()
- {
- try {
- $this->_publisher->addUpdatedTopicUrl(123);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingInvalidUpdatedTopicUrl()
- {
- try {
- $this->_publisher->addUpdatedTopicUrl('http://');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testAddsParameter()
- {
- $this->_publisher->setParameter('foo', 'bar');
- $this->assertEquals(array('foo'=>'bar'), $this->_publisher->getParameters());
- }
-
- public function testAddsParametersFromArray()
- {
- $this->_publisher->setParameters(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->assertEquals(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ), $this->_publisher->getParameters());
- }
-
- public function testAddsParametersFromArrayInSingleMethod()
- {
- $this->_publisher->setParameter(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->assertEquals(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ), $this->_publisher->getParameters());
- }
-
- public function testAddsParametersFromArrayUsingSetConfig()
- {
- $this->_publisher->setConfig(array('parameters' => array(
- 'foo' => 'bar', 'boo' => 'baz'
- )));
- $this->assertEquals(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ), $this->_publisher->getParameters());
- }
-
- public function testRemovesParameter()
- {
- $this->_publisher->setParameters(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->_publisher->removeParameter('boo');
- $this->assertEquals(array(
- 'foo' => 'bar'
- ), $this->_publisher->getParameters());
- }
-
- public function testRemovesParameterIfSetToNull()
- {
- $this->_publisher->setParameters(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->_publisher->setParameter('boo', null);
- $this->assertEquals(array(
- 'foo' => 'bar'
- ), $this->_publisher->getParameters());
- }
-
- public function testNotifiesHubWithCorrectParameters()
- {
- Zend_Feed_Pubsubhubbub::setHttpClient(new Zend_Feed_Pubsubhubbub_PublisherTest_ClientSuccess);
- $client = Zend_Feed_Pubsubhubbub::getHttpClient();
- $this->_publisher->addHubUrl('http://www.example.com/hub');
- $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic');
- $this->_publisher->setParameter('foo', 'bar');
- $this->_publisher->notifyAll();
- $this->assertEquals('hub.mode=publish&hub.url=http%3A%2F%2Fwww.example.com%2Ftopic&foo=bar', $client->getBody());
- }
-
- public function testNotifiesHubWithCorrectParametersAndMultipleTopics()
- {
- Zend_Feed_Pubsubhubbub::setHttpClient(new Zend_Feed_Pubsubhubbub_PublisherTest_ClientSuccess);
- $client = Zend_Feed_Pubsubhubbub::getHttpClient();
- $this->_publisher->addHubUrl('http://www.example.com/hub');
- $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic');
- $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic2');
- $this->_publisher->notifyAll();
- $this->assertEquals('hub.mode=publish&hub.url=http%3A%2F%2Fwww.example.com%2Ftopic&hub.url=http%3A%2F%2Fwww.example.com%2Ftopic2', $client->getBody());
- }
-
- public function testNotifiesHubAndReportsSuccess()
- {
- Zend_Feed_Pubsubhubbub::setHttpClient(new Zend_Feed_Pubsubhubbub_PublisherTest_ClientSuccess);
- $client = Zend_Feed_Pubsubhubbub::getHttpClient();
- $this->_publisher->addHubUrl('http://www.example.com/hub');
- $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic');
- $this->_publisher->setParameter('foo', 'bar');
- $this->_publisher->notifyAll();
- $this->assertTrue($this->_publisher->isSuccess());
- }
-
- public function testNotifiesHubAndReportsFail()
- {
- Zend_Feed_Pubsubhubbub::setHttpClient(new Zend_Feed_Pubsubhubbub_PublisherTest_ClientFail);
- $client = Zend_Feed_Pubsubhubbub::getHttpClient();
- $this->_publisher->addHubUrl('http://www.example.com/hub');
- $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic');
- $this->_publisher->setParameter('foo', 'bar');
- $this->_publisher->notifyAll();
- $this->assertFalse($this->_publisher->isSuccess());
- }
-
-}
-
-// Some stubs for what Http_Client would be doing
-
-class Zend_Feed_Pubsubhubbub_PublisherTest_ClientSuccess extends Zend_Http_Client
-{
- public function request($method = null) {
- $response = new Zend_Feed_Pubsubhubbub_PublisherTest_ResponseSuccess;
- return $response;
- }
- public function getBody(){return $this->_prepareBody();}
-}
-class Zend_Feed_Pubsubhubbub_PublisherTest_ClientFail extends Zend_Http_Client
-{
- public function request($method = null) {
- $response = new Zend_Feed_Pubsubhubbub_PublisherTest_ResponseFail;
- return $response;
- }
- public function getBody(){return $this->_prepareBody();}
-}
-class Zend_Feed_Pubsubhubbub_PublisherTest_ResponseSuccess
-{
- public function getStatus(){return 204;}
-}
-class Zend_Feed_Pubsubhubbub_PublisherTest_ResponseFail
-{
- public function getStatus(){return 404;}
-}
diff --git a/tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php b/tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php
deleted file mode 100644
index 709272abf6..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php
+++ /dev/null
@@ -1,59 +0,0 @@
-assertTrue(
- Zend_Feed_Pubsubhubbub::getHttpClient() instanceof Test_Http_Client_Pubsub
- );
- }
-
- public function testCanDetectHubs()
- {
- $feed = Zend_Feed_Reader::importFile(dirname(__FILE__) . '/_files/rss20.xml');
- $this->assertEquals(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ), Zend_Feed_Pubsubhubbub::detectHubs($feed));
- }
-
-}
-
-class Test_Http_Client_Pubsub extends Zend_Http_Client {}
diff --git a/tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php b/tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php
deleted file mode 100644
index b5f65cbec2..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php
+++ /dev/null
@@ -1,544 +0,0 @@
-_callback = new Zend_Feed_Pubsubhubbub_Subscriber_Callback;
-
- $this->_adapter = $this->_getCleanMock(
- 'Zend_Db_Adapter_Abstract'
- );
- $this->_tableGateway = $this->_getCleanMock(
- 'Zend_Db_Table_Abstract'
- );
- $this->_rowset = $this->_getCleanMock(
- 'Zend_Db_Table_Rowset_Abstract'
- );
-
- $this->_tableGateway->expects($this->any())->method('getAdapter')
- ->will($this->returnValue($this->_adapter));
- $storage = new Zend_Feed_Pubsubhubbub_Model_Subscription($this->_tableGateway);
- $this->_callback->setStorage($storage);
-
- $this->_get = array(
- 'hub_mode' => 'subscribe',
- 'hub_topic' => 'http://www.example.com/topic',
- 'hub_challenge' => 'abc',
- 'hub_verify_token' => 'cba',
- 'hub_mode' => 'subscribe',
- 'hub_lease_seconds' => '1234567'
- );
-
- $this->_originalServer = $_SERVER;
- $_SERVER['REQUEST_METHOD'] = 'get';
- $_SERVER['QUERY_STRING'] = 'xhub.subscription=verifytokenkey';
- }
-
- public function tearDown()
- {
- $_SERVER = $this->_originalServer;
- }
-
-
- public function testCanSetHttpResponseObject()
- {
- $this->_callback->setHttpResponse(new Zend_Feed_Pubsubhubbub_HttpResponse);
- $this->assertTrue($this->_callback->getHttpResponse() instanceof Zend_Feed_Pubsubhubbub_HttpResponse);
- }
-
- public function testCanUsesDefaultHttpResponseObject()
- {
- $this->assertTrue($this->_callback->getHttpResponse() instanceof Zend_Feed_Pubsubhubbub_HttpResponse);
- }
-
- public function testThrowsExceptionOnInvalidHttpResponseObjectSet()
- {
- try {
- $this->_callback->setHttpResponse(new stdClass);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionIfNonObjectSetAsHttpResponseObject()
- {
- try {
- $this->_callback->setHttpResponse('');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testCanSetSubscriberCount()
- {
- $this->_callback->setSubscriberCount('10000');
- $this->assertEquals(10000, $this->_callback->getSubscriberCount());
- }
-
- public function testDefaultSubscriberCountIsOne()
- {
- $this->assertEquals(1, $this->_callback->getSubscriberCount());
- }
-
- public function testThrowsExceptionOnSettingZeroAsSubscriberCount()
- {
- try {
- $this->_callback->setSubscriberCount(0);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnSettingLessThanZeroAsSubscriberCount()
- {
- try {
- $this->_callback->setSubscriberCount(-1);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnSettingAnyScalarTypeCastToAZeroOrLessIntegerAsSubscriberCount()
- {
- try {
- $this->_callback->setSubscriberCount('0aa');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testCanSetStorageImplementation()
- {
- $storage = new Zend_Feed_Pubsubhubbub_Model_Subscription($this->_tableGateway);
- $this->_callback->setStorage($storage);
- $this->assertThat($this->_callback->getStorage(), $this->identicalTo($storage));
- }
-
- public function testValidatesValidHttpGetData()
- {
-
- $mockReturnValue = $this->getMock('Result', array('toArray'));
- $mockReturnValue->expects($this->any())->method('toArray')->will($this->returnValue(array(
- 'verify_token' => hash('sha256', 'cba')
- )));
-
- $this->_tableGateway->expects($this->any())
- ->method('find')
- ->with($this->equalTo('verifytokenkey'))
- ->will($this->returnValue($this->_rowset));
- $this->_rowset->expects($this->any())
- ->method('current')
- ->will($this->returnValue($mockReturnValue));
- $this->_rowset->expects($this->any())
- ->method('count')
- ->will($this->returnValue(1));
-
- $this->assertTrue($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfHubVerificationNotAGetRequest()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfModeMissingFromHttpGetData()
- {
- unset($this->_get['hub_mode']);
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfTopicMissingFromHttpGetData()
- {
- unset($this->_get['hub_topic']);
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfChallengeMissingFromHttpGetData()
- {
- unset($this->_get['hub_challenge']);
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfVerifyTokenMissingFromHttpGetData()
- {
- unset($this->_get['hub_verify_token']);
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsTrueIfModeSetAsUnsubscribeFromHttpGetData()
- {
-
- $mockReturnValue = $this->getMock('Result', array('toArray'));
- $mockReturnValue->expects($this->any())->method('toArray')->will($this->returnValue(array(
- 'verify_token' => hash('sha256', 'cba')
- )));
-
- $this->_get['hub_mode'] = 'unsubscribe';
- $this->_tableGateway->expects($this->any())
- ->method('find')
- ->with($this->equalTo('verifytokenkey'))
- ->will($this->returnValue($this->_rowset));
- $this->_rowset->expects($this->any())
- ->method('current')
- ->will($this->returnValue($mockReturnValue));
- // require for the count call on the rowset in Model/Subscription
- $this->_rowset->expects($this->any())
- ->method('count')
- ->will($this->returnValue(1));
-
- $this->assertTrue($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfModeNotRecognisedFromHttpGetData()
- {
- $this->_get['hub_mode'] = 'abc';
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfLeaseSecondsMissedWhenModeIsSubscribeFromHttpGetData()
- {
- unset($this->_get['hub_lease_seconds']);
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfHubTopicInvalidFromHttpGetData()
- {
- $this->_get['hub_topic'] = 'http://';
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfVerifyTokenRecordDoesNotExistForConfirmRequest()
- {
- //$this->_callback->setStorage(new Zend_Feed_Pubsubhubbub_Subscriber_CallbackTestStorageHasNot);
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testReturnsFalseIfVerifyTokenRecordDoesNotAgreeWithConfirmRequest()
- {
- //$this->_callback->setStorage(new Zend_Feed_Pubsubhubbub_Subscriber_CallbackTestStorageHasButWrong);
- $this->assertFalse($this->_callback->isValidHubVerification($this->_get));
- }
-
- public function testRespondsToInvalidConfirmationWith404Response()
- {
- unset($this->_get['hub_mode']);
- $this->_callback->handle($this->_get);
- $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 404);
- }
-
- public function testRespondsToValidConfirmationWith200Response()
- {
- if (getenv('TRAVIS')) {
- $this->markTestSkipped(
- 'Test randomly fail on Travis CI.'
- );
- }
-
- $this->_get['hub_mode'] = 'unsubscribe';
- $this->_tableGateway->expects($this->any())
- ->method('find')
- ->with($this->equalTo('verifytokenkey'))
- ->will($this->returnValue($this->_rowset));
-
- $t = new Zend_Date;
- $rowdata = array(
- 'id' => 'verifytokenkey',
- 'verify_token' => hash('sha256', 'cba'),
- 'created_time' => $t->get(Zend_Date::TIMESTAMP),
- 'lease_seconds' => 10000
- );
-
- $row = new Zend_Db_Table_Row(array('data' => $rowdata));
-
- $this->_rowset->expects($this->any())
- ->method('current')
- ->will($this->returnValue($row));
- // require for the count call on the rowset in Model/Subscription
- $this->_rowset->expects($this->any())
- ->method('count')
- ->will($this->returnValue(1));
-
- $this->_tableGateway->expects($this->once())
- ->method('update')
- ->with(
- $this->equalTo(array('id'=>'verifytokenkey','verify_token'=>hash('sha256', 'cba'),'created_time'=>$t->get(Zend_Date::TIMESTAMP),'lease_seconds'=>1234567,'subscription_state'=>'verified','expiration_time'=>$t->add(1234567,Zend_Date::SECOND)->get('yyyy-MM-dd HH:mm:ss'))),
- $this->equalTo('id = \'verifytokenkey\'')
- );
- $this->_adapter->expects($this->once())
- ->method('quoteInto')
- ->with($this->equalTo('id = ?'), $this->equalTo('verifytokenkey'))
- ->will($this->returnValue('id = \'verifytokenkey\''));
-
- $this->_callback->handle($this->_get);
- $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 200);
- }
-
- public function testRespondsToValidConfirmationWithBodyContainingHubChallenge()
- {
- if (getenv('TRAVIS')) {
- $this->markTestSkipped(
- 'Test randomly fail on Travis CI.'
- );
- }
-
- $this->_tableGateway->expects($this->any())
- ->method('find')
- ->with($this->equalTo('verifytokenkey'))
- ->will($this->returnValue($this->_rowset));
-
- $t = new Zend_Date;
- $rowdata = array(
- 'id' => 'verifytokenkey',
- 'verify_token' => hash('sha256', 'cba'),
- 'created_time' => $t->get(Zend_Date::TIMESTAMP),
- 'lease_seconds' => 10000
- );
-
- $row = new Zend_Db_Table_Row(array('data' => $rowdata));
-
- $this->_rowset->expects($this->any())
- ->method('current')
- ->will($this->returnValue($row));
- // require for the count call on the rowset in Model/Subscription
- $this->_rowset->expects($this->any())
- ->method('count')
- ->will($this->returnValue(1));
-
- $this->_tableGateway->expects($this->once())
- ->method('update')
- ->with(
- $this->equalTo(array('id'=>'verifytokenkey','verify_token'=>hash('sha256', 'cba'),'created_time'=>$t->get(Zend_Date::TIMESTAMP),'lease_seconds'=>1234567,'subscription_state'=>'verified','expiration_time'=>$t->add(1234567,Zend_Date::SECOND)->get('yyyy-MM-dd HH:mm:ss'))),
- $this->equalTo('id = \'verifytokenkey\'')
- );
- $this->_adapter->expects($this->once())
- ->method('quoteInto')
- ->with($this->equalTo('id = ?'), $this->equalTo('verifytokenkey'))
- ->will($this->returnValue('id = \'verifytokenkey\''));
- $this->_callback->handle($this->_get);
- $this->assertTrue($this->_callback->getHttpResponse()->getBody() == 'abc');
- }
-
- public function testRespondsToValidFeedUpdateRequestWith200Response()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_SERVER['REQUEST_URI'] = '/some/path/callback/verifytokenkey';
- $_SERVER['CONTENT_TYPE'] = 'application/atom+xml';
- $feedXml = file_get_contents(dirname(__FILE__) . '/_files/atom10.xml');
- $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml; // dirty alternative to php://input
-
- $this->_tableGateway->expects($this->any())
- ->method('find')
- ->with($this->equalTo('verifytokenkey'))
- ->will($this->returnValue($this->_rowset));
-
- $t = new Zend_Date;
- $rowdata = array(
- 'id' => 'verifytokenkey',
- 'verify_token' => hash('sha256', 'cba'),
- 'created_time' => time()
- );
-
- $row = new Zend_Db_Table_Row(array('data' => $rowdata));
-
- $this->_rowset->expects($this->any())
- ->method('current')
- ->will($this->returnValue($row));
- // require for the count call on the rowset in Model/Subscription
- $this->_rowset->expects($this->any())
- ->method('count')
- ->will($this->returnValue(1));
-
- $this->_callback->handle(array());
- $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 200);
- }
-
- public function testRespondsToInvalidFeedUpdateNotPostWith404Response()
- { // yes, this example makes no sense for GET - I know!!!
- $_SERVER['REQUEST_METHOD'] = 'GET';
- $_SERVER['REQUEST_URI'] = '/some/path/callback/verifytokenkey';
- $_SERVER['CONTENT_TYPE'] = 'application/atom+xml';
- $feedXml = file_get_contents(dirname(__FILE__) . '/_files/atom10.xml');
- $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml;
-
- $this->_callback->handle(array());
- $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 404);
- }
-
- public function testRespondsToInvalidFeedUpdateWrongMimeWith404Response()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_SERVER['REQUEST_URI'] = '/some/path/callback/verifytokenkey';
- $_SERVER['CONTENT_TYPE'] = 'application/kml+xml';
- $feedXml = file_get_contents(dirname(__FILE__) . '/_files/atom10.xml');
- $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml;
- $this->_callback->handle(array());
- $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 404);
- }
-
- /**
- * As a judgement call, we must respond to any successful request, regardless
- * of the wellformedness of any XML payload, by returning a 2xx response code.
- * The validation of feeds and their processing must occur outside the Hubbub
- * protocol.
- */
- public function testRespondsToInvalidFeedUpdateWrongFeedTypeForMimeWith200Response()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_SERVER['REQUEST_URI'] = '/some/path/callback/verifytokenkey';
- $_SERVER['CONTENT_TYPE'] = 'application/rss+xml';
- $feedXml = file_get_contents(dirname(__FILE__) . '/_files/atom10.xml');
- $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml;
-
- $this->_tableGateway->expects($this->any())
- ->method('find')
- ->with($this->equalTo('verifytokenkey'))
- ->will($this->returnValue($this->_rowset));
-
- $rowdata = array(
- 'id' => 'verifytokenkey',
- 'verify_token' => hash('sha256', 'cba'),
- 'created_time' => time(),
- 'lease_seconds' => 10000
- );
-
- $row = new Zend_Db_Table_Row(array('data' => $rowdata));
-
- $this->_rowset->expects($this->any())
- ->method('current')
- ->will($this->returnValue($row));
- // require for the count call on the rowset in Model/Subscription
- $this->_rowset->expects($this->any())
- ->method('count')
- ->will($this->returnValue(1));
-
- $this->_callback->handle(array());
- $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 200);
- }
-
- public function testRespondsToValidFeedUpdateWithXHubOnBehalfOfHeader()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_SERVER['REQUEST_URI'] = '/some/path/callback/verifytokenkey';
- $_SERVER['CONTENT_TYPE'] = 'application/atom+xml';
- $feedXml = file_get_contents(dirname(__FILE__) . '/_files/atom10.xml');
- $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml;
-
- $this->_tableGateway->expects($this->any())
- ->method('find')
- ->with($this->equalTo('verifytokenkey'))
- ->will($this->returnValue($this->_rowset));
-
- $rowdata = array(
- 'id' => 'verifytokenkey',
- 'verify_token' => hash('sha256', 'cba'),
- 'created_time' => time(),
- 'lease_seconds' => 10000
- );
-
- $row = new Zend_Db_Table_Row(array('data' => $rowdata));
-
- $this->_rowset->expects($this->any())
- ->method('current')
- ->will($this->returnValue($row));
- // require for the count call on the rowset in Model/Subscription
- $this->_rowset->expects($this->any())
- ->method('count')
- ->will($this->returnValue(1));
-
- $this->_callback->handle(array());
- $this->assertTrue($this->_callback->getHttpResponse()->getHeader('X-Hub-On-Behalf-Of') == 1);
- }
-
- protected function _getCleanMock($className) {
- $class = new ReflectionClass($className);
- $methods = $class->getMethods();
- $stubMethods = array();
- foreach ($methods as $method) {
- if ($method->isPublic() || ($method->isProtected()
- && $method->isAbstract())) {
- $stubMethods[] = $method->getName();
- }
- }
- $mocked = $this->getMock(
- $className,
- $stubMethods,
- array(),
- $className . '_PubsubSubscriberMock_' . uniqid(),
- false
- );
- return $mocked;
- }
-
-}
-
-/**
- * Stubs for storage access
- * DEPRECATED
-class Zend_Feed_Pubsubhubbub_Subscriber_CallbackTestStorageHas implements Zend_Feed_Pubsubhubbub_Storage_StorageInterface
-{
- public function setSubscription($key, array $data){}
- public function getSubscription($key){
- if ($key == 'verifytokenkey') {
- return array(
- 'id' => 'verifytokenkey',
- 'verify_token' => hash('sha256', 'cba')
- );
- }
- }
- public function hasSubscription($key){return true;}
- public function removeSubscription($key){}
- public function cleanup($type){}
-}
-class Zend_Feed_Pubsubhubbub_Subscriber_CallbackTestStorageHasNot implements Zend_Feed_Pubsubhubbub_Storage_StorageInterface
-{
- public function setSubscription($key, array $data){}
- public function getSubscription($key){}
- public function hasSubscription($key){return false;}
- public function removeSubscription($key){}
- public function cleanup($type){}
-}
-class Zend_Feed_Pubsubhubbub_Subscriber_CallbackTestStorageHasButWrong implements Zend_Feed_Pubsubhubbub_Storage_StorageInterface
-{
- public function setSubscription($key, array $data){}
- public function getSubscription($key){return 'wrong';}
- public function hasSubscription($key){return true;}
- public function removeSubscription($key){}
- public function cleanup($type){}
-}*/
diff --git a/tests/Zend/Feed/Pubsubhubbub/Subscriber/_files/atom10.xml b/tests/Zend/Feed/Pubsubhubbub/Subscriber/_files/atom10.xml
deleted file mode 100644
index 18683bf9a0..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/Subscriber/_files/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php b/tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php
deleted file mode 100644
index 32201f5fac..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php
+++ /dev/null
@@ -1,137 +0,0 @@
-_baseuri must point to a directory on a web server
- * containing all the files under the _files directory. You should symlink
- * or copy these files and set '_baseuri' properly using the constant in
- * TestConfiguration.php (based on TestConfiguration.php.dist)
- *
- * You can also set the proper constant in your test configuration file to
- * point to the right place.
- *
- * @category Zend
- * @package Zend_Feed
- * @subpackage UnitTests
- * @group Zend_Feed
- * @group Zend_Feed_Subsubhubbub
- * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Zend_Feed_Pubsubhubbub_SubscriberHttpTest extends PHPUnit_Framework_TestCase
-{
-
- protected $_subscriber = null;
-
- protected $_baseuri;
-
- protected $_client = null;
-
- protected $_adapter = null;
-
- protected $_config = array(
- 'adapter' => 'Zend_Http_Client_Adapter_Socket'
- );
-
- public function setUp()
- {
- if (defined('TESTS_Zend_Feed_Pubsubhubbub_BASEURI') &&
- Zend_Uri_Http::check(TESTS_Zend_Feed_Pubsubhubbub_BASEURI)) {
- $this->_baseuri = TESTS_Zend_Feed_Pubsubhubbub_BASEURI;
- if (substr($this->_baseuri, -1) != '/') $this->_baseuri .= '/';
- $name = $this->getName();
- if (($pos = strpos($name, ' ')) !== false) {
- $name = substr($name, 0, $pos);
- }
- $uri = $this->_baseuri . $name . '.php';
- $this->_adapter = new $this->_config['adapter'];
- $this->_client = new Zend_Http_Client($uri, $this->_config);
- $this->_client->setAdapter($this->_adapter);
- Zend_Feed_Pubsubhubbub::setHttpClient($this->_client);
- $this->_subscriber = new Zend_Feed_Pubsubhubbub_Subscriber;
-
-
- $this->_storage = $this->_getCleanMock('Zend_Feed_Pubsubhubbub_Entity_TopicSubscription');
- $this->_subscriber->setStorage($this->_storage);
-
- } else {
- // Skip tests
- $this->markTestSkipped("Zend_Feed_Pubsubhubbub_Subscriber dynamic tests'
- . ' are not enabled in TestConfiguration.php");
- }
- }
-
- public function testSubscriptionRequestSendsExpectedPostData()
- {
- $this->_subscriber->setTopicUrl('http://www.example.com/topic');
- $this->_subscriber->addHubUrl($this->_baseuri . '/testRawPostData.php');
- $this->_subscriber->setCallbackUrl('http://www.example.com/callback');
- $this->_subscriber->setTestStaticToken('abc'); // override for testing
- $this->_subscriber->subscribeAll();
- $this->assertEquals(
- 'hub.callback=http%3A%2F%2Fwww.example.com%2Fcallback%3Fxhub.subscription%3D5536df06b5d'
- .'cb966edab3a4c4d56213c16a8184b&hub.lease_seconds=2592000&hub.mode='
- .'subscribe&hub.topic=http%3A%2F%2Fwww.example.com%2Ftopic&hub.veri'
- .'fy=sync&hub.verify=async&hub.verify_token=abc',
- $this->_client->getLastResponse()->getBody());
- }
-
- public function testUnsubscriptionRequestSendsExpectedPostData()
- {
- $this->_subscriber->setTopicUrl('http://www.example.com/topic');
- $this->_subscriber->addHubUrl($this->_baseuri . '/testRawPostData.php');
- $this->_subscriber->setCallbackUrl('http://www.example.com/callback');
- $this->_subscriber->setTestStaticToken('abc'); //override for testing
- $this->_subscriber->unsubscribeAll();
- $this->assertEquals(
- 'hub.callback=http%3A%2F%2Fwww.example.com%2Fcallback%3Fxhub.subscription%3D5536df06b5d'
- .'cb966edab3a4c4d56213c16a8184b&hub.mode=unsubscribe&hub.topic=http'
- .'%3A%2F%2Fwww.example.com%2Ftopic&hub.verify=sync&hub.verify=async'
- .'&hub.verify_token=abc',
- $this->_client->getLastResponse()->getBody());
- }
-
- protected function _getCleanMock($className) {
- $class = new ReflectionClass($className);
- $methods = $class->getMethods();
- $stubMethods = array();
- foreach ($methods as $method) {
- if ($method->isPublic() || ($method->isProtected()
- && $method->isAbstract())) {
- $stubMethods[] = $method->getName();
- }
- }
- $mocked = $this->getMock(
- $className,
- $stubMethods,
- array(),
- $className . '_SubscriberHttpTestMock_' . uniqid(),
- false
- );
- return $mocked;
- }
-
-}
diff --git a/tests/Zend/Feed/Pubsubhubbub/SubscriberTest.php b/tests/Zend/Feed/Pubsubhubbub/SubscriberTest.php
deleted file mode 100644
index 638ce79971..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/SubscriberTest.php
+++ /dev/null
@@ -1,354 +0,0 @@
-_subscriber = new Zend_Feed_Pubsubhubbub_Subscriber;
- $this->_adapter = $this->_getCleanMock(
- 'Zend_Db_Adapter_Abstract'
- );
- $this->_tableGateway = $this->_getCleanMock(
- 'Zend_Db_Table_Abstract'
- );
- $this->_tableGateway->expects($this->any())->method('getAdapter')
- ->will($this->returnValue($this->_adapter));
- }
-
-
- public function testAddsHubServerUrl()
- {
- $this->_subscriber->addHubUrl('http://www.example.com/hub');
- $this->assertEquals(array('http://www.example.com/hub'), $this->_subscriber->getHubUrls());
- }
-
- public function testAddsHubServerUrlsFromArray()
- {
- $this->_subscriber->addHubUrls(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ));
- $this->assertEquals(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ), $this->_subscriber->getHubUrls());
- }
-
- public function testAddsHubServerUrlsFromArrayUsingSetConfig()
- {
- $this->_subscriber->setConfig(array('hubUrls' => array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- )));
- $this->assertEquals(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ), $this->_subscriber->getHubUrls());
- }
-
- public function testRemovesHubServerUrl()
- {
- $this->_subscriber->addHubUrls(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ));
- $this->_subscriber->removeHubUrl('http://www.example.com/hub');
- $this->assertEquals(array(
- 1 => 'http://www.example.com/hub2'
- ), $this->_subscriber->getHubUrls());
- }
-
- public function testRetrievesUniqueHubServerUrlsOnly()
- {
- $this->_subscriber->addHubUrls(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2',
- 'http://www.example.com/hub'
- ));
- $this->assertEquals(array(
- 'http://www.example.com/hub', 'http://www.example.com/hub2'
- ), $this->_subscriber->getHubUrls());
- }
-
- public function testThrowsExceptionOnSettingEmptyHubServerUrl()
- {
- try {
- $this->_subscriber->addHubUrl('');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnSettingNonStringHubServerUrl()
- {
- try {
- $this->_subscriber->addHubUrl(123);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnSettingInvalidHubServerUrl()
- {
- try {
- $this->_subscriber->addHubUrl('http://');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testAddsParameter()
- {
- $this->_subscriber->setParameter('foo', 'bar');
- $this->assertEquals(array('foo'=>'bar'), $this->_subscriber->getParameters());
- }
-
- public function testAddsParametersFromArray()
- {
- $this->_subscriber->setParameters(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->assertEquals(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ), $this->_subscriber->getParameters());
- }
-
- public function testAddsParametersFromArrayInSingleMethod()
- {
- $this->_subscriber->setParameter(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->assertEquals(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ), $this->_subscriber->getParameters());
- }
-
- public function testAddsParametersFromArrayUsingSetConfig()
- {
- $this->_subscriber->setConfig(array('parameters' => array(
- 'foo' => 'bar', 'boo' => 'baz'
- )));
- $this->assertEquals(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ), $this->_subscriber->getParameters());
- }
-
- public function testRemovesParameter()
- {
- $this->_subscriber->setParameters(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->_subscriber->removeParameter('boo');
- $this->assertEquals(array(
- 'foo' => 'bar'
- ), $this->_subscriber->getParameters());
- }
-
- public function testRemovesParameterIfSetToNull()
- {
- $this->_subscriber->setParameters(array(
- 'foo' => 'bar', 'boo' => 'baz'
- ));
- $this->_subscriber->setParameter('boo', null);
- $this->assertEquals(array(
- 'foo' => 'bar'
- ), $this->_subscriber->getParameters());
- }
-
- public function testCanSetTopicUrl()
- {
- $this->_subscriber->setTopicUrl('http://www.example.com/topic');
- $this->assertEquals('http://www.example.com/topic', $this->_subscriber->getTopicUrl());
- }
-
- public function testThrowsExceptionOnSettingEmptyTopicUrl()
- {
- try {
- $this->_subscriber->setTopicUrl('');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingNonStringTopicUrl()
- {
- try {
- $this->_subscriber->setTopicUrl(123);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingInvalidTopicUrl()
- {
- try {
- $this->_subscriber->setTopicUrl('http://');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnMissingTopicUrl()
- {
- try {
- $this->_subscriber->getTopicUrl();
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testCanSetCallbackUrl()
- {
- $this->_subscriber->setCallbackUrl('http://www.example.com/callback');
- $this->assertEquals('http://www.example.com/callback', $this->_subscriber->getCallbackUrl());
- }
-
- public function testThrowsExceptionOnSettingEmptyCallbackUrl()
- {
- try {
- $this->_subscriber->setCallbackUrl('');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingNonStringCallbackUrl()
- {
- try {
- $this->_subscriber->setCallbackUrl(123);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
-
- public function testThrowsExceptionOnSettingInvalidCallbackUrl()
- {
- try {
- $this->_subscriber->setCallbackUrl('http://');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnMissingCallbackUrl()
- {
- try {
- $this->_subscriber->getCallbackUrl();
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testCanSetLeaseSeconds()
- {
- $this->_subscriber->setLeaseSeconds('10000');
- $this->assertEquals(10000, $this->_subscriber->getLeaseSeconds());
- }
-
- public function testThrowsExceptionOnSettingZeroAsLeaseSeconds()
- {
- try {
- $this->_subscriber->setLeaseSeconds(0);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnSettingLessThanZeroAsLeaseSeconds()
- {
- try {
- $this->_subscriber->setLeaseSeconds(-1);
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testThrowsExceptionOnSettingAnyScalarTypeCastToAZeroOrLessIntegerAsLeaseSeconds()
- {
- try {
- $this->_subscriber->setLeaseSeconds('0aa');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testCanSetPreferredVerificationMode()
- {
- $this->_subscriber->setPreferredVerificationMode(Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC);
- $this->assertEquals(Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC, $this->_subscriber->getPreferredVerificationMode());
- }
-
- public function testSetsPreferredVerificationModeThrowsExceptionOnSettingBadMode()
- {
- try {
- $this->_subscriber->setPreferredVerificationMode('abc');
- $this->fail('Should not fail as an Exception would be raised and caught');
- } catch (Zend_Feed_Pubsubhubbub_Exception $e) {}
- }
-
- public function testPreferredVerificationModeDefaultsToSync()
- {
- $this->assertEquals(Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC, $this->_subscriber->getPreferredVerificationMode());
- }
-
- public function testCanSetStorageImplementation()
- {
- $storage = new Zend_Feed_Pubsubhubbub_Model_Subscription($this->_tableGateway);
- $this->_subscriber->setStorage($storage);
- $this->assertThat($this->_subscriber->getStorage(), $this->identicalTo($storage));
- }
-
- /**
- * @expectedException Zend_Feed_Pubsubhubbub_Exception
- */
- public function testGetStorageThrowsExceptionIfNoneSet()
- {
- $this->_subscriber->getStorage();
- }
-
- protected function _getCleanMock($className) {
- $class = new ReflectionClass($className);
- $methods = $class->getMethods();
- $stubMethods = array();
- foreach ($methods as $method) {
- if ($method->isPublic() || ($method->isProtected()
- && $method->isAbstract())) {
- $stubMethods[] = $method->getName();
- }
- }
- $mocked = $this->getMock(
- $className,
- $stubMethods,
- array(),
- $className . '_PubsubSubscriberMock_' . uniqid(),
- false
- );
- return $mocked;
- }
-
-}
diff --git a/tests/Zend/Feed/Pubsubhubbub/_files/rss20.xml b/tests/Zend/Feed/Pubsubhubbub/_files/rss20.xml
deleted file mode 100644
index 80b98e124d..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/_files/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Pubsubhubbub/_files/testRawPostData.php b/tests/Zend/Feed/Pubsubhubbub/_files/testRawPostData.php
deleted file mode 100644
index 990f73601e..0000000000
--- a/tests/Zend/Feed/Pubsubhubbub/_files/testRawPostData.php
+++ /dev/null
@@ -1,3 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/_files/AtomStandaloneEntry';
- $this->_options = Zend_Date::setOptions();
- foreach($this->_options as $k=>$v) {
- if (is_null($v)) {
- unset($this->_options[$k]);
- }
- }
- Zend_Date::setOptions(array('format_type'=>'iso'));
- $this->_expectedCats = array(
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema2',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'cat_dog',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'Cat & Dog'
- )
- );
- $this->_expectedCatsDc = array(
- array(
- 'term' => 'topic1',
- 'scheme' => null,
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic2',
- 'scheme' => null,
- 'label' => 'topic2'
- )
- );
- }
-
- public function teardown()
- {
- Zend_Date::setOptions($this->_options);
- }
-
- public function testReaderImportOfAtomEntryDocumentReturnsEntryClass()
- {
- $object = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/id/atom10.xml')
- );
- $this->assertTrue($object instanceof Zend_Feed_Reader_Entry_Atom);
- }
-
- /**
- * Get Id (Unencoded Text)
- * @group ZFR002
- */
- public function testGetsIdFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/id/atom10.xml')
- );
- $this->assertEquals('1', $entry->getId());
- }
-
- /**
- * Get creation date (Unencoded Text)
- * @group ZFR002
- */
- public function testGetsDateCreatedFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datecreated/atom10.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($entry->getDateCreated()));
- }
-
- /**
- * Get modification date (Unencoded Text)
- * @group ZFR002
- */
- public function testGetsDateModifiedFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datemodified/atom10.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($entry->getDateModified()));
- }
-
- /**
- * Get Title (Unencoded Text)
- * @group ZFR002
- */
- public function testGetsTitleFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/title/atom10.xml')
- );
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
-
- /**
- * Get Authors (Unencoded Text)
- * @group ZFR002
- */
- public function testGetsAuthorsFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/author/atom10.xml')
- );
-
- $authors = array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs'),
- array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
- array('uri'=>'http://www.example.com'),
- array('email'=>'joe@example.com')
- );
-
- $this->assertEquals($authors, (array) $entry->getAuthors());
- }
-
- /**
- * Get Author (Unencoded Text)
- * @group ZFR002
- */
- public function testGetsAuthorFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/author/atom10.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $entry->getAuthor());
- }
-
- /**
- * Get Description (Unencoded Text)
- * @group ZFR002
- */
- public function testGetsDescriptionFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/description/atom10.xml')
- );
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
-
- /**
- * Get enclosure
- * @group ZFR002
- */
- public function testGetsEnclosureFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/enclosure/atom10.xml')
- );
-
- $expected = new stdClass();
- $expected->url = 'http://www.example.org/myaudiofile.mp3';
- $expected->length = '1234';
- $expected->type = 'audio/mpeg';
-
- $this->assertEquals($expected, $entry->getEnclosure());
- }
-
- /**
- * TEXT
- * @group ZFRATOMCONTENT
- */
- public function testGetsContentFromAtom10()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/content/atom10.xml')
- );
- $this->assertEquals('Entry Content &', $entry->getContent());
- }
-
- /**
- * HTML Escaped
- * @group ZFRATOMCONTENT
- */
- public function testGetsContentFromAtom10Html()
- {
- $entry = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/content/atom10_Html.xml')
- );
- $this->assertEquals('
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=105
- 2009-02-18T03:30:07Z
- 2009-02-15T03:29:21Z
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=94
- 2009-01-14T10:47:25Z
- 2009-01-14T10:47:25Z
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=72
- 2009-01-14T08:23:19Z
- 2009-01-13T12:57:53Z
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=68
- 2009-01-11T09:53:20Z
- 2009-01-07T11:48:31Z
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=53
- 2009-01-03T18:51:43Z
- 2009-01-03T15:49:19Z
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=44
- 2009-01-03T11:47:19Z
- 2009-01-03T10:14:38Z
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=27
- 2009-01-06T15:00:54Z
- 2009-01-02T14:49:42Z
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=22
- 2009-01-02T09:27:20Z
- 2009-01-01T23:29:35Z
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=8
- 2009-01-02T15:13:15Z
- 2009-01-01T23:02:54Z
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-
-]]>
-
-
- 0
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Common/atom_noencodingdefined.xml b/tests/Zend/Feed/Reader/Entry/_files/Common/atom_noencodingdefined.xml
deleted file mode 100644
index 3e31cbaffb..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Common/atom_noencodingdefined.xml
+++ /dev/null
@@ -1,726 +0,0 @@
-
- Norm 2782
- Why are you here?
-
- 2009-03-07T08:03:50Z
- WordPress
-
-
- http://www.norm2782.com/feed/atom/
-
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=114
- 2009-03-07T08:03:50Z
- 2009-03-02T08:09:33Z
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=105
- 2009-02-18T03:30:07Z
- 2009-02-15T03:29:21Z
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=94
- 2009-01-14T10:47:25Z
- 2009-01-14T10:47:25Z
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=72
- 2009-01-14T08:23:19Z
- 2009-01-13T12:57:53Z
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=68
- 2009-01-11T09:53:20Z
- 2009-01-07T11:48:31Z
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=53
- 2009-01-03T18:51:43Z
- 2009-01-03T15:49:19Z
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=44
- 2009-01-03T11:47:19Z
- 2009-01-03T10:14:38Z
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=27
- 2009-01-06T15:00:54Z
- 2009-01-02T14:49:42Z
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=22
- 2009-01-02T09:27:20Z
- 2009-01-01T23:29:35Z
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=8
- 2009-01-02T15:13:15Z
- 2009-01-01T23:02:54Z
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-
-]]>
-
-
- 0
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Common/atom_rewrittenbydom.xml b/tests/Zend/Feed/Reader/Entry/_files/Common/atom_rewrittenbydom.xml
deleted file mode 100644
index 5dd145a68a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Common/atom_rewrittenbydom.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=114
- 2009-03-07T08:03:50Z
- 2009-03-02T08:09:33Z
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-
-]]>
-
-
- 0
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Common/rss.xml b/tests/Zend/Feed/Reader/Entry/_files/Common/rss.xml
deleted file mode 100644
index 3d1fdfae24..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Common/rss.xml
+++ /dev/null
@@ -1,700 +0,0 @@
-
-
-
-
- Norm 2782
-
- http://www.norm2782.com
- Why are you here?
- Sat, 07 Mar 2009 08:03:50 +0000
- http://wordpress.org/?v=2.8
- en
- hourly
- 1
-
- Wth… reading books?
- http://www.norm2782.com/2009/03/wth-reading-books/
- http://www.norm2782.com/2009/03/wth-reading-books/#comments
- Mon, 02 Mar 2009 08:09:33 +0000
- norm2782
-
-
-
-
-
- http://www.norm2782.com/?p=114
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-]]>
- http://www.norm2782.com/2009/03/wth-reading-books/feed/
- 0
-
-
- My first few weeks in New Zealand
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/#comments
- Sun, 15 Feb 2009 03:29:21 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=105
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/feed/
- 0
-
-
- Properties in PHP – revisited
- http://www.norm2782.com/2009/01/properties-in-php-revisited/
- http://www.norm2782.com/2009/01/properties-in-php-revisited/#comments
- Wed, 14 Jan 2009 10:47:25 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=94
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
- http://www.norm2782.com/2009/01/properties-in-php-revisited/feed/
- 0
-
-
- Filters for Zend_Paginator
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/#comments
- Tue, 13 Jan 2009 12:57:53 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=72
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/feed/
- 0
-
-
- ZF-3239
- http://www.norm2782.com/2009/01/zf-3239/
- http://www.norm2782.com/2009/01/zf-3239/#comments
- Wed, 07 Jan 2009 11:48:31 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=68
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
- http://www.norm2782.com/2009/01/zf-3239/feed/
- 0
-
-
- New in-ear earphones
- http://www.norm2782.com/2009/01/new-in-ear-earphones/
- http://www.norm2782.com/2009/01/new-in-ear-earphones/#comments
- Sat, 03 Jan 2009 15:49:19 +0000
- norm2782
-
-
- http://www.norm2782.com/?p=53
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-]]>
- http://www.norm2782.com/2009/01/new-in-ear-earphones/feed/
- 0
-
-
- Seven Things – Tagged by Pádraic
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/#comments
- Sat, 03 Jan 2009 10:14:38 +0000
- norm2782
-
-
- http://www.norm2782.com/?p=44
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-]]>
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/feed/
- 0
-
-
- AMF Server class for WordPress
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/#comments
- Fri, 02 Jan 2009 14:49:42 +0000
- norm2782
-
-
-
-
- http://www.norm2782.com/?p=27
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-]]>
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/feed/
- 0
-
-
- Flex frontend
- http://www.norm2782.com/2009/01/flex-frontend/
- http://www.norm2782.com/2009/01/flex-frontend/#comments
- Thu, 01 Jan 2009 23:29:35 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=22
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
- http://www.norm2782.com/2009/01/flex-frontend/feed/
- 0
-
-
- Properties in PHP
- http://www.norm2782.com/2009/01/properties-in-php/
- http://www.norm2782.com/2009/01/properties-in-php/#comments
- Thu, 01 Jan 2009 23:02:54 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=8
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-]]>
- http://www.norm2782.com/2009/01/properties-in-php/feed/
- 0
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss090.xml
deleted file mode 100644
index 68e35c214a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss090.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss091.xml
deleted file mode 100644
index a8ccda602c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss091.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss092.xml
deleted file mode 100644
index 323729fdfe..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss092.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss093.xml
deleted file mode 100644
index 84a68f2fe3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss093.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss094.xml
deleted file mode 100644
index cfa540adb8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss094.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss10.xml
deleted file mode 100644
index 8c8e82631a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss10.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss20.xml
deleted file mode 100644
index 4ad1c11b74..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc10/rss20.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss090.xml
deleted file mode 100644
index 54e026b18e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss090.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss091.xml
deleted file mode 100644
index 1d7236c349..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss091.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss092.xml
deleted file mode 100644
index 578d70f05c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss092.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss093.xml
deleted file mode 100644
index bbb903713d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss093.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss094.xml
deleted file mode 100644
index e61e760750..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss094.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss10.xml
deleted file mode 100644
index 0fbb88edad..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss10.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss20.xml
deleted file mode 100644
index a38aa4b550..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/dc11/rss20.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Joe Bloggs
- Jane Bloggs
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss20.xml
deleted file mode 100644
index 610f00c724..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/author/plain/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- joe@example.com (Joe Bloggs)
- jane@example.com (Jane Bloggs)
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss090.xml
deleted file mode 100644
index 51c903fbd0..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss090.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss091.xml
deleted file mode 100644
index 450aff76bb..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss091.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss092.xml
deleted file mode 100644
index 694e2f1060..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss092.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss093.xml
deleted file mode 100644
index d331196f88..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss093.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss094.xml
deleted file mode 100644
index daa6057f2e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss094.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss10.xml
deleted file mode 100644
index d760bece2c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/atom10/rss10.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss090.xml
deleted file mode 100644
index 1c92b582a3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss090.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss091.xml
deleted file mode 100644
index f278d67da0..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss092.xml
deleted file mode 100644
index 4988e32126..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss093.xml
deleted file mode 100644
index 3696e2742f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss094.xml
deleted file mode 100644
index 967d9f228b..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss10.xml
deleted file mode 100644
index 35719e8dc1..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc10/rss10.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss090.xml
deleted file mode 100644
index 50f9b574c2..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss090.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss091.xml
deleted file mode 100644
index 256a6c62d4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss092.xml
deleted file mode 100644
index e2d7ce3e51..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss093.xml
deleted file mode 100644
index 298caefc44..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss094.xml
deleted file mode 100644
index 1cfda25165..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss10.xml
deleted file mode 100644
index 89eb512d72..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/dc11/rss10.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/rss20.xml
deleted file mode 100644
index 093db1e65c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/category/plain/rss20.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- topic1
- topic1
- topic2
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss090.xml
deleted file mode 100644
index 0da7845b38..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss090.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss091.xml
deleted file mode 100644
index 3c78d2cb7e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss091.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss092.xml
deleted file mode 100644
index 4a79517194..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss092.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss093.xml
deleted file mode 100644
index 8f967bbd62..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss093.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss094.xml
deleted file mode 100644
index c2b4c2fc58..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss094.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss10.xml
deleted file mode 100644
index b8d328ea8c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss10.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss20.xml
deleted file mode 100644
index 2a4a24551d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/atom10/rss20.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss090.xml
deleted file mode 100644
index bb459c17b3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss091.xml
deleted file mode 100644
index 83b6de8d26..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss092.xml
deleted file mode 100644
index 592e1ccd9d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss093.xml
deleted file mode 100644
index af9fe94140..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss094.xml
deleted file mode 100644
index 58907c4965..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss10.xml
deleted file mode 100644
index 74d2bb0ea7..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss20.xml
deleted file mode 100644
index a5b53433fe..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/slash10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss090.xml
deleted file mode 100644
index 9dff77958f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss091.xml
deleted file mode 100644
index fe911dda31..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss092.xml
deleted file mode 100644
index 46c514a434..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss093.xml
deleted file mode 100644
index a3f457a5ca..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss094.xml
deleted file mode 100644
index df01c1bd2e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss10.xml
deleted file mode 100644
index 0edd662eef..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss20.xml
deleted file mode 100644
index 447b3cd704..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentcount/plain/thread10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss090.xml
deleted file mode 100644
index 3138f2ded8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss091.xml
deleted file mode 100644
index 510fc983e4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss092.xml
deleted file mode 100644
index 3646e10589..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss093.xml
deleted file mode 100644
index c1ac68a394..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss094.xml
deleted file mode 100644
index dc39e98033..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss10.xml
deleted file mode 100644
index 0558187722..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss20.xml
deleted file mode 100644
index b892ba5f49..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/atom10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss090.xml
deleted file mode 100644
index 9dff77958f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss091.xml
deleted file mode 100644
index fe911dda31..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss092.xml
deleted file mode 100644
index 46c514a434..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss093.xml
deleted file mode 100644
index a3f457a5ca..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss094.xml
deleted file mode 100644
index df01c1bd2e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss10.xml
deleted file mode 100644
index f267af1611..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss20.xml
deleted file mode 100644
index 447b3cd704..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/thread10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 321
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss090.xml
deleted file mode 100644
index e9b17e30dc..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/entry/321/feed/rss/
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss091.xml
deleted file mode 100644
index 6790a65f67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry/321/feed/rss/
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss092.xml
deleted file mode 100644
index a246decf3f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry/321/feed/rss/
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss093.xml
deleted file mode 100644
index dc135d776a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry/321/feed/rss/
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss094.xml
deleted file mode 100644
index 064a99ad8f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry/321/feed/rss/
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss10.xml
deleted file mode 100644
index ad848d87f8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/entry/321/feed/rss/
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss20.xml
deleted file mode 100644
index 8dbf72263d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentfeedlink/plain/wellformedweb/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry/321/feed/rss/
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss090.xml
deleted file mode 100644
index 748cdc26a7..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss091.xml
deleted file mode 100644
index d5e6d1dd47..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss092.xml
deleted file mode 100644
index d5573c5ad0..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss093.xml
deleted file mode 100644
index ff8a1d3109..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss094.xml
deleted file mode 100644
index 1cb3cecc22..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss10.xml
deleted file mode 100644
index 0e0c4d5c3c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss20.xml
deleted file mode 100644
index d9bd4abaea..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/atom10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss091.xml
deleted file mode 100644
index e894ea509c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss091.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/comments
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss092.xml
deleted file mode 100644
index 1bbad33a3c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss092.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/comments
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss093.xml
deleted file mode 100644
index ee1e64a06d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss093.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/comments
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss094.xml
deleted file mode 100644
index ecb37067ae..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss094.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/comments
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss20.xml
deleted file mode 100644
index c1eabeaae8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/commentlink/plain/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/comments
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss090.xml
deleted file mode 100644
index c291864664..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss091.xml
deleted file mode 100644
index 5af9974f2a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss092.xml
deleted file mode 100644
index 65760fa0af..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss093.xml
deleted file mode 100644
index 2a2dba03d3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss094.xml
deleted file mode 100644
index c4f0785272..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss10.xml
deleted file mode 100644
index 941d89c370..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss20.xml
deleted file mode 100644
index c6664ac927..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/description/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss090.xml
deleted file mode 100644
index deb85415d6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Content
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss091.xml
deleted file mode 100644
index b596e9abf1..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Content
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss092.xml
deleted file mode 100644
index fcbc3e3c5b..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Content
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss093.xml
deleted file mode 100644
index a3c1d5fd6e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Content
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss094.xml
deleted file mode 100644
index 9f3653abba..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Content
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss10.xml
deleted file mode 100644
index be080266e7..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Content
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss20.xml
deleted file mode 100644
index 4600c6200a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/content/plain/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Content
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss090.xml
deleted file mode 100644
index 9db7fd7d0e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss091.xml
deleted file mode 100644
index 3ea5f10594..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss092.xml
deleted file mode 100644
index 28a22f969f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss093.xml
deleted file mode 100644
index 8c2a573c04..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss094.xml
deleted file mode 100644
index 770aa0f537..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss10.xml
deleted file mode 100644
index 75e8f22ac9..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss20.xml
deleted file mode 100644
index 8e25d37dcf..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/atom10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss090.xml
deleted file mode 100644
index c54b103a79..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss091.xml
deleted file mode 100644
index 8d460b0751..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss092.xml
deleted file mode 100644
index 2f6bf523bc..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss093.xml
deleted file mode 100644
index e4744b7e01..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss094.xml
deleted file mode 100644
index c049daf36b..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss10.xml
deleted file mode 100644
index 4763d18d4f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss20.xml
deleted file mode 100644
index c5c82b6779..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss090.xml
deleted file mode 100644
index cf4c825f85..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss091.xml
deleted file mode 100644
index 06a1efff75..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss092.xml
deleted file mode 100644
index d9faf9f2c3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss093.xml
deleted file mode 100644
index f2a5fedd1d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss094.xml
deleted file mode 100644
index 95ec42593b..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss10.xml
deleted file mode 100644
index 608b8b9a47..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss20.xml
deleted file mode 100644
index 7e95d8aece..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/dc11/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- 2009-03-07T08:03:50Z
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20-zf-7908.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20-zf-7908.xml
deleted file mode 100644
index 7d3874922d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20-zf-7908.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Sun, 11 Jan 2009 09:55:59 GMT
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20.xml
deleted file mode 100644
index 527c94b245..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Sat, 07 Mar 2009 08:03:50 +0000
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20_en_US.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20_en_US.xml
deleted file mode 100644
index c48ba68ed7..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/datemodified/plain/rss20_en_US.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Mon, 4 Jan 2010 02:14:00 CST
-
-
-
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss090.xml
deleted file mode 100644
index 0399f8780a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss091.xml
deleted file mode 100644
index 47148987b8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss092.xml
deleted file mode 100644
index 1b5e129a70..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss093.xml
deleted file mode 100644
index 63e562d013..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss094.xml
deleted file mode 100644
index e647d4bc89..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss10.xml
deleted file mode 100644
index 26d899f88f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss20.xml
deleted file mode 100644
index 08bff72eb1..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss090.xml
deleted file mode 100644
index c291864664..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss091.xml
deleted file mode 100644
index 5af9974f2a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss092.xml
deleted file mode 100644
index 65760fa0af..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss093.xml
deleted file mode 100644
index 2a2dba03d3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss094.xml
deleted file mode 100644
index c4f0785272..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss10.xml
deleted file mode 100644
index 941d89c370..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss20.xml
deleted file mode 100644
index c6664ac927..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/dc11/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss090.xml
deleted file mode 100644
index 08c37dbb74..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss090.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss091.xml
deleted file mode 100644
index bbfba4e65f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss091.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss092.xml
deleted file mode 100644
index cb1d8367a7..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss092.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss093.xml
deleted file mode 100644
index 6007bef377..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss093.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss094.xml
deleted file mode 100644
index ced02b990a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss094.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss10.xml
deleted file mode 100644
index 95668d4761..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss10.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss20.xml
deleted file mode 100644
index 31d1e2180a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/description/plain/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Description
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/enclosure/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/enclosure/plain/rss10.xml
deleted file mode 100644
index 7193be64c8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/enclosure/plain/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/enclosure/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/enclosure/plain/rss20.xml
deleted file mode 100644
index 48bfbd34e1..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/enclosure/plain/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss090.xml
deleted file mode 100644
index 124a3f0e6d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss091.xml
deleted file mode 100644
index 7e44ca8878..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss092.xml
deleted file mode 100644
index b74ab66d18..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss093.xml
deleted file mode 100644
index 67a32177d9..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss094.xml
deleted file mode 100644
index 4c7175a6c3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss10.xml
deleted file mode 100644
index c6cb3b3b51..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss20.xml
deleted file mode 100644
index fda4aa1f86..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss090.xml
deleted file mode 100644
index bbc8851c92..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss091.xml
deleted file mode 100644
index 4daf0e8ebb..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss092.xml
deleted file mode 100644
index db93413818..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss093.xml
deleted file mode 100644
index 35129efb70..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss094.xml
deleted file mode 100644
index cb77dbf51d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss10.xml
deleted file mode 100644
index b0e9c5bc4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss20.xml
deleted file mode 100644
index 7d3c4b20a3..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/dc11/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss20.xml
deleted file mode 100644
index c80f75202d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/1
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss090.xml
deleted file mode 100644
index 3d07454543..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss091.xml
deleted file mode 100644
index bf84a7d8b2..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss092.xml
deleted file mode 100644
index 343a78de7c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss093.xml
deleted file mode 100644
index 7ff5e6d8d2..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss094.xml
deleted file mode 100644
index 32e9ddc33a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss10.xml
deleted file mode 100644
index 66e290d234..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss20.xml
deleted file mode 100644
index 017ee3cb34..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/id/plain/title/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss090.xml
deleted file mode 100644
index f629a31b3d..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss090.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- http://www.example.com/entry
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss091.xml
deleted file mode 100644
index 3b3718c07b..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss091.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/entry
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss092.xml
deleted file mode 100644
index 37c3483f8f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss092.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/entry
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss093.xml
deleted file mode 100644
index 87bca96ac4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss093.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/entry
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss094.xml
deleted file mode 100644
index 6d98958152..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss094.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/entry
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss10.xml
deleted file mode 100644
index 5b9faeeb78..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss10.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- http://www.example.com/entry
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss20.xml
deleted file mode 100644
index 6b58de284a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/link/plain/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- http://www.example.com/entry
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss090.xml
deleted file mode 100644
index dad0c29061..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/entry
- http://www.example.com/entry2
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss091.xml
deleted file mode 100644
index 540253611c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry
- http://www.example.com/entry2
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss092.xml
deleted file mode 100644
index ff8bc7d3c4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry
- http://www.example.com/entry2
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss093.xml
deleted file mode 100644
index f141e4f723..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry
- http://www.example.com/entry2
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss094.xml
deleted file mode 100644
index 130e9df826..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry
- http://www.example.com/entry2
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss10.xml
deleted file mode 100644
index 0ec0f34f46..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- http://www.example.com/entry
- http://www.example.com/entry2
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss20.xml
deleted file mode 100644
index 66a155fba4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/links/plain/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- http://www.example.com/entry
- http://www.example.com/entry2
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss090.xml
deleted file mode 100644
index ac8b9ea926..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss091.xml
deleted file mode 100644
index 000e140428..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss092.xml
deleted file mode 100644
index 19b09aa47b..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss093.xml
deleted file mode 100644
index d435832011..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss094.xml
deleted file mode 100644
index f6705f1804..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss10.xml
deleted file mode 100644
index 7f15ef3dff..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss20.xml
deleted file mode 100644
index 556662317e..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc10/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss090.xml
deleted file mode 100644
index 3d07454543..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss090.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss091.xml
deleted file mode 100644
index bf84a7d8b2..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss091.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss092.xml
deleted file mode 100644
index 343a78de7c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss092.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss093.xml
deleted file mode 100644
index 7ff5e6d8d2..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss093.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss094.xml
deleted file mode 100644
index 32e9ddc33a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss094.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss10.xml
deleted file mode 100644
index 66e290d234..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss10.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss20.xml
deleted file mode 100644
index 017ee3cb34..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/dc11/rss20.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss090.xml
deleted file mode 100644
index 57814153a8..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss090.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss091.xml
deleted file mode 100644
index 04d999e3c6..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss091.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss092.xml
deleted file mode 100644
index 8b31a0745c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss092.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss093.xml
deleted file mode 100644
index 31d61445b4..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss093.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss094.xml
deleted file mode 100644
index e375a1d94c..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss094.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss10.xml
deleted file mode 100644
index 0ab6cc5b67..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss20.xml
deleted file mode 100644
index 8ace034d4a..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/none/rss20.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss090.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss090.xml
deleted file mode 100644
index 120da2a68f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss090.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss091.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss091.xml
deleted file mode 100644
index d181865025..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss091.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss092.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss092.xml
deleted file mode 100644
index 57b71b1dc2..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss092.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss093.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss093.xml
deleted file mode 100644
index 990fbaf37f..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss093.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss094.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss094.xml
deleted file mode 100644
index d1af2a7512..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss094.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss10.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss10.xml
deleted file mode 100644
index 75045d5edb..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss10.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss20.xml b/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss20.xml
deleted file mode 100644
index 056d3f8c03..0000000000
--- a/tests/Zend/Feed/Reader/Entry/_files/Rss/title/plain/rss20.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- Entry Title
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/AtomSourceTest.php b/tests/Zend/Feed/Reader/Feed/AtomSourceTest.php
deleted file mode 100644
index 96f78c3a72..0000000000
--- a/tests/Zend/Feed/Reader/Feed/AtomSourceTest.php
+++ /dev/null
@@ -1,306 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/_files/AtomSource';
- $this->_options = Zend_Date::setOptions();
- foreach($this->_options as $k=>$v) {
- if (is_null($v)) {
- unset($this->_options[$k]);
- }
- }
- Zend_Date::setOptions(array('format_type'=>'iso'));
- $this->_expectedCats = array(
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema2',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'cat_dog',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'Cat & Dog'
- )
- );
- $this->_expectedCatsDc = array(
- array(
- 'term' => 'topic1',
- 'scheme' => null,
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic2',
- 'scheme' => null,
- 'label' => 'topic2'
- )
- );
- }
-
- public function teardown()
- {
- Zend_Date::setOptions($this->_options);
- }
-
- public function testGetsSourceFromEntry()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertTrue($source instanceof Zend_Feed_Reader_Feed_Atom_Source);
- }
-
- /**
- * Get Title (Unencoded Text)
- */
-
- public function testGetsTitleFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('My Title', $source->getTitle());
- }
-
- /**
- * Get Authors (Unencoded Text)
- */
-
- public function testGetsAuthorArrayFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/atom10.xml')
- );
- $source = $feed->current()->getSource();
-
- $authors = array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs'),
- array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
- array('uri'=>'http://www.example.com'),
- array('email'=>'joe@example.com')
- );
-
- $this->assertEquals($authors, (array) $source->getAuthors());
- }
-
- /**
- * Get Single Author (Unencoded Text)
- */
-
- public function testGetsSingleAuthorFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/atom10.xml')
- );
- $source = $feed->current()->getSource();
-
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $feed->getAuthor());
- }
-
- /**
- * Get creation date (Unencoded Text)
- */
-
- public function testGetsDateCreatedFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datecreated/atom10.xml')
- );
- $source = $feed->current()->getSource();
-
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($source->getDateCreated()));
- }
-
- /**
- * Get modification date (Unencoded Text)
- */
-
- public function testGetsDateModifiedFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datemodified/atom10.xml')
- );
- $source = $feed->current()->getSource();
-
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($source->getDateModified()));
- }
-
- /**
- * Get Generator (Unencoded Text)
- */
-
- public function testGetsGeneratorFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('Zend_Feed', $source->getGenerator());
- }
-
- /**
- * Get Copyright (Unencoded Text)
- */
-
- public function testGetsCopyrightFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('Copyright 2008', $source->getCopyright());
- }
-
- /**
- * Get Description (Unencoded Text)
- */
-
- public function testGetsDescriptionFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('My Description', $source->getDescription());
- }
-
- /**
- * Get Id (Unencoded Text)
- */
-
- public function testGetsIdFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/id/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('123', $source->getId());
- }
-
- /**
- * Get Language (Unencoded Text)
- */
-
- public function testGetsLanguageFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('en-GB', $source->getLanguage());
- }
-
- /**
- * Get Link (Unencoded Text)
- */
-
- public function testGetsLinkFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('http://www.example.com', $source->getLink());
- }
-
- /**
- * Get Feed Link (Unencoded Text)
- */
-
- public function testGetsFeedLinkFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals('http://www.example.com/feed/atom', $source->getFeedLink());
- }
-
- /**
- * Get Pubsubhubbub Hubs
- */
- public function testGetsHubsFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $source->getHubs());
- }
-
- /**
- * Get category data
- */
- public function testGetsCategoriesFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/atom10.xml')
- );
- $source = $feed->current()->getSource();
- $this->assertEquals($this->_expectedCats, (array) $source->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($source->getCategories()->getValues()));
- }
-
-}
diff --git a/tests/Zend/Feed/Reader/Feed/AtomTest.php b/tests/Zend/Feed/Reader/Feed/AtomTest.php
deleted file mode 100644
index f4e22c6098..0000000000
--- a/tests/Zend/Feed/Reader/Feed/AtomTest.php
+++ /dev/null
@@ -1,589 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/_files/Atom';
- $this->_options = Zend_Date::setOptions();
- foreach($this->_options as $k=>$v) {
- if (is_null($v)) {
- unset($this->_options[$k]);
- }
- }
- Zend_Date::setOptions(array('format_type'=>'iso'));
- $this->_expectedCats = array(
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema2',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'cat_dog',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'Cat & Dog'
- )
- );
- $this->_expectedCatsDc = array(
- array(
- 'term' => 'topic1',
- 'scheme' => null,
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic2',
- 'scheme' => null,
- 'label' => 'topic2'
- )
- );
- }
-
- public function teardown()
- {
- Zend_Date::setOptions($this->_options);
- }
-
- /**
- * Get Title (Unencoded Text)
- */
- public function testGetsTitleFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom03.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- /**
- * Get Authors (Unencoded Text)
- */
- public function testGetsAuthorArrayFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom03.xml')
- );
-
- $authors = array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs'),
- array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
- array('uri'=>'http://www.example.com'),
- array('email'=>'joe@example.com')
- );
-
- $this->assertEquals($authors, (array) $feed->getAuthors());
- }
-
- public function testGetsAuthorArrayFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10.xml')
- );
-
- $authors = array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
- array('name'=>'Joe Bloggs'),
- array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
- array('uri'=>'http://www.example.com'),
- array('email'=>'joe@example.com')
- );
-
- $this->assertEquals($authors, (array) $feed->getAuthors());
- }
-
- /**
- * Get Single Author (Unencoded Text)
- */
- public function testGetsSingleAuthorFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom03.xml')
- );
-
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10.xml')
- );
-
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $feed->getAuthor());
- }
-
- /**
- * Get creation date (Unencoded Text)
- */
- public function testGetsDateCreatedFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datecreated/plain/atom03.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateCreated()));
- }
-
- public function testGetsDateCreatedFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datecreated/plain/atom10.xml')
- );
-
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateCreated()));
- }
-
- /**
- * Get modification date (Unencoded Text)
- */
- public function testGetsDateModifiedFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datemodified/plain/atom03.xml')
- );
-
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath . '/datemodified/plain/atom10.xml')
- );
-
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- /**
- * Get Last Build Date (Unencoded Text)
- */
- public function testGetsLastBuildDateAlwaysReturnsNullForAtom()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10.xml')
- );
- $this->assertNull($feed->getLastBuildDate());
- }
-
- /**
- * Get Generator (Unencoded Text)
- */
- public function testGetsGeneratorFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/atom03.xml')
- );
- $this->assertEquals('Zend_Feed', $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/atom10.xml')
- );
- $this->assertEquals('Zend_Feed', $feed->getGenerator());
- }
-
- /**
- * Get Copyright (Unencoded Text)
- */
- public function testGetsCopyrightFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/atom03.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/atom10.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- /**
- * Get Description (Unencoded Text)
- */
- public function testGetsDescriptionFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/atom03.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/atom10.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- /**
- * Get Id (Unencoded Text)
- */
- public function testGetsIdFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/id/plain/atom03.xml')
- );
- $this->assertEquals('123', $feed->getId());
- }
-
- public function testGetsIdFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/id/plain/atom10.xml')
- );
- $this->assertEquals('123', $feed->getId());
- }
-
- /**
- * Get Language (Unencoded Text)
- */
- public function testGetsLanguageFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/atom03.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/atom10.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- /**
- * Get Link (Unencoded Text)
- */
- public function testGetsLinkFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/atom03.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/atom10.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromAtom10WithNoRelAttribute()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/atom10-norel.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromAtom10WithRelativeUrl()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/atom10-relative.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- /**
- * Get Base Uri
- */
- public function testGetsBaseUriFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/atom10-relative.xml')
- );
- $this->assertEquals('http://www.example.com/', $feed->getBaseUrl());
- }
-
- /**
- * Get Feed Link (Unencoded Text)
- */
- public function testGetsFeedLinkFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/atom03.xml')
- );
- $this->assertEquals('http://www.example.com/feed/atom', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/atom10.xml')
- );
- $this->assertEquals('http://www.example.com/feed/atom', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromAtom10IfRelativeUri()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/atom10-relative.xml')
- );
- $this->assertEquals('http://www.example.com/feed/atom', $feed->getFeedLink());
- }
-
- public function testGetsOriginalSourceUriIfFeedLinkNotAvailableFromFeed()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/atom10_NoFeedLink.xml')
- );
- $feed->setOriginalSourceUri('http://www.example.com/feed/atom');
- $this->assertEquals('http://www.example.com/feed/atom', $feed->getFeedLink());
- }
-
- /**
- * Get Pubsubhubbub Hubs
- */
- public function testGetsHubsFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom03.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- public function testGetsHubsFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
-
- /**
- * Implements Countable
- */
-
- public function testCountableInterface()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/atom10.xml')
- );
- $this->assertEquals(0, count($feed));
- }
-
- /**
- * Get category data
- */
-
- // Atom 1.0 (Atom 0.3 never supported categories except via Atom 1.0/Dublin Core extensions)
-
- public function testGetsCategoriesFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom10.xml')
- );
- $this->assertEquals($this->_expectedCats, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromAtom03_Atom10Extension()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom03.xml')
- );
- $this->assertEquals($this->_expectedCats, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- // DC 1.0/1.1 for Atom 0.3
-
- public function testGetsCategoriesFromAtom03_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc10/atom03.xml')
- );
- $this->assertEquals($this->_expectedCatsDc, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromAtom03_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc11/atom03.xml')
- );
- $this->assertEquals($this->_expectedCatsDc, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- // No Categories In Entry
-
- public function testGetsCategoriesFromAtom10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/atom10.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromAtom03_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/atom03.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- /**
- * Get Image (Unencoded Text)
- */
- public function testGetsImageFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/atom03.xml')
- );
- $this->assertEquals(array('uri'=>'http://www.example.com/logo.gif'), $feed->getImage());
- }
-
- public function testGetsImageFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/atom10.xml')
- );
- $this->assertEquals(array('uri'=>'http://www.example.com/logo.gif'), $feed->getImage());
- }
-
- /**
- * Get Image (Unencoded Text) When Missing
- */
- public function testGetsImageFromAtom03_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/atom03.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- public function testGetsImageFromAtom10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/atom10.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- /**
- * Get Icon (Unencoded Text)
- */
- public function testGetsIconFromAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/icon/plain/atom03.xml')
- );
- $this->assertEquals(array('uri'=>'http://www.example.com/logo.gif'), $feed->getIcon());
- }
-
- public function testGetsIconFromAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/icon/plain/atom10.xml')
- );
- $this->assertEquals(array('uri'=>'http://www.example.com/logo.gif'), $feed->getIcon());
- }
-
- /**
- * Get Icon (Unencoded Text) When Missing
- */
- public function testGetsIconFromAtom03_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/icon/plain/none/atom03.xml')
- );
- $this->assertEquals(null, $feed->getIcon());
- }
-
- public function testGetsIconFromAtom10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/icon/plain/none/atom10.xml')
- );
- $this->assertEquals(null, $feed->getIcon());
- }
-}
diff --git a/tests/Zend/Feed/Reader/Feed/CommonTest.php b/tests/Zend/Feed/Reader/Feed/CommonTest.php
deleted file mode 100644
index 7e8c223f74..0000000000
--- a/tests/Zend/Feed/Reader/Feed/CommonTest.php
+++ /dev/null
@@ -1,132 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/_files/Common';
- }
-
- /**
- * Check DOM Retrieval and Information Methods
- */
- public function testGetsDomDocumentObject()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertTrue($feed->getDomDocument() instanceof DOMDocument);
- }
-
- public function testGetsDomXpathObject()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertTrue($feed->getXpath() instanceof DOMXPath);
- }
-
- public function testGetsXpathPrefixString()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertTrue($feed->getXpathPrefix() == '/atom:feed');
- }
-
- public function testGetsDomElementObject()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertTrue($feed->getElement() instanceof DOMElement);
- }
-
- public function testSaveXmlOutputsXmlStringForFeed()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertEquals($feed->saveXml(), file_get_contents($this->_feedSamplePath.'/atom_rewrittenbydom.xml'));
- }
-
- public function testGetsNamedExtension()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertTrue($feed->getExtension('Atom') instanceof Zend_Feed_Reader_Extension_Atom_Feed);
- }
-
- public function testReturnsNullIfExtensionDoesNotExist()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertEquals(null, $feed->getExtension('Foo'));
- }
-
- /**
- * @group ZF-8213
- */
- public function testReturnsEncodingOfFeed()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom.xml')
- );
- $this->assertEquals('UTF-8', $feed->getEncoding());
- }
-
- /**
- * @group ZF-8213
- */
- public function testReturnsEncodingOfFeedAsUtf8IfUndefined()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/atom_noencodingdefined.xml')
- );
- $this->assertEquals('UTF-8', $feed->getEncoding());
- }
-
-
-}
diff --git a/tests/Zend/Feed/Reader/Feed/RssTest.php b/tests/Zend/Feed/Reader/Feed/RssTest.php
deleted file mode 100644
index 45ba6dcaec..0000000000
--- a/tests/Zend/Feed/Reader/Feed/RssTest.php
+++ /dev/null
@@ -1,2979 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/_files/Rss';
- $this->_options = Zend_Date::setOptions();
- foreach($this->_options as $k=>$v) {
- if (is_null($v)) {
- unset($this->_options[$k]);
- }
- }
- Zend_Date::setOptions(array('format_type'=>'iso'));
- $this->_expectedCats = array(
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema2',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic2',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic2'
- )
- );
- $this->_expectedCatsRdf = array(
- array(
- 'term' => 'topic1',
- 'scheme' => null,
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic2',
- 'scheme' => null,
- 'label' => 'topic2'
- )
- );
- $this->_expectedCatsAtom = array(
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema2',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'cat_dog',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'Cat & Dog'
- )
- );
- }
-
- public function teardown()
- {
- Zend_Date::setOptions($this->_options);
- }
-
- /**
- * Get Title (Unencoded Text)
- */
- public function testGetsTitleFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/rss20.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/rss094.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/rss093.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/rss092.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/rss091.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/rss10.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/rss090.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- // DC 1.0
-
- public function testGetsTitleFromRss20_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss20.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss094.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss093.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss092.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss091.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss10.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss090.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- // DC 1.1
-
- public function testGetsTitleFromRss20_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss20.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss094.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss093.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss092.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss091.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss10.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss090.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- // Atom 1.0
-
- public function testGetsTitleFromRss20_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss20.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss094_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss094.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss093_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss093.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss092_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss092.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss091_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss091.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss10_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss10.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- public function testGetsTitleFromRss090_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss090.xml')
- );
- $this->assertEquals('My Title', $feed->getTitle());
- }
-
- // Missing Title
-
- public function testGetsTitleFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getTitle());
- }
-
- public function testGetsTitleFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getTitle());
- }
-
- public function testGetsTitleFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getTitle());
- }
-
- public function testGetsTitleFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getTitle());
- }
-
- public function testGetsTitleFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getTitle());
- }
-
- public function testGetsTitleFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getTitle());
- }
-
- public function testGetsTitleFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/title/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getTitle());
- }
-
- /**
- * Get Authors (Unencoded Text)
- */
- public function testGetsAuthorArrayFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
- );
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss094.xml')
- );
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss093.xml')
- );
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss092.xml')
- );
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss091.xml')
- );
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss10.xml')
- );
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss090.xml')
- );
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- // DC 1.0
-
- public function testGetsAuthorArrayFromRss20_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());;
- }
-
- // DC 1.1
-
- public function testGetsAuthorArrayFromRss20_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- // Atom 1.0
-
- public function testGetsAuthorArrayFromRss20_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss20.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss094_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss094.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss093_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss093.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss092_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss092.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss091_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss091.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss10_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss10.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- public function testGetsAuthorArrayFromRss090_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss090.xml')
- );
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $feed->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
- }
-
- // Missing Authors
-
- public function testGetsAuthorArrayFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getAuthors());
- }
-
- public function testGetsAuthorArrayFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getAuthors());
- }
-
- public function testGetsAuthorArrayFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getAuthors());
- }
-
- public function testGetsAuthorArrayFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getAuthors());
- }
-
- public function testGetsAuthorArrayFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getAuthors());
- }
-
- public function testGetsAuthorArrayFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getAuthors());
- }
-
- public function testGetsAuthorArrayFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getAuthors());
- }
-
- /**
- * Get Single Author (Unencoded Text)
- */
- public function testGetsSingleAuthorFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss094.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss093.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss092.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss091.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss10.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/rss090.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
- }
-
- // DC 1.0
-
- public function testGetsSingleAuthorFromRss20_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- // DC 1.1
-
- public function testGetsSingleAuthorFromRss20_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
- );
- $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
- }
-
- // Missing Author
-
- public function testGetsSingleAuthorFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getAuthor());
- }
-
- public function testGetsSingleAuthorFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/author/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getAuthor());
- }
-
- /**
- * Get Copyright (Unencoded Text)
- */
- public function testGetsCopyrightFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/rss20.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/rss094.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/rss093.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/rss092.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/rss091.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/rss10.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/rss090.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- // DC 1.0
-
- public function testGetsCopyrightFromRss20_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss20.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss094.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss093.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss092.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss091.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss10.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss090.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- // DC 1.1
-
- public function testGetsCopyrightFromRss20_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss20.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss094.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss093.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss092.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss091.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss10.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss090.xml')
- );
- $this->assertEquals('Copyright 2008', $feed->getCopyright());
- }
-
- // Missing Copyright
-
- public function testGetsCopyrightFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsCopyrightFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- /**
- * Get Description (Unencoded Text)
- */
- public function testGetsDescriptionFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/rss20.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/rss094.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/rss093.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/rss092.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/rss091.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/rss10.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/rss090.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- // DC 1.0
-
- public function testGetsDescriptionFromRss20_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss20.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss094.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss093.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss092.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss091.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss10.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss090.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- // DC 1.1
-
- public function testGetsDescriptionFromRss20_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss20.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss094.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss093.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss092.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss091.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss10.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss090.xml')
- );
- $this->assertEquals('My Description', $feed->getDescription());
- }
-
- // Missing Description
-
- public function testGetsDescriptionFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getDescription());
- }
-
- public function testGetsDescriptionFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/description/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getDescription());
- }
-
- /**
- * Get Language (Unencoded Text)
- */
- public function testGetsLanguageFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rss20.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rss094.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rss093.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rss092.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rss091.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rss10.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rss090.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- // DC 1.0
-
- public function testGetsLanguageFromRss20_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss20.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss094.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss093.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss092.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss091.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss10.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss090.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- // DC 1.1
-
- public function testGetsLanguageFromRss20_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss20.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss094.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss093.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss092.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss091.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss10.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss090.xml')
- );
- $this->assertEquals('en-GB', $feed->getLanguage());
- }
-
- // Other
-
- public function testGetsLanguageFromRss10_XmlLang()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/rdf/rss10.xml')
- );
- $this->assertEquals('en', $feed->getLanguage());
- }
-
- // Missing Language
-
- public function testGetsLanguageFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- public function testGetsLanguageFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/language/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getLanguage());
- }
-
- /**
- * Get Link (Unencoded Text)
- */
- public function testGetsLinkFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/rss20.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/rss094.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/rss093.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/rss092.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/rss091.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/rss10.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- public function testGetsLinkFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/rss090.xml')
- );
- $this->assertEquals('http://www.example.com', $feed->getLink());
- }
-
- // Missing Link
-
- public function testGetsLinkFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getLink());
- }
-
- public function testGetsLinkFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getLink());
- }
-
- public function testGetsLinkFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getLink());
- }
-
- public function testGetsLinkFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getLink());
- }
-
- public function testGetsLinkFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getLink());
- }
-
- public function testGetsLinkFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getLink());
- }
-
- public function testGetsLinkFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getLink());
- }
-
- /**
- * Implements Countable
- */
-
- public function testCountableInterface()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/link/plain/none/rss090.xml')
- );
- $this->assertEquals(0, count($feed));
- }
-
- /**
- * Get Feed Link (Unencoded Text)
- */
- public function testGetsFeedLinkFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss20.xml')
- );
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- public function testGetsOriginalSourceUriIfFeedLinkNotAvailableFromFeed()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss20_NoFeedLink.xml')
- );
- $feed->setOriginalSourceUri('http://www.example.com/feed/rss');
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss094.xml')
- );
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss093.xml')
- );
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss092.xml')
- );
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss091.xml')
- );
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss10.xml')
- );
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss090.xml')
- );
- $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
- }
-
- // Missing Feed Link
-
- public function testGetsFeedLinkFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getFeedLink());
- }
-
- public function testGetsFeedLinkFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getFeedLink());
- }
-
- /**
- * Get Generator (Unencoded Text)
- */
- public function testGetsGeneratorFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/rss20.xml')
- );
- $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/rss094.xml')
- );
- $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/rss093.xml')
- );
- $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/rss092.xml')
- );
- $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/rss091.xml')
- );
- $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/rss10.xml')
- );
- $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/rss090.xml')
- );
- $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
- }
-
- // Missing Generator
-
- public function testGetsGeneratorFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getGenerator());
- }
-
- public function testGetsGeneratorFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getGenerator());
- }
-
- /**
- * Get Last Build Date (Unencoded Text)
- */
- public function testGetsLastBuildDateFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/lastbuilddate/plain/rss20.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getLastBuildDate()));
- }
-
- public function testGetsLastBuildDateFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/lastbuilddate/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getLastBuildDate());
- }
-
- /**
- * Get Date Modified (Unencoded Text)
- */
- public function testGetsDateModifiedFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/rss20.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- /**
- * @group ZF-8702
- */
- public function testParsesCorrectDateIfMissingOffsetWhenSystemUsesUSLocale()
- {
- $locale = new Zend_Locale('en_US');
- Zend_Registry::set('Zend_Locale', $locale);
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/rss20_en_US.xml')
- );
- $fdate = $feed->getDateModified();
- $edate = new Zend_Date;
- $edate->set('2010-01-04T02:14:00-0600', Zend_Date::ISO_8601);
- Zend_Registry::getInstance()->offsetUnset('Zend_Locale');
- $this->assertTrue($edate->equals($fdate));
- }
-
- // DC 1.0
-
- public function testGetsDateModifiedFromRss20_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss20.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss094.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss093.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss092.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss091.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss10.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss090.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- // DC 1.1
-
- public function testGetsDateModifiedFromRss20_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss20.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss094.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss093.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss092.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss091.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss10.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss090.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- // Atom 1.0
-
- public function testGetsDateModifiedFromRss20_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss20.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss094_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss094.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss093_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss093.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss092_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss092.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss091_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss091.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss10_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss10.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- public function testGetsDateModifiedFromRss090_atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss090.xml')
- );
- $edate = new Zend_Date;
- $edate->set('2009-03-07T08:03:50Z', Zend_Date::ISO_8601);
- $this->assertTrue($edate->equals($feed->getDateModified()));
- }
-
- // Missing DateModified
-
- public function testGetsDateModifiedFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getDateModified());
- }
-
- public function testGetsDateModifiedFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getDateModified());
- }
-
- public function testGetsDateModifiedFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getDateModified());
- }
-
- public function testGetsDateModifiedFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getDateModified());
- }
-
- public function testGetsDateModifiedFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getDateModified());
- }
-
- public function testGetsDateModifiedFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getDateModified());
- }
-
- public function testGetsDateModifiedFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getDateModified());
- }
-
- /**
- * Get Hubs (Unencoded Text)
- */
- public function testGetsHubsFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss20.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- public function testGetsHubsFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss094.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- public function testGetsHubsFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss093.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- public function testGetsHubsFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss092.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- public function testGetsHubsFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss091.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- public function testGetsHubsFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss10.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- public function testGetsHubsFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss090.xml')
- );
- $this->assertEquals(array(
- 'http://www.example.com/hub1',
- 'http://www.example.com/hub2'
- ), $feed->getHubs());
- }
-
- // Missing Hubs
-
- public function testGetsHubsFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getHubs());
- }
-
- public function testGetsHubsFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getHubs());
- }
-
- public function testGetsHubsFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getHubs());
- }
-
- public function testGetsHubsFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getHubs());
- }
-
- public function testGetsHubsFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getHubs());
- }
-
- public function testGetsHubsFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getHubs());
- }
-
- public function testGetsHubsFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getHubs());
- }
-
- /**
- * Get category data
- */
-
- // RSS 2.0
-
- public function testGetsCategoriesFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/rss20.xml')
- );
- $this->assertEquals($this->_expectedCats, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- // DC 1.0
-
- public function testGetsCategoriesFromRss090_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss090.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss091_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss091.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss092_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss092.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss093_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss093.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss094_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss094.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss10_Dc10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss10.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- // DC 1.1
-
- public function testGetsCategoriesFromRss090_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss090.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss091_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss091.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss092_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss092.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss093_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss093.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss094_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss094.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss10_Dc11()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss10.xml')
- );
- $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
- }
-
- // Atom 1.0
-
- public function testGetsCategoriesFromRss090_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss090.xml')
- );
- $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss091_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss091.xml')
- );
- $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss092_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss092.xml')
- );
- $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss093_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss093.xml')
- );
- $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss094_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss094.xml')
- );
- $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss10_Atom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss10.xml')
- );
- $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
- $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
- }
-
- // No Categories In Entry
-
- public function testGetsCategoriesFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/rss20.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/rss090.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/rss091.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/rss092.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/rss093.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/rss094.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- public function testGetsCategoriesFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/category/plain/none/rss10.xml')
- );
- $this->assertEquals(array(), (array) $feed->getCategories());
- $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
- }
-
- /**
- * Get Image data (Unencoded Text)
- */
- public function testGetsImageFromRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/rss20.xml')
- );
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/image.gif',
- 'link' => 'http://www.example.com',
- 'title' => 'Image title',
- 'height' => '55',
- 'width' => '50',
- 'description' => 'Image description'
- ), $feed->getImage());
- }
-
- public function testGetsImageFromRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/rss094.xml')
- );
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/image.gif',
- 'link' => 'http://www.example.com',
- 'title' => 'Image title',
- 'height' => '55',
- 'width' => '50',
- 'description' => 'Image description'
- ), $feed->getImage());
- }
-
- public function testGetsImageFromRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/rss093.xml')
- );
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/image.gif',
- 'link' => 'http://www.example.com',
- 'title' => 'Image title',
- 'height' => '55',
- 'width' => '50',
- 'description' => 'Image description'
- ), $feed->getImage());
- }
-
- public function testGetsImageFromRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/rss092.xml')
- );
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/image.gif',
- 'link' => 'http://www.example.com',
- 'title' => 'Image title',
- 'height' => '55',
- 'width' => '50',
- 'description' => 'Image description'
- ), $feed->getImage());
- }
-
- public function testGetsImageFromRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/rss091.xml')
- );
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/image.gif',
- 'link' => 'http://www.example.com',
- 'title' => 'Image title',
- 'height' => '55',
- 'width' => '50',
- 'description' => 'Image description'
- ), $feed->getImage());
- }
-
- /*public function testGetsImageFromRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/rss10.xml')
- );
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/image.gif',
- 'link' => 'http://www.example.com',
- 'title' => 'Image title',
- 'height' => '55',
- 'width' => '50',
- 'description' => 'Image description'
- ), $feed->getImage());
- }
-
- public function testGetsImageFromRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/rss090.xml')
- );
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/image.gif',
- 'link' => 'http://www.example.com',
- 'title' => 'Image title',
- 'height' => '55',
- 'width' => '50',
- 'description' => 'Image description'
- ), $feed->getImage());
- }*/
-
- /**
- * Get Image data (Unencoded Text) Missing
- */
- public function testGetsImageFromRss20_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/rss20.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- public function testGetsImageFromRss094_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/rss094.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- public function testGetsImageFromRss093_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/rss093.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- public function testGetsImageFromRss092_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/rss092.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- public function testGetsImageFromRss091_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/rss091.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- public function testGetsImageFromRss10_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/rss10.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
- public function testGetsImageFromRss090_None()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/image/plain/none/rss090.xml')
- );
- $this->assertEquals(null, $feed->getImage());
- }
-
-}
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/author/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/author/plain/atom03.xml
deleted file mode 100644
index b048f9da78..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/author/plain/atom03.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
- Joe Bloggs
- http://www.example.com
- joe@example.com
-
-
- Joe Bloggs
- http://www.example.com
-
-
-
- Joe Bloggs
-
-
-
-
-
- http://www.example.com
- joe@example.com
-
-
-
- http://www.example.com
-
-
-
-
-
- joe@example.com
-
-
-
-
-
-
-
- Jane Bloggs
- http://www.example.com
- jane@example.com
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/author/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/author/plain/atom10.xml
deleted file mode 100644
index 9032ac952d..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/author/plain/atom10.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
- Joe Bloggs
- http://www.example.com
- joe@example.com
-
-
- Joe Bloggs
- http://www.example.com
-
-
-
- Joe Bloggs
-
-
-
-
-
- http://www.example.com
- joe@example.com
-
-
-
- http://www.example.com
-
-
-
-
-
- joe@example.com
-
-
-
-
-
-
-
- Jane Bloggs
- http://www.example.com
- jane@example.com
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/atom03.xml
deleted file mode 100644
index 510b42f811..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/atom03.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/atom10.xml
deleted file mode 100644
index 5229fde232..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/dc10/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/dc10/atom03.xml
deleted file mode 100644
index 02c8c7a317..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/dc10/atom03.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/dc11/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/dc11/atom03.xml
deleted file mode 100644
index 8832d68810..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/dc11/atom03.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/none/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/none/atom03.xml
deleted file mode 100644
index 8d52ee994f..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/none/atom03.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/none/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/none/atom10.xml
deleted file mode 100644
index 08dab19ca3..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/category/plain/none/atom10.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/copyright/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/copyright/plain/atom03.xml
deleted file mode 100644
index f38134dae2..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/copyright/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- Copyright 2008
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/copyright/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/copyright/plain/atom10.xml
deleted file mode 100644
index c4fa4bf74d..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/copyright/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- Copyright 2008
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/datecreated/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/datecreated/plain/atom03.xml
deleted file mode 100644
index a1121f4bd9..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/datecreated/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 2009-03-07T08:03:50Z
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/datecreated/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/datecreated/plain/atom10.xml
deleted file mode 100644
index 9689fdafe4..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/datecreated/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 2009-03-07T08:03:50Z
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/datemodified/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/datemodified/plain/atom03.xml
deleted file mode 100644
index 1a5ee9d2e4..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/datemodified/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 2009-03-07T08:03:50Z
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/datemodified/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/datemodified/plain/atom10.xml
deleted file mode 100644
index e40fbcde65..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/datemodified/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 2009-03-07T08:03:50Z
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/description/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/description/plain/atom03.xml
deleted file mode 100644
index 90148a0a3b..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/description/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- My Description
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/description/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/description/plain/atom10.xml
deleted file mode 100644
index 150153d194..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/description/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- My Description
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom03.xml
deleted file mode 100644
index 18cdf25433..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10-relative.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10-relative.xml
deleted file mode 100644
index 07fda0fe49..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10-relative.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10.xml
deleted file mode 100644
index cd40d7fb89..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10_NoFeedLink.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10_NoFeedLink.xml
deleted file mode 100644
index 2d884af205..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/feedlink/plain/atom10_NoFeedLink.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/generator/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/generator/plain/atom03.xml
deleted file mode 100644
index 4ad408de01..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/generator/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- Zend_Feed
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/generator/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/generator/plain/atom10.xml
deleted file mode 100644
index 5baa497697..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/generator/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- Zend_Feed
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/hubs/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/hubs/plain/atom03.xml
deleted file mode 100644
index d1734bbce6..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/hubs/plain/atom03.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/hubs/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/hubs/plain/atom10.xml
deleted file mode 100644
index ac8cfb2c0c..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/hubs/plain/atom10.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/atom03.xml
deleted file mode 100644
index c4f3a570dd..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- http://www.example.com/logo.gif
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/atom10.xml
deleted file mode 100644
index 70f9139c42..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- http://www.example.com/logo.gif
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/none/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/none/atom03.xml
deleted file mode 100644
index 57c63ee924..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/none/atom03.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/none/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/none/atom10.xml
deleted file mode 100644
index 2d884af205..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/icon/plain/none/atom10.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/id/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/id/plain/atom03.xml
deleted file mode 100644
index 52a5eefd6b..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/id/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 123
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/id/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/id/plain/atom10.xml
deleted file mode 100644
index 0d01f35618..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/id/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 123
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/atom03.xml
deleted file mode 100644
index b4b808c9af..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- http://www.example.com/logo.gif
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/atom10.xml
deleted file mode 100644
index 7d6744888b..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- http://www.example.com/logo.gif
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/none/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/none/atom03.xml
deleted file mode 100644
index 57c63ee924..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/none/atom03.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/none/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/none/atom10.xml
deleted file mode 100644
index 2d884af205..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/image/plain/none/atom10.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/language/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/language/plain/atom03.xml
deleted file mode 100644
index 236873b4ee..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/language/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- en-GB
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/language/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/language/plain/atom10.xml
deleted file mode 100644
index 8992d2e33b..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/language/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- en-GB
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom03.xml
deleted file mode 100644
index 8f0b1c9dff..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10-norel.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10-norel.xml
deleted file mode 100644
index 9bbe0fd65d..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10-norel.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10-relative.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10-relative.xml
deleted file mode 100644
index d75768f021..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10-relative.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10.xml
deleted file mode 100644
index 1903f1fe9b..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/link/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/title/plain/atom03.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/title/plain/atom03.xml
deleted file mode 100644
index b4e1d6f4fe..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/title/plain/atom03.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- My Title
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Atom/title/plain/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/Atom/title/plain/atom10.xml
deleted file mode 100644
index c132bd258d..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Atom/title/plain/atom10.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- My Title
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/author/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/author/atom10.xml
deleted file mode 100644
index d5463b66fd..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/author/atom10.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/category/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/category/atom10.xml
deleted file mode 100644
index a7bec9d58d..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/category/atom10.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/copyright/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/copyright/atom10.xml
deleted file mode 100644
index 87132cdedf..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/copyright/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/datecreated/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/datecreated/atom10.xml
deleted file mode 100644
index 6621d3101c..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/datecreated/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/datemodified/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/datemodified/atom10.xml
deleted file mode 100644
index 78eb767027..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/datemodified/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/description/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/description/atom10.xml
deleted file mode 100644
index 58616a621f..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/description/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/feedlink/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/feedlink/atom10.xml
deleted file mode 100644
index 6b09c8d141..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/feedlink/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/generator/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/generator/atom10.xml
deleted file mode 100644
index 915b5f7534..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/generator/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/hubs/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/hubs/atom10.xml
deleted file mode 100644
index 1062759729..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/hubs/atom10.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/id/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/id/atom10.xml
deleted file mode 100644
index 24348e4c4a..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/id/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/language/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/language/atom10.xml
deleted file mode 100644
index 330fc3ed5d..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/language/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/link/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/link/atom10.xml
deleted file mode 100644
index cc34600a51..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/link/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/title/atom10.xml b/tests/Zend/Feed/Reader/Feed/_files/AtomSource/title/atom10.xml
deleted file mode 100644
index 9ef8cf3486..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/AtomSource/title/atom10.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Common/atom.xml b/tests/Zend/Feed/Reader/Feed/_files/Common/atom.xml
deleted file mode 100644
index 1f2c99e6e6..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Common/atom.xml
+++ /dev/null
@@ -1,726 +0,0 @@
-
- Norm 2782
- Why are you here?
-
- 2009-03-07T08:03:50Z
- WordPress
-
-
- http://www.norm2782.com/feed/atom/
-
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=114
- 2009-03-07T08:03:50Z
- 2009-03-02T08:09:33Z
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=105
- 2009-02-18T03:30:07Z
- 2009-02-15T03:29:21Z
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=94
- 2009-01-14T10:47:25Z
- 2009-01-14T10:47:25Z
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=72
- 2009-01-14T08:23:19Z
- 2009-01-13T12:57:53Z
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=68
- 2009-01-11T09:53:20Z
- 2009-01-07T11:48:31Z
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=53
- 2009-01-03T18:51:43Z
- 2009-01-03T15:49:19Z
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=44
- 2009-01-03T11:47:19Z
- 2009-01-03T10:14:38Z
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=27
- 2009-01-06T15:00:54Z
- 2009-01-02T14:49:42Z
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=22
- 2009-01-02T09:27:20Z
- 2009-01-01T23:29:35Z
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=8
- 2009-01-02T15:13:15Z
- 2009-01-01T23:02:54Z
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-
-]]>
-
-
- 0
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Common/atom_noencodingdefined.xml b/tests/Zend/Feed/Reader/Feed/_files/Common/atom_noencodingdefined.xml
deleted file mode 100644
index 3e31cbaffb..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Common/atom_noencodingdefined.xml
+++ /dev/null
@@ -1,726 +0,0 @@
-
- Norm 2782
- Why are you here?
-
- 2009-03-07T08:03:50Z
- WordPress
-
-
- http://www.norm2782.com/feed/atom/
-
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=114
- 2009-03-07T08:03:50Z
- 2009-03-02T08:09:33Z
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=105
- 2009-02-18T03:30:07Z
- 2009-02-15T03:29:21Z
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=94
- 2009-01-14T10:47:25Z
- 2009-01-14T10:47:25Z
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=72
- 2009-01-14T08:23:19Z
- 2009-01-13T12:57:53Z
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=68
- 2009-01-11T09:53:20Z
- 2009-01-07T11:48:31Z
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=53
- 2009-01-03T18:51:43Z
- 2009-01-03T15:49:19Z
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=44
- 2009-01-03T11:47:19Z
- 2009-01-03T10:14:38Z
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=27
- 2009-01-06T15:00:54Z
- 2009-01-02T14:49:42Z
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=22
- 2009-01-02T09:27:20Z
- 2009-01-01T23:29:35Z
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=8
- 2009-01-02T15:13:15Z
- 2009-01-01T23:02:54Z
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-
-]]>
-
-
- 0
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Common/atom_rewrittenbydom.xml b/tests/Zend/Feed/Reader/Feed/_files/Common/atom_rewrittenbydom.xml
deleted file mode 100644
index fd9da5f015..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Common/atom_rewrittenbydom.xml
+++ /dev/null
@@ -1,722 +0,0 @@
-
-
- Norm 2782
- Why are you here?
-
- 2009-03-07T08:03:50Z
- WordPress
-
-
- http://www.norm2782.com/feed/atom/
-
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=114
- 2009-03-07T08:03:50Z
- 2009-03-02T08:09:33Z
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=105
- 2009-02-18T03:30:07Z
- 2009-02-15T03:29:21Z
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=94
- 2009-01-14T10:47:25Z
- 2009-01-14T10:47:25Z
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=72
- 2009-01-14T08:23:19Z
- 2009-01-13T12:57:53Z
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=68
- 2009-01-11T09:53:20Z
- 2009-01-07T11:48:31Z
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=53
- 2009-01-03T18:51:43Z
- 2009-01-03T15:49:19Z
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=44
- 2009-01-03T11:47:19Z
- 2009-01-03T10:14:38Z
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=27
- 2009-01-06T15:00:54Z
- 2009-01-02T14:49:42Z
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=22
- 2009-01-02T09:27:20Z
- 2009-01-01T23:29:35Z
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=8
- 2009-01-02T15:13:15Z
- 2009-01-01T23:02:54Z
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-
-]]>
-
-
- 0
-
-
diff --git a/tests/Zend/Feed/Reader/Feed/_files/Common/rss.xml b/tests/Zend/Feed/Reader/Feed/_files/Common/rss.xml
deleted file mode 100644
index 3d1fdfae24..0000000000
--- a/tests/Zend/Feed/Reader/Feed/_files/Common/rss.xml
+++ /dev/null
@@ -1,700 +0,0 @@
-
-
-
-
- Norm 2782
-
- http://www.norm2782.com
- Why are you here?
- Sat, 07 Mar 2009 08:03:50 +0000
- http://wordpress.org/?v=2.8
- en
- hourly
- 1
-
- Wth… reading books?
- http://www.norm2782.com/2009/03/wth-reading-books/
- http://www.norm2782.com/2009/03/wth-reading-books/#comments
- Mon, 02 Mar 2009 08:09:33 +0000
- norm2782
-
-
-
-
-
- http://www.norm2782.com/?p=114
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-]]>
- http://www.norm2782.com/2009/03/wth-reading-books/feed/
- 0
-
-
- My first few weeks in New Zealand
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/#comments
- Sun, 15 Feb 2009 03:29:21 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=105
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/feed/
- 0
-
-
- Properties in PHP – revisited
- http://www.norm2782.com/2009/01/properties-in-php-revisited/
- http://www.norm2782.com/2009/01/properties-in-php-revisited/#comments
- Wed, 14 Jan 2009 10:47:25 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=94
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
- http://www.norm2782.com/2009/01/properties-in-php-revisited/feed/
- 0
-
-
- Filters for Zend_Paginator
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/#comments
- Tue, 13 Jan 2009 12:57:53 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=72
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/feed/
- 0
-
-
- ZF-3239
- http://www.norm2782.com/2009/01/zf-3239/
- http://www.norm2782.com/2009/01/zf-3239/#comments
- Wed, 07 Jan 2009 11:48:31 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=68
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
- http://www.norm2782.com/2009/01/zf-3239/feed/
- 0
-
-
- New in-ear earphones
- http://www.norm2782.com/2009/01/new-in-ear-earphones/
- http://www.norm2782.com/2009/01/new-in-ear-earphones/#comments
- Sat, 03 Jan 2009 15:49:19 +0000
- norm2782
-
-
- http://www.norm2782.com/?p=53
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-]]>
- http://www.norm2782.com/2009/01/new-in-ear-earphones/feed/
- 0
-
-
- Seven Things – Tagged by Pádraic
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/#comments
- Sat, 03 Jan 2009 10:14:38 +0000
- norm2782
-
-
- http://www.norm2782.com/?p=44
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-]]>
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/feed/
- 0
-
-
- AMF Server class for WordPress
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/#comments
- Fri, 02 Jan 2009 14:49:42 +0000
- norm2782
-
-
-
-
- http://www.norm2782.com/?p=27
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-]]>
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/feed/
- 0
-
-
- Flex frontend
- http://www.norm2782.com/2009/01/flex-frontend/
- http://www.norm2782.com/2009/01/flex-frontend/#comments
- Thu, 01 Jan 2009 23:29:35 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=22
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
- http://www.norm2782.com/2009/01/flex-frontend/feed/
- 0
-
-
- Properties in PHP
- http://www.norm2782.com/2009/01/properties-in-php/
- http://www.norm2782.com/2009/01/properties-in-php/#comments
- Thu, 01 Jan 2009 23:02:54 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=8
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
', str_replace("\n",'',$entry->getContent()));
- }
-
- public function testGetsEntryLinks()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals(array('http://www.norm2782.com/2009/03/wth-reading-books/'), $entry->getLinks());
- }
-
- public function testGetsEntryLink()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.norm2782.com/2009/03/wth-reading-books/', $entry->getLink());
- }
-
- public function testGetsEntryPermaLink()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.norm2782.com/2009/03/wth-reading-books/',
- $entry->getPermaLink());
- }
-
- public function testGetsEntryEncoding()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals('UTF-8', $entry->getEncoding());
- }
-
-}
diff --git a/tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php b/tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php
deleted file mode 100644
index fbf85a3a01..0000000000
--- a/tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php
+++ /dev/null
@@ -1,225 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/_files/wordpress-rss2-dc-atom.xml';
- }
-
- /**
- * Feed level testing
- */
-
- public function testGetsTitle()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals('Norm 2782', $feed->getTitle());
- }
-
- public function testGetsAuthors()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals(array(
- array('name'=>'norm2782')
- ), (array) $feed->getAuthors());
- }
-
- public function testGetsSingleAuthor()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals(array('name'=>'norm2782'), $feed->getAuthor());
- }
-
- public function testGetsCopyright()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals(null, $feed->getCopyright());
- }
-
- public function testGetsDescription()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals('Why are you here?', $feed->getDescription());
- }
-
- public function testGetsLanguage()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals('en', $feed->getLanguage());
- }
-
- public function testGetsLink()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals('http://www.norm2782.com', $feed->getLink());
- }
-
- public function testGetsEncoding()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals('UTF-8', $feed->getEncoding());
- }
-
- public function testGetsEntryCount()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $this->assertEquals(10, $feed->count());
- }
-
- /**
- * Entry level testing
- */
-
- public function testGetsEntryId()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.norm2782.com/?p=114', $entry->getId());
- }
-
- public function testGetsEntryTitle()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- /**
- * Note: The three dots below is actually a single Unicode character
- * called the "three dot leader". Don't replace in error!
- */
- $this->assertEquals('Wth… reading books?', $entry->getTitle());
- }
-
- public function testGetsEntryAuthors()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals(array(array('name'=>'norm2782')), (array) $entry->getAuthors());
- }
-
- public function testGetsEntrySingleAuthor()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'norm2782'), $entry->getAuthor());
- }
-
- public function testGetsEntryDescription()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- /**
- * Note: "’" is not the same as "'" - don't replace in error
- */
- $this->assertEquals('Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.'."\n\n".'Agile Software Development with Scrum, by Ken Schwaber and Mike Beedle'."\n".'Domain-Driven Design: Tackling Complexity in the [...]', $entry->getDescription());
- }
-
- public function testGetsEntryContent()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath)
- );
- $entry = $feed->current();
- $this->assertEquals('
Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=105
- 2009-02-18T03:30:07Z
- 2009-02-15T03:29:21Z
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=94
- 2009-01-14T10:47:25Z
- 2009-01-14T10:47:25Z
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=72
- 2009-01-14T08:23:19Z
- 2009-01-13T12:57:53Z
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=68
- 2009-01-11T09:53:20Z
- 2009-01-07T11:48:31Z
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=53
- 2009-01-03T18:51:43Z
- 2009-01-03T15:49:19Z
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=44
- 2009-01-03T11:47:19Z
- 2009-01-03T10:14:38Z
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=27
- 2009-01-06T15:00:54Z
- 2009-01-02T14:49:42Z
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=22
- 2009-01-02T09:27:20Z
- 2009-01-01T23:29:35Z
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
-
-
- 0
-
-
-
- norm2782
- http://www.norm2782.com
-
-
-
- http://www.norm2782.com/?p=8
- 2009-01-02T15:13:15Z
- 2009-01-01T23:02:54Z
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-
-]]>
-
-
- 0
-
-
diff --git a/tests/Zend/Feed/Reader/Integration/_files/wordpress-rss2-dc-atom.xml b/tests/Zend/Feed/Reader/Integration/_files/wordpress-rss2-dc-atom.xml
deleted file mode 100644
index 3d1fdfae24..0000000000
--- a/tests/Zend/Feed/Reader/Integration/_files/wordpress-rss2-dc-atom.xml
+++ /dev/null
@@ -1,700 +0,0 @@
-
-
-
-
- Norm 2782
-
- http://www.norm2782.com
- Why are you here?
- Sat, 07 Mar 2009 08:03:50 +0000
- http://wordpress.org/?v=2.8
- en
- hourly
- 1
-
- Wth… reading books?
- http://www.norm2782.com/2009/03/wth-reading-books/
- http://www.norm2782.com/2009/03/wth-reading-books/#comments
- Mon, 02 Mar 2009 08:09:33 +0000
- norm2782
-
-
-
-
-
- http://www.norm2782.com/?p=114
-
- Being in New Zealand does strange things to a person. Everybody who knows me, knows I don’t much like that crazy invention called a Book. However, being here I’ve already finished 4 books, all of which I can highly recommend.
-
-]]>
- http://www.norm2782.com/2009/03/wth-reading-books/feed/
- 0
-
-
- My first few weeks in New Zealand
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/#comments
- Sun, 15 Feb 2009 03:29:21 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=105
-
- It’s been a while since my last blog post. Things have been quite hectic for me these last few weeks. There was my final week at Angry Bytes, followed by a pre-NZ party and then my trip to New Zealand. Currently New Zealand looks pretty much the same as the Netherlands, seeing as I’m locked away in an office most of my time.
-
-My adventure into Kiwi-land started with a long and interesting trip to San Francisco. The interesting part was my new book: Domain Driven Design: Tackling Complexity in the Heart of Software, by Eric Evans. This book, combined with KLM’s excellent on-board service made my flight to SF a breeze.
-
It was only 2PM when I arrived in SF, so I had to wait another 4 hours before my flight to Auckland even boarded. The waiting wasn’t too bad. It was great to get out into the sun and to grab some decent food and coffee. Didn’t get to see much of SF though, which was too bad.
-
-
The flight to Auckland wasn’t that flawless unfortunately. There were some technical problems with the airplane, which caused quite a bit of a delay. Because of this delay I had to run to catch my flight to Dunedin. The flight was all set to go and was waiting for me… I barely made it in time!
-
-
When I got to Dunedin I was welcomed by Jesse, Tracey and Lindsay. It was great to meet them in person. The first order of business for me was to get some coffee, because I only got roughly 3 hours of sleep on my way there. After a little tour of Abbey College (that’s where I’m staying) it was time for our first meeting. No time for sleep! Finally, after dinner at Abbey, I decided it was time to get some sleep. When I woke up the next day, the jet-lag was no more!
-
-
Abbey is a great place to stay by the way. It’s not far from the office or from the city center. The people who are staying there are great as well. Just check out the site. Abbey’s got it all!
-
-
So what am I doing here in NZ? We’re currently working on writing the software for the PBRF initiative. It has already taken a lot of late hours, and it will probably take a lot more. It will be worth it though! After that, we’ll be working on a great and exciting cutting-edge open-source project. Unfortunately I can’t say a lot more at this point, but you can rest assured that it includes the latest Zend Framework technologies.
-
-
Seeing as I don’t have internet-access at Abbey College yet, I’ve got lots of time for other activities. I’ve finished reading the better part of my Domain Driven Design book and I’ve ordered Martin Fowler’s Patterns Of Enterprise Application Architecture, which should arrive this week. I’ve also bought myself a brand new bicycle so I can get around. Cycling here is a bit more dangerous than in the Netherlands though… it definitely brings back memories from my bicycling trip in Scotland! There are lots more things on my todo list: winery tour, surfing, snowboarding, skydiving, bungee-jumping, renting/buying a Harley… six months in NZ is not going to be enough time!
-
-
Well, that’s my first NZ blog-post. There will definitely be more of these! Let’s hope they fix my internet soon… See my Flickr photo-stream for more pictures.
-]]>
- http://www.norm2782.com/2009/02/my-first-few-weeks-in-new-zealand/feed/
- 0
-
-
- Properties in PHP – revisited
- http://www.norm2782.com/2009/01/properties-in-php-revisited/
- http://www.norm2782.com/2009/01/properties-in-php-revisited/#comments
- Wed, 14 Jan 2009 10:47:25 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=94
-
- A while ago I was daydreaming about native property support in PHP. Unfortunately it will be a while before PHP itself will support this natively and an even longer while before shared hosting providers will upgrade to a newer version of PHP.
-
So what’s the big deal about those properties? In short, they make a developers life easier by allowing the developer to code no more than needed at that moment. And lets face it… less code is better! In this post we’ll see that it’s not impossible to enjoy properties in PHP today. As with a lot of good things, it does come with a small price though…
-
-Lets have a look at a use-case to demonstrate where properties will not only save you time, but it will also save your sanity. In this example we’re modeling a Person class. In the beginning of the project, the requirements for the Person class are quite simple: a Person has an age and a name. In the simplest form we can code that as follows:
-
-<?php
-class Person
-{
- public $age;
-
- public $name;
-}
-
-
This look easy enough, and it is. It even works like a charm and it’s possibly the fastest implementation for the Person class.
-
But, pesky as they are, the client suddenly wants some logic added to our Person class! A Person suddenly can’t be younger than 21 years old. This poses a problem. To add logic to our Person class, we would have to switch the public age attribute with a pair of getters and setters:
-
-<?php
-class Person
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-
Technically this works like a charm, however it will force me to go through my entire application and switch all references from the public attribute to the getter and setter. Not an ideal situation. One possible solution is to do things the Java way: just create all getters and setters up-front so you don’t have to do so afterwards. Even though this works fine, it’s in violation of our mission to write no more code than we actually need at the moment of writing.
-
The solution? Properties! But wait… PHP doesn’t support those, remember? Luckily we still have magic methods. It’s nowhere near as nice as a native solution, but at least it helps us write no more code than we need at the moment we’re first writing our code:
-
-<?php
-abstract class ModelAbstract
-{
- public function __get($key)
- {
- $method = 'get' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- return $this->$method();
- }
-
- public function __set($key, $value)
- {
- $method = 'set' . ucfirst($key);
-
- if (!method_exists($this, $method)) {
- throw new Exception('No property found for ' . $key);
- }
-
- $this->$method($value);
- }
-}
-
-
We’ll take a look at what this does exactly later. The important thing to note is that we can now do the following:
-
-<?php
-class Person extends ModelAbstract
-{
- private $_age = null;
-
- public $name = null;
-
- public function getAge()
- {
- return $this->_age;
- }
-
- public function setAge($age)
- {
- if ($age < 21) {
- throw new Exception('You need to be at least 21 years or older!');
- }
-
- $this->_age = $age;
- }
-}
-
-$person = new Person();
-
-try {
- $person->age = 10;
-} catch (Exception $e) {
- // Will print "You need to be at least 21 years or older!"
- echo $e->getMessage();
-}
-
-
With this construction in place, we can safely switch from a public attribute to getters and setters, without changing the rest of the application code. The only real downside to this – aside from the minor speed impact – is the fact that you have to subclass ModelAbstract to make this work. Luckily it’s not a lot of code, so should there be a big need to get rid of the ModelAbstract inheritance it’s not a big disaster to do some copy/paste work.
-
This method works by assuming you have get- and set methods that have the same name as the property you’re trying to access. When there’s a public attribute, it will use that. If there’s no public attribute, it will fall back to __get or __set and the logic will take it from there.
-
All of this is just a proof-of-concept of implementing properties in PHP and of the way I want to be using properties to access data the data in my objects. Please comment your experiences with this approach or similar approaches. I’m curious to see how practical this solution would be in a real-life situation.
-]]>
- http://www.norm2782.com/2009/01/properties-in-php-revisited/feed/
- 0
-
-
- Filters for Zend_Paginator
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/#comments
- Tue, 13 Jan 2009 12:57:53 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=72
-
- Zend_Paginator has a new feature! It is now possible to add a filter to your Paginator object which acts on the data retrieved from the adapter. This filter can be any instance of Zend_Filter_Interface, including a filter-chain. If a filter(-chain) is set, the raw data from the adapter will be passed to the filter() method.
-
-So why would you want to apply filters to your result set? Usually my domain models don’t inherit from Zend_Db_Table_Row but that is the data type I get from the Paginator when I use the DbTableSelect adapter (wrapped in a nice Zend_Db_Table_Rowset). Instead, I would like to load my rows into my models and preferably without using the Paginator abilities or having to apply weird hacks. Previously this was only possible (in a sane way) by subclassing an adapter so it could return a collection of model objects instead of a rowset. With the new filter support you can just inject a filter to do this for you.
-
Lets have a look at an example. In this example I want to list all my users from the database. I’ll grab the name of the user from the row and inject it into a User object.
To simplify adding a simple filter to your paginator I’ve also added Zend_Filter_Callback. This allows you to specify a callback method that does the same as the filter in the previous example.
The callback also accepts object instead of a static reference to a class. Internally it uses call_user_func to execute the filter() method, so any notation that works there, works with the Callback filter.
-
Enjoy!
-]]>
- http://www.norm2782.com/2009/01/filters-for-zend_paginator/feed/
- 0
-
-
- ZF-3239
- http://www.norm2782.com/2009/01/zf-3239/
- http://www.norm2782.com/2009/01/zf-3239/#comments
- Wed, 07 Jan 2009 11:48:31 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=68
-
- Zend_Db_Table_Select users, rejoice! I’ve just committed a patch for ZF-3239 in revision 13530. This should be a relief for those of you who have been implementing workarounds for those “No table has been specified for the FROM clause” exceptions.
-]]>
- http://www.norm2782.com/2009/01/zf-3239/feed/
- 0
-
-
- New in-ear earphones
- http://www.norm2782.com/2009/01/new-in-ear-earphones/
- http://www.norm2782.com/2009/01/new-in-ear-earphones/#comments
- Sat, 03 Jan 2009 15:49:19 +0000
- norm2782
-
-
- http://www.norm2782.com/?p=53
-
- Just got myself the Sennheiser CX 300 II Precision in-ear earphones. Check ‘em out by clicking the read more link!
-
-
-]]>
- http://www.norm2782.com/2009/01/new-in-ear-earphones/feed/
- 0
-
-
- Seven Things – Tagged by Pádraic
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/#comments
- Sat, 03 Jan 2009 10:14:38 +0000
- norm2782
-
-
- http://www.norm2782.com/?p=44
-
- Well, this was bound to happen: I got tagged by Pádraic because I’m working on Zend_Feed_Reader with him. Luckily I’ve just setup this new blog, so here we go!
-
Did you know that…
-
-
Every bit of PHP I know is self-taught
-
My programming adventure started out with Visual Basic 3 back in 1993. I was just 8 years old back then and had no clue what I was doing.
-
My left foot is actually a few millimeter bigger than my right foot.
-
I used to have long hair (almost reached my ass). I cut it off in the summer of ‘08 for various reasons, one of which was 100 euro.
-
I bought my Harley Davidson before I even had my drivers license.
-
My whisky collection (only single malts ) keeps growing instead of shrinking
-
While I use a Mac, with an Apple Cinema Display and an Apple keyboard… I have an HTC Touch with Windows Mobile and I’m stuck with it for at least a few more months.
-
-
Now it’s my turn to start tagging!
-
-
Stefan Koopmanschap – For not being tagged yet and having said so on Twitter
-
Maurice Fonk – For being my co-worker and for not having finished Madoqua yet
Link your original tagger(s), and list these rules on your blog.
-
Share seven facts about yourself in the post – some random, some wierd.
-
Tag seven people at the end of your post by leaving their names and the links to their blogs.
-
Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
-
-]]>
- http://www.norm2782.com/2009/01/seven-things-tagged-by-padraic/feed/
- 0
-
-
- AMF Server class for WordPress
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/#comments
- Fri, 02 Jan 2009 14:49:42 +0000
- norm2782
-
-
-
-
- http://www.norm2782.com/?p=27
-
- After browsing through WordPress’ code I quickly found that there’s no sane way to create AMF support as a WP plugin. At least not for someone who hasn’t done any old-skool procedural PHP in years. Instead of writing a plugin, I decided to write a standalone server script. It’s still very basic and currently setup to work for me. To get it working for your WP setup you should probably make some minor modifications. Click the read more link to check out the code. I’ve released it under the generous BSD license, so knock yourself out! Use it at your own risk… I’m not going to support it. Any updates will be posted in this post. Also, please note that I haven’t tested it yet. If you access the script directly it should output “Zend Amf Endpoint” just fine, but that’s all I can guarantee at this point
-
-
-<?php
-/**
- * BSD LICENSE
- *
- * Copyright (c) 2009, norm2782
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of norm2782 nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY norm2782 ''AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL norm2782 BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Set production mode.
- * If set to false, exceptions will bubble through to the Flex frontend
- *
- * @var bool
- */
-$production = false;
-
-/**
- * Determine the absolute path of the AMF server
- *
- * @var string
- */
-define('ABSPATH', dirname(__FILE__) . '/');
-
-/**
- * One directory below docroot. Your config file and library dir should be here.
- *
- * @var string
- */
-define('SUBPATH', dirname(ABSPATH));
-
-/**
- * You should make sure Zend Framework is in your include path
- */
-set_include_path(
- implode(PATH_SEPARATOR, array(
- SUBPATH . '/library',
- get_include_path()
- ))
-);
-
-/**
- * Include the WordPress config file
- */
-$configFile = SUBPATH . '/wp-config.php';
-
-if (!file_exists($configFile)) {
- throw new Exception('WordPress config file was not found!');
-}
-
-require_once $configFile;
-
-/**
- * No need to config more stuff from this point on
- */
-
-/**
- * @see Zend_Amf_Server
- */
-require_once 'Zend/Amf/Server.php';
-
-/**
- * @see Zend_Db_Adapter_Pdo_Mysql
- */
-require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
-
-/**
- * @see Zend_Paginator
- */
-require_once 'Zend/Paginator.php';
-
-/**
- * @see Zend_Paginator_Adapter_DbSelect
- */
-require_once 'Zend/Paginator/Adapter/DbSelect.php';
-
-/**
- * Simple class to expose wordpress data through AMF
- *
- * @author norm2782
- */
-class Wp_Amf_Gateway
-{
- /**
- * Database adapter
- *
- * @var Zend_Db_Adapter_Pdo_Mysql
- */
- private $_db = null;
-
- /**
- * WordPress table prefix
- *
- * @var string
- */
- private $_prefix = null;
-
- /**
- * Constructor
- *
- * @param array $dbConfig
- * @param string $prefix
- * @return void
- */
- public function __construct(array $dbConfig, $prefix)
- {
- $this->_db = new Zend_Db_Adapter_Pdo_Mysql($dbConfig);
- $this->_db->query('SET NAMES `utf8`');
-
- $this->_prefix = $prefix;
- }
-
- /**
- * Get paginated results for the provided query
- *
- * @param Zend_Db_Select $select
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- private function _getPaginated(Zend_Db_Select $select, $page, $itemsPerPage)
- {
- $paginator = new Zend_Paginator(
- new Zend_Paginator_Adapter_DbSelect($select)
- );
-
- $paginator->setCurrentPageNumber($page)
- ->setItemCountPerPage($itemsPerPage);
-
- return array(
- 'info' => $paginator->getPages(),
- 'items' => $paginator->getCurrentItems()
- );
- }
-
- /**
- * Get the comments for the specified post ID
- *
- * @param int $postId
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getCommentsForPost($postId, $page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'comments')
- ->where('comment_post_ID = ?', $postId);
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-
- /**
- * Get the meta data for the specified post ID
- *
- * @param $postId
- * @return unknown_type
- */
- public function getMetaForPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'postmeta')
- ->where('post_id = ?', $postId);
-
- return $this->_db->fetchAll($select);
- }
-
- /**
- * Get a post by specifying its ID
- *
- * @param int $postId
- * @return array
- */
- public function getPost($postId)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts')
- ->where('ID = ?', $postId);
-
- return $this->_db->fetchOne($select);
- }
-
- /**
- * Get posts per page
- *
- * @param int $page
- * @param int $itemsPerPage
- * @return array
- */
- public function getPosts($page = 1, $itemsPerPage = 10)
- {
- $select = $this->_db->select()->from($this->_prefix . 'posts');
-
- return $this->_getPaginated($select, $page, $itemsPerPage);
- }
-}
-
-/**
- * Pass the values from wp-config.php to the Wp_Amf_Gateway class.
- */
-$gateway = new Wp_Amf_Gateway(
- array(
- 'host' => DB_HOST,
- 'username' => DB_USER,
- 'password' => DB_PASSWORD,
- 'dbname' => DB_NAME
- ),
- $table_prefix
-);
-
-$server = new Zend_Amf_Server();
-$server->setProduction($production)
- ->setClass($gateway)
- ->handle();
-
-]]>
- http://www.norm2782.com/2009/01/amf-server-class-for-wordpress/feed/
- 0
-
-
- Flex frontend
- http://www.norm2782.com/2009/01/flex-frontend/
- http://www.norm2782.com/2009/01/flex-frontend/#comments
- Thu, 01 Jan 2009 23:29:35 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=22
-
- I was planning on writing a quick Flex frontend for this blog, but it appears WordPress only offers the posts themselves as RSS feed. If I get real bored (which I doubt, unfortunately) I’ll have a look and see if I can create a Zend_AMF plugin for WordPress that allows me to retrieve virtually all data from my WordPress install. Would be cool
-]]>
- http://www.norm2782.com/2009/01/flex-frontend/feed/
- 0
-
-
- Properties in PHP
- http://www.norm2782.com/2009/01/properties-in-php/
- http://www.norm2782.com/2009/01/properties-in-php/#comments
- Thu, 01 Jan 2009 23:02:54 +0000
- norm2782
-
-
-
- http://www.norm2782.com/?p=8
-
- A while ago Dynom from #php_bnl pointed me to an interesting entry on the PHP 5.3 wiki page. In the “Future PHP releases” sections there’s an entry called “29. “real†properties with attached getters and setters”. Personally I can’t wait for this. Hopefully it will look something like ActionScript 3’s properties:
-
-<?php
-class Bar
-{
- private $_foo = 'foo';
-
- public function get foo()
- {
- return $this->_foo;
- }
-
- public function set foo($fooString)
- {
- $this->_foo = $fooString;
- }
-}
-
-$bar = new Bar();
-$bar->foo = 'baz';
-echo $bar->foo; // prints baz
-
-]]>
- http://www.norm2782.com/2009/01/properties-in-php/feed/
- 0
-
-
-
diff --git a/tests/Zend/Feed/Reader/_files/My/Extension/JungleBooks/Entry.php b/tests/Zend/Feed/Reader/_files/My/Extension/JungleBooks/Entry.php
deleted file mode 100644
index 1239db13fb..0000000000
--- a/tests/Zend/Feed/Reader/_files/My/Extension/JungleBooks/Entry.php
+++ /dev/null
@@ -1,54 +0,0 @@
-_data['isbn'])) {
- return $this->_data['isbn'];
- }
- $isbn = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/jungle:isbn)');
- if (!$isbn) {
- $isbn = null;
- }
- $this->_data['isbn'] = $title;
- return $this->_data['isbn'];
- }
-
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('jungle', 'http://example.com/junglebooks/rss/module/1.0/');
- }
-}
diff --git a/tests/Zend/Feed/Reader/_files/My/Extension/JungleBooks/Feed.php b/tests/Zend/Feed/Reader/_files/My/Extension/JungleBooks/Feed.php
deleted file mode 100644
index 8d7706a87e..0000000000
--- a/tests/Zend/Feed/Reader/_files/My/Extension/JungleBooks/Feed.php
+++ /dev/null
@@ -1,52 +0,0 @@
-_data['dayPopular'])) {
- return $this->_data['dayPopular'];
- }
- $dayPopular = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/jungle:dayPopular)');
- if (!$dayPopular) {
- $dayPopular = null;
- }
- $this->_data['dayPopular'] = $dayPopular;
- return $this->_data['dayPopular'];
- }
-
- protected function _registerNamespaces()
- {
- $this->_xpath->registerNamespace('jungle', 'http://example.com/junglebooks/rss/module/1.0/');
- }
-}
diff --git a/tests/Zend/Feed/Reader/_files/Reader/atom03.xml b/tests/Zend/Feed/Reader/_files/Reader/atom03.xml
deleted file mode 100644
index 071f83a0af..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/atom03.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/atom10.xml b/tests/Zend/Feed/Reader/_files/Reader/atom10.xml
deleted file mode 100644
index 4b990551c4..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/atom10.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/rss090.xml b/tests/Zend/Feed/Reader/_files/Reader/rss090.xml
deleted file mode 100644
index 72b79748c9..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/rss090.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/rss091.xml b/tests/Zend/Feed/Reader/_files/Reader/rss091.xml
deleted file mode 100644
index 8f866b3837..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/rss091.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/rss092.xml b/tests/Zend/Feed/Reader/_files/Reader/rss092.xml
deleted file mode 100644
index d03fff2c7a..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/rss092.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/rss093.xml b/tests/Zend/Feed/Reader/_files/Reader/rss093.xml
deleted file mode 100644
index 8b784f6c4f..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/rss093.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/rss094.xml b/tests/Zend/Feed/Reader/_files/Reader/rss094.xml
deleted file mode 100644
index 02422130ca..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/rss094.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/rss10.xml b/tests/Zend/Feed/Reader/_files/Reader/rss10.xml
deleted file mode 100644
index 6f9c76f25a..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/rss10.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/rss20.xml b/tests/Zend/Feed/Reader/_files/Reader/rss20.xml
deleted file mode 100644
index c60501eaab..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/rss20.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Zend/Feed/Reader/_files/Reader/xxe-atom10.xml b/tests/Zend/Feed/Reader/_files/Reader/xxe-atom10.xml
deleted file mode 100644
index 6a4a47d567..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/xxe-atom10.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
- ]>
-
- info:&discloseInfo;
-
diff --git a/tests/Zend/Feed/Reader/_files/Reader/xxe-info.txt b/tests/Zend/Feed/Reader/_files/Reader/xxe-info.txt
deleted file mode 100644
index 603572bbbd..0000000000
--- a/tests/Zend/Feed/Reader/_files/Reader/xxe-info.txt
+++ /dev/null
@@ -1 +0,0 @@
-xxe-information-disclosed
diff --git a/tests/Zend/Feed/ReaderTest.php b/tests/Zend/Feed/ReaderTest.php
deleted file mode 100644
index c5916a5fd6..0000000000
--- a/tests/Zend/Feed/ReaderTest.php
+++ /dev/null
@@ -1,394 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/Reader/_files';
- }
-
- public function tearDown()
- {
- Zend_Feed_Reader::reset();
- }
-
- public function testDetectsFeedIsRss20()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/rss20.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_20, $type);
- }
-
- public function testDetectsFeedIsRss094()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/rss094.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_094, $type);
- }
-
- public function testDetectsFeedIsRss093()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/rss093.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_093, $type);
- }
-
- public function testDetectsFeedIsRss092()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/rss092.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_092, $type);
- }
-
- public function testDetectsFeedIsRss091()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/rss091.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_091, $type);
- }
-
- public function testDetectsFeedIsRss10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/rss10.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_10, $type);
- }
-
- public function testDetectsFeedIsRss090()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/rss090.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_090, $type);
- }
-
- public function testDetectsFeedIsAtom10()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/atom10.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_ATOM_10, $type);
- }
-
- public function testDetectsFeedIsAtom03()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents($this->_feedSamplePath.'/Reader/atom03.xml'));
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_ATOM_03, $type);
- }
-
- /**
- * @group ZF-9723
- */
- public function testDetectsTypeFromStringOrToRemindPaddyAboutForgettingATestWhichLetsAStupidTypoSurviveUnnoticedForMonths()
- {
- $feed = '';
- $type = Zend_Feed_Reader::detectType($feed);
- $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_10, $type);
- }
-
- public function testGetEncoding()
- {
- $feed = Zend_Feed_Reader::importString(
- file_get_contents(dirname(__FILE__) . '/Reader/Entry/_files/Atom/title/plain/atom10.xml')
- );
-
- $this->assertEquals('utf-8', $feed->getEncoding());
- $this->assertEquals('utf-8', $feed->current()->getEncoding());
- }
-
- public function testImportsFile()
- {
- try {
- $feed = Zend_Feed_Reader::importFile(
- dirname(__FILE__) . '/Reader/Entry/_files/Atom/title/plain/atom10.xml'
- );
- } catch(Exception $e) {
- $this->fail($e->getMessage());
- }
- }
-
- public function testImportsUri()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testImportsUri() requires a network connection');
- return;
- }
-
- try {
- $feed = Zend_Feed_Reader::import('http://www.planet-php.net/rdf/');
- } catch(Exception $e) {
- $this->fail($e->getMessage());
- }
- }
-
- /**
- * @group ZF-8328
- * @expectedException Zend_Feed_Exception
- */
- public function testImportsUriAndThrowsExceptionIfNotAFeed()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testImportsUri() requires a network connection');
- return;
- }
-
- $feed = Zend_Feed_Reader::import('http://twitter.com/alganet');
- }
-
- public function testGetsFeedLinksAsValueObject()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testGetsFeedLinksAsValueObject() requires a network connection');
- return;
- }
-
- try {
- $links = Zend_Feed_Reader::findFeedLinks('http://www.planet-php.net');
- } catch(Exception $e) {
- $this->fail($e->getMessage());
- }
- $this->assertEquals('http://www.planet-php.org/rss/', $links->rss);
- }
-
- public function testCompilesLinksAsArrayObject()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testGetsFeedLinksAsValueObject() requires a network connection');
- return;
- }
- $links = Zend_Feed_Reader::findFeedLinks('http://www.planet-php.net');
- $this->assertTrue($links instanceof Zend_Feed_Reader_FeedSet);
- $this->assertEquals(array(
- 'rel' => 'alternate', 'type' => 'application/rss+xml', 'href' => 'http://www.planet-php.org/rss/'
- ), (array) $links->getIterator()->current());
- }
-
- public function testFeedSetLoadsFeedObjectWhenFeedArrayKeyAccessed()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testGetsFeedLinksAsValueObject() requires a network connection');
- return;
- }
- $links = Zend_Feed_Reader::findFeedLinks('http://www.planet-php.net');
- $link = $links->getIterator()->current();
- $this->assertTrue($link['feed'] instanceof Zend_Feed_Reader_Feed_Rss);
- }
-
- public function testZeroCountFeedSetReturnedFromEmptyList()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testGetsFeedLinksAsValueObject() requires a network connection');
- return;
- }
- $links = Zend_Feed_Reader::findFeedLinks('http://www.example.com');
- $this->assertEquals(0, count($links));
- }
-
- /**
- * @group ZF-8327
- */
- public function testGetsFeedLinksAndTrimsNewlines()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testGetsFeedLinksAsValueObject() requires a network connection');
- return;
- }
-
- try {
- $links = Zend_Feed_Reader::findFeedLinks('http://www.infopod.com.br');
- } catch(Exception $e) {
- $this->fail($e->getMessage());
- }
- $this->assertEquals('http://feeds.feedburner.com/jonnyken/infoblog', $links->rss);
- }
-
- /**
- * @group ZF-8330
- */
- public function testGetsFeedLinksAndNormalisesRelativeUrls()
- {
- if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')
- ) {
- $this->markTestSkipped('testGetsFeedLinksAsValueObject() requires a network connection');
- return;
- }
-
- try {
- $links = Zend_Feed_Reader::findFeedLinks('http://meiobit.com');
- } catch(Exception $e) {
- $this->fail($e->getMessage());
- }
- $this->assertEquals('http://meiobit.com/rss.xml', $links->rss);
- }
-
- /**
- * @group ZF-8330
- */
- public function testGetsFeedLinksAndNormalisesRelativeUrlsOnUriWithPath()
- {
- try {
- $currClient = Zend_Feed_Reader::getHttpClient();
-
- $testAdapter = new Zend_Http_Client_Adapter_Test();
- $testAdapter->setResponse(new Zend_Http_Response(200, array(), ''));
- Zend_Feed_Reader::setHttpClient(new Zend_Http_Client(null, array('adapter' => $testAdapter)));
-
- $links = Zend_Feed_Reader::findFeedLinks('http://foo/bar');
-
- Zend_Feed_Reader::setHttpClient($currClient);
- } catch(Exception $e) {
- $this->fail($e->getMessage());
- }
-
- $this->assertEquals('http://foo/test.rss', $links->rss);
- $this->assertEquals('http://foo/test.atom', $links->atom);
- }
-
- public function testAddsPrefixPath()
- {
- Zend_Feed_Reader::addPrefixPath('A_B_C', '/A/B/C');
- $prefixPaths = Zend_Feed_Reader::getPluginLoader()->getPaths();
- $this->assertEquals('/A/B/C/', $prefixPaths['A_B_C_'][0]);
- }
-
- public function testRegistersUserExtension()
- {
- try {
- Zend_Feed_Reader::addPrefixPath('My_FeedReader_Extension',dirname(__FILE__) . '/Reader/_files/My/Extension');
- Zend_Feed_Reader::registerExtension('JungleBooks');
- } catch(Exception $e) {
- $this->fail($e->getMessage());
- }
- $this->assertTrue(Zend_Feed_Reader::isRegistered('JungleBooks'));
- }
-
- /**
- * @group ZF-11184
- */
- public function testImportingUriWithEmptyResponseBodyTriggersException()
- {
- $currClient = Zend_Feed_Reader::getHttpClient();
- $testAdapter = new Zend_Http_Client_Adapter_Test();
- $testAdapter->setResponse(new Zend_Http_Response(200,array(),''));
- Zend_Feed_Reader::setHttpClient(new Zend_Http_Client(null, array(
- 'adapter'=>$testAdapter
- )));
-
- $this->setExpectedException('Zend_Feed_Exception', 'Feed failed to load');
- $result = Zend_Feed_Reader::import('http://www.example.com');
- }
-
- public function testXxePreventionOnFeedParsing()
- {
- $string = file_get_contents($this->_feedSamplePath.'/Reader/xxe-atom10.xml');
- $string = str_replace('XXE_URI', $this->_feedSamplePath.'/Reader/xxe-info.txt', $string);
- $this->setExpectedException('Zend_Feed_Exception');
- $feed = Zend_Feed_Reader::importString($string);
- }
-
- protected function _getTempDirectory()
- {
- $tmpdir = array();
- foreach (array($_ENV, $_SERVER) as $tab) {
- foreach (array('TMPDIR', 'TEMP', 'TMP', 'windir', 'SystemRoot') as $key) {
- if (isset($tab[$key])) {
- if (($key == 'windir') or ($key == 'SystemRoot')) {
- $dir = realpath($tab[$key] . '\\temp');
- } else {
- $dir = realpath($tab[$key]);
- }
- if ($this->_isGoodTmpDir($dir)) {
- return $dir;
- }
- }
- }
- }
- if (function_exists('sys_get_temp_dir')) {
- $dir = sys_get_temp_dir();
- if ($this->_isGoodTmpDir($dir)) {
- return $dir;
- }
- }
- $tempFile = tempnam(md5(uniqid(rand(), TRUE)), '');
- if ($tempFile) {
- $dir = realpath(dirname($tempFile));
- unlink($tempFile);
- if ($this->_isGoodTmpDir($dir)) {
- return $dir;
- }
- }
- if ($this->_isGoodTmpDir('/tmp')) {
- return '/tmp';
- }
- if ($this->_isGoodTmpDir('\\temp')) {
- return '\\temp';
- }
- }
-
- protected function _isGoodTmpDir($dir)
- {
- if (is_readable($dir) && is_writable($dir)) {
- return true;
- }
- return false;
- }
-
-}
diff --git a/tests/Zend/Feed/RssTest.php b/tests/Zend/Feed/RssTest.php
deleted file mode 100644
index 6f023864ab..0000000000
--- a/tests/Zend/Feed/RssTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-baseUri . '/' . $this->prepareFeed('zend_feed_rss_xxe.xml');
- $this->setExpectedException('Zend_Feed_Exception', 'parse');
- $feed = new Zend_Feed_Rss($uri);
- }
-}
diff --git a/tests/Zend/Feed/Writer/DeletedTest.php b/tests/Zend/Feed/Writer/DeletedTest.php
deleted file mode 100644
index adf02fa752..0000000000
--- a/tests/Zend/Feed/Writer/DeletedTest.php
+++ /dev/null
@@ -1,183 +0,0 @@
-setReference('http://www.example.com/id');
- $this->assertEquals('http://www.example.com/id', $entry->getReference());
- }
-
- public function testSetReferenceThrowsExceptionOnInvalidParameter()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- try {
- $entry->setReference('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetReferenceReturnsNullIfNotSet()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $this->assertTrue(is_null($entry->getReference()));
- }
-
- public function testSetWhenDefaultsToCurrentTime()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setWhen();
- $dateNow = new Zend_Date;
- $this->assertTrue($dateNow->isLater($entry->getWhen()) || $dateNow->equals($entry->getWhen()));
- }
-
- public function testSetWhenUsesGivenUnixTimestamp()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setWhen(1234567890);
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getWhen()));
- }
-
- /**
- * @group ZF-12070
- */
- public function testSetWhenUsesGivenUnixTimestampWhenItIsLessThanTenDigits()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setWhen(123456789);
- $myDate = new Zend_Date('123456789', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getWhen()));
- }
-
- /**
- * @group ZF-11610
- */
- public function testSetWhenUsesGivenUnixTimestampWhenItIsAVerySmallInteger()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setWhen(123);
- $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getWhen()));
- }
-
- public function testSetWhenUsesZendDateObject()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setWhen(new Zend_Date('1234567890', Zend_Date::TIMESTAMP));
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getWhen()));
- }
-
- public function testSetWhenThrowsExceptionOnInvalidParameter()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- try {
- $entry->setWhen('abc');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetWhenReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $this->assertTrue(is_null($entry->getWhen()));
- }
-
- public function testAddsByNameFromArray()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setBy(array('name'=>'Joe'));
- $this->assertEquals(array('name'=>'Joe'), $entry->getBy());
- }
-
- public function testAddsByEmailFromArray()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setBy(array('name'=>'Joe','email'=>'joe@example.com'));
- $this->assertEquals(array('name'=>'Joe', 'email' => 'joe@example.com'), $entry->getBy());
- }
-
- public function testAddsByUriFromArray()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- $entry->setBy(array('name'=>'Joe','uri'=>'http://www.example.com'));
- $this->assertEquals(array('name'=>'Joe', 'uri' => 'http://www.example.com'), $entry->getBy());
- }
-
- public function testAddByThrowsExceptionOnInvalidNameFromArray()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- try {
- $entry->setBy(array('name'=>''));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddByThrowsExceptionOnInvalidEmailFromArray()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- try {
- $entry->setBy(array('name'=>'Joe','email'=>''));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddByThrowsExceptionOnInvalidUriFromArray()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- try {
- $entry->setBy(array('name'=>'Joe','uri'=>'notauri'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddByThrowsExceptionIfNameOmittedFromArray()
- {
- $entry = new Zend_Feed_Writer_Deleted;
- try {
- $entry->setBy(array('uri'=>'notauri'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
-}
diff --git a/tests/Zend/Feed/Writer/EntryTest.php b/tests/Zend/Feed/Writer/EntryTest.php
deleted file mode 100644
index 67c712979d..0000000000
--- a/tests/Zend/Feed/Writer/EntryTest.php
+++ /dev/null
@@ -1,603 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/_files';
- }
-
- public function testAddsAuthorName()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addAuthor('Joe');
- $this->assertEquals(array(array('name'=>'Joe')), $entry->getAuthors());
- }
-
- public function testAddsAuthorEmail()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addAuthor('Joe', 'joe@example.com');
- $this->assertEquals(array(array('name'=>'Joe', 'email' => 'joe@example.com')), $entry->getAuthors());
- }
-
- public function testAddsAuthorUri()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addAuthor('Joe', null, 'http://www.example.com');
- $this->assertEquals(array(array('name'=>'Joe', 'uri' => 'http://www.example.com')), $entry->getAuthors());
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidName()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->addAuthor('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidEmail()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->addAuthor('Joe', '');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidUri()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->addAuthor('Joe', null, 'notauri');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddsAuthorNameFromArray()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addAuthor(array('name'=>'Joe'));
- $this->assertEquals(array(array('name'=>'Joe')), $entry->getAuthors());
- }
-
- public function testAddsAuthorEmailFromArray()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addAuthor(array('name'=>'Joe','email'=>'joe@example.com'));
- $this->assertEquals(array(array('name'=>'Joe', 'email' => 'joe@example.com')), $entry->getAuthors());
- }
-
- public function testAddsAuthorUriFromArray()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addAuthor(array('name'=>'Joe','uri'=>'http://www.example.com'));
- $this->assertEquals(array(array('name'=>'Joe', 'uri' => 'http://www.example.com')), $entry->getAuthors());
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidNameFromArray()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->addAuthor(array('name'=>''));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidEmailFromArray()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->addAuthor(array('name'=>'Joe','email'=>''));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidUriFromArray()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->addAuthor(array('name'=>'Joe','uri'=>'notauri'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionIfNameOmittedFromArray()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->addAuthor(array('uri'=>'notauri'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddsAuthorsFromArrayOfAuthors()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addAuthors(array(
- array('name'=>'Joe','uri'=>'http://www.example.com'),
- array('name'=>'Jane','uri'=>'http://www.example.com')
- ));
- $expected = array(
- array('name'=>'Joe','uri'=>'http://www.example.com'),
- array('name'=>'Jane','uri'=>'http://www.example.com')
- );
- $this->assertEquals($expected, $entry->getAuthors());
- }
-
- public function testAddsEnclosure()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setEnclosure(array(
- 'type' => 'audio/mpeg',
- 'uri' => 'http://example.com/audio.mp3',
- 'length' => '1337'
- ));
- $expected = array(
- 'type' => 'audio/mpeg',
- 'uri' => 'http://example.com/audio.mp3',
- 'length' => '1337'
- );
- $this->assertEquals($expected, $entry->getEnclosure());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testAddsEnclosureThrowsExceptionOnMissingUri()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setEnclosure(array(
- 'type' => 'audio/mpeg',
- 'length' => '1337'
- ));
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testAddsEnclosureThrowsExceptionWhenUriIsInvalid()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setEnclosure(array(
- 'type' => 'audio/mpeg',
- 'uri' => 'http://',
- 'length' => '1337'
- ));
- }
-
- public function testSetsCopyright()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setCopyright('Copyright (c) 2009 Paddy Brady');
- $this->assertEquals('Copyright (c) 2009 Paddy Brady', $entry->getCopyright());
- }
-
- public function testSetCopyrightThrowsExceptionOnInvalidParam()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCopyright('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetsContent()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setContent('I\'m content.');
- $this->assertEquals("I'm content.", $entry->getContent());
- }
-
- public function testSetContentThrowsExceptionOnInvalidParam()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setContent('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetDateCreatedDefaultsToCurrentTime()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateCreated();
- $dateNow = new Zend_Date;
- $this->assertTrue($dateNow->isLater($entry->getDateCreated()) || $dateNow->equals($entry->getDateCreated()));
- }
-
- public function testSetDateCreatedUsesGivenUnixTimestamp()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateCreated(1234567890);
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateCreated()));
- }
-
- /**
- * @group ZF-12070
- */
- public function testSetDateCreatedUsesGivenUnixTimestampWhenItIsLessThanTenDigits()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateCreated(123456789);
- $myDate = new Zend_Date('123456789', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateCreated()));
- }
-
- /**
- * @group ZF-11610
- */
- public function testSetDateCreatedUsesGivenUnixTimestampWhenItIsAVerySmallInteger()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateCreated(123);
- $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateCreated()));
- }
-
- public function testSetDateCreatedUsesZendDateObject()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateCreated(new Zend_Date('1234567890', Zend_Date::TIMESTAMP));
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateCreated()));
- }
-
- public function testSetDateModifiedDefaultsToCurrentTime()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateModified();
- $dateNow = new Zend_Date;
- $this->assertTrue($dateNow->isLater($entry->getDateModified()) || $dateNow->equals($entry->getDateModified()));
- }
-
- public function testSetDateModifiedUsesGivenUnixTimestamp()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateModified(1234567890);
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateModified()));
- }
-
- /**
- * @group ZF-12070
- */
- public function testSetDateModifiedUsesGivenUnixTimestampWhenItIsLessThanTenDigits()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateModified(123456789);
- $myDate = new Zend_Date('123456789', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateModified()));
- }
-
- /**
- * @group ZF-11610
- */
- public function testSetDateModifiedUsesGivenUnixTimestampWhenItIsAVerySmallInteger()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateModified(123);
- $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateModified()));
- }
-
- public function testSetDateModifiedUsesZendDateObject()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDateModified(new Zend_Date('1234567890', Zend_Date::TIMESTAMP));
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($entry->getDateModified()));
- }
-
- public function testSetDateCreatedThrowsExceptionOnInvalidParameter()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setDateCreated('abc');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetDateModifiedThrowsExceptionOnInvalidParameter()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setDateModified('abc');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetDateCreatedReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getDateCreated()));
- }
-
- public function testGetDateModifiedReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getDateModified()));
- }
-
- public function testGetCopyrightReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getCopyright()));
- }
-
- public function testGetContentReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getContent()));
- }
-
- public function testSetsDescription()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setDescription('abc');
- $this->assertEquals('abc', $entry->getDescription());
- }
-
- public function testSetDescriptionThrowsExceptionOnInvalidParameter()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setDescription('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetDescriptionReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getDescription()));
- }
-
- public function testSetsId()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setId('http://www.example.com/id');
- $this->assertEquals('http://www.example.com/id', $entry->getId());
- }
-
- public function testSetIdThrowsExceptionOnInvalidParameter()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setId('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetIdReturnsNullIfNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getId()));
- }
-
- public function testSetsLink()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setLink('http://www.example.com/id');
- $this->assertEquals('http://www.example.com/id', $entry->getLink());
- }
-
- public function testSetLinkThrowsExceptionOnEmptyString()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setLink('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetLinkThrowsExceptionOnInvalidUri()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setLink('http://');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetLinkReturnsNullIfNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getLink()));
- }
-
- public function testSetsCommentLink()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setCommentLink('http://www.example.com/id/comments');
- $this->assertEquals('http://www.example.com/id/comments', $entry->getCommentLink());
- }
-
- public function testSetCommentLinkThrowsExceptionOnEmptyString()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCommentLink('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetCommentLinkThrowsExceptionOnInvalidUri()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCommentLink('http://');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetCommentLinkReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getCommentLink()));
- }
-
- public function testSetsCommentFeedLink()
- {
- $entry = new Zend_Feed_Writer_Entry;
-
- $entry->setCommentFeedLink(array('uri'=>'http://www.example.com/id/comments', 'type'=>'rdf'));
- $this->assertEquals(array(array('uri'=>'http://www.example.com/id/comments', 'type'=>'rdf')), $entry->getCommentFeedLinks());
- }
-
- public function testSetCommentFeedLinkThrowsExceptionOnEmptyString()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCommentFeedLink(array('uri'=>'', 'type'=>'rdf'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetCommentFeedLinkThrowsExceptionOnInvalidUri()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCommentFeedLink(array('uri'=>'http://', 'type'=>'rdf'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetCommentFeedLinkThrowsExceptionOnInvalidType()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCommentFeedLink(array('uri'=>'http://www.example.com/id/comments', 'type'=>'foo'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetCommentFeedLinkReturnsNullIfNoneSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getCommentFeedLinks()));
- }
-
- public function testSetsTitle()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setTitle('abc');
- $this->assertEquals('abc', $entry->getTitle());
- }
-
- public function testSetTitleThrowsExceptionOnInvalidParameter()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setTitle('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetTitleReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getTitle()));
- }
-
- public function testSetsCommentCount()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setCommentCount('10');
- $this->assertEquals(10, $entry->getCommentCount());
- }
-
- /**
- * @group ZF-11150
- */
- public function testSetCommentCountAcceptsZero()
- {
- $entry = new Zend_Feed_Writer_Entry();
- $entry->setCommentCount(0);
- $this->assertEquals(0, $entry->getCommentCount());
- }
-
- public function testSetCommentCountThrowsExceptionOnInvalidEmptyParameter()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCommentCount('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetCommentCountThrowsExceptionOnInvalidNonIntegerParameter()
- {
- $entry = new Zend_Feed_Writer_Entry;
- try {
- $entry->setCommentCount('a');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetCommentCountReturnsNullIfDateNotSet()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $this->assertTrue(is_null($entry->getCommentCount()));
- }
-
-}
diff --git a/tests/Zend/Feed/Writer/Extension/ITunes/EntryTest.php b/tests/Zend/Feed/Writer/Extension/ITunes/EntryTest.php
deleted file mode 100644
index 1a7373d872..0000000000
--- a/tests/Zend/Feed/Writer/Extension/ITunes/EntryTest.php
+++ /dev/null
@@ -1,229 +0,0 @@
-setItunesBlock('yes');
- $this->assertEquals('yes', $entry->getItunesBlock());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetBlockThrowsExceptionOnNonAlphaValue()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesBlock('123');
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesBlock(str_repeat('a', 256));
- }
-
- public function testAddAuthors()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addItunesAuthors(array('joe', 'jane'));
- $this->assertEquals(array('joe', 'jane'), $entry->getItunesAuthors());
- }
-
- public function testAddAuthor()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addItunesAuthor('joe');
- $this->assertEquals(array('joe'), $entry->getItunesAuthors());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->addItunesAuthor(str_repeat('a', 256));
- }
-
- public function testSetDurationAsSeconds()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesDuration(23);
- $this->assertEquals(23, $entry->getItunesDuration());
- }
-
- public function testSetDurationAsMinutesAndSeconds()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesDuration('23:23');
- $this->assertEquals('23:23', $entry->getItunesDuration());
- }
-
- public function testSetDurationAsHoursMinutesAndSeconds()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesDuration('23:23:23');
- $this->assertEquals('23:23:23', $entry->getItunesDuration());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetDurationThrowsExceptionOnUnknownFormat()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesDuration('abc');
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetDurationThrowsExceptionOnInvalidSeconds()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesDuration('23:456');
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetDurationThrowsExceptionOnInvalidMinutes()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesDuration('23:234:45');
- }
-
- public function testSetExplicitToYes()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesExplicit('yes');
- $this->assertEquals('yes', $entry->getItunesExplicit());
- }
-
- public function testSetExplicitToNo()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesExplicit('no');
- $this->assertEquals('no', $entry->getItunesExplicit());
- }
-
- public function testSetExplicitToClean()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesExplicit('clean');
- $this->assertEquals('clean', $entry->getItunesExplicit());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetExplicitThrowsExceptionOnUnknownTerm()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesExplicit('abc');
- }
-
- public function testSetKeywords()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $words = array(
- 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12'
- );
- $entry->setItunesKeywords($words);
- $this->assertEquals($words, $entry->getItunesKeywords());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $words = array(
- 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12', 'a13'
- );
- $entry->setItunesKeywords($words);
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharLength()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $words = array(
- str_repeat('a', 253), str_repeat('b', 2)
- );
- $entry->setItunesKeywords($words);
- }
-
- public function testSetSubtitle()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesSubtitle('abc');
- $this->assertEquals('abc', $entry->getItunesSubtitle());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesSubtitle(str_repeat('a', 256));
- }
-
- public function testSetSummary()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesSummary('abc');
- $this->assertEquals('abc', $entry->getItunesSummary());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetSummaryThrowsExceptionWhenValueExceeds255Chars()
- {
- $entry = new Zend_Feed_Writer_Entry;
- $entry->setItunesSummary(str_repeat('a', 4001));
- }
-
-}
diff --git a/tests/Zend/Feed/Writer/Extension/ITunes/FeedTest.php b/tests/Zend/Feed/Writer/Extension/ITunes/FeedTest.php
deleted file mode 100644
index 30676b1765..0000000000
--- a/tests/Zend/Feed/Writer/Extension/ITunes/FeedTest.php
+++ /dev/null
@@ -1,316 +0,0 @@
-setItunesBlock('yes');
- $this->assertEquals('yes', $feed->getItunesBlock());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetBlockThrowsExceptionOnNonAlphaValue()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesBlock('123');
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesBlock(str_repeat('a', 256));
- }
-
- public function testAddAuthors()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->addItunesAuthors(array('joe', 'jane'));
- $this->assertEquals(array('joe', 'jane'), $feed->getItunesAuthors());
- }
-
- public function testAddAuthor()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->addItunesAuthor('joe');
- $this->assertEquals(array('joe'), $feed->getItunesAuthors());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->addItunesAuthor(str_repeat('a', 256));
- }
-
- public function testSetCategories()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $cats = array(
- 'cat1',
- 'cat2' => array('cat2-1', 'cat2-a&b')
- );
- $feed->setItunesCategories($cats);
- $this->assertEquals($cats, $feed->getItunesCategories());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetCategoriesThrowsExceptionIfAnyCatNameGreaterThan255CharsLength()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $cats = array(
- 'cat1',
- 'cat2' => array('cat2-1', str_repeat('a', 256))
- );
- $feed->setItunesCategories($cats);
- $this->assertEquals($cats, $feed->getItunesAuthors());
- }
-
- public function testSetImageAsPngFile()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesImage('http://www.example.com/image.png');
- $this->assertEquals('http://www.example.com/image.png', $feed->getItunesImage());
- }
-
- public function testSetImageAsJpgFile()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesImage('http://www.example.com/image.jpg');
- $this->assertEquals('http://www.example.com/image.jpg', $feed->getItunesImage());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetImageThrowsExceptionOnInvalidUri()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesImage('http://');
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetImageThrowsExceptionOnInvalidImageExtension()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesImage('http://www.example.com/image.gif');
- }
-
- public function testSetDurationAsSeconds()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesDuration(23);
- $this->assertEquals(23, $feed->getItunesDuration());
- }
-
- public function testSetDurationAsMinutesAndSeconds()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesDuration('23:23');
- $this->assertEquals('23:23', $feed->getItunesDuration());
- }
-
- public function testSetDurationAsHoursMinutesAndSeconds()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesDuration('23:23:23');
- $this->assertEquals('23:23:23', $feed->getItunesDuration());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetDurationThrowsExceptionOnUnknownFormat()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesDuration('abc');
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetDurationThrowsExceptionOnInvalidSeconds()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesDuration('23:456');
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetDurationThrowsExceptionOnInvalidMinutes()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesDuration('23:234:45');
- }
-
- public function testSetExplicitToYes()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesExplicit('yes');
- $this->assertEquals('yes', $feed->getItunesExplicit());
- }
-
- public function testSetExplicitToNo()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesExplicit('no');
- $this->assertEquals('no', $feed->getItunesExplicit());
- }
-
- public function testSetExplicitToClean()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesExplicit('clean');
- $this->assertEquals('clean', $feed->getItunesExplicit());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetExplicitThrowsExceptionOnUnknownTerm()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesExplicit('abc');
- }
-
- public function testSetKeywords()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $words = array(
- 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12'
- );
- $feed->setItunesKeywords($words);
- $this->assertEquals($words, $feed->getItunesKeywords());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $words = array(
- 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12', 'a13'
- );
- $feed->setItunesKeywords($words);
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharLength()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $words = array(
- str_repeat('a', 253), str_repeat('b', 2)
- );
- $feed->setItunesKeywords($words);
- }
-
- public function testSetNewFeedUrl()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesNewFeedUrl('http://example.com/feed');
- $this->assertEquals('http://example.com/feed', $feed->getItunesNewFeedUrl());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetNewFeedUrlThrowsExceptionOnInvalidUri()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesNewFeedUrl('http://');
- }
-
- public function testAddOwner()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->addItunesOwner(array('name'=>'joe','email'=>'joe@example.com'));
- $this->assertEquals(array(array('name'=>'joe','email'=>'joe@example.com')), $feed->getItunesOwners());
- }
-
- public function testAddOwners()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->addItunesOwners(array(array('name'=>'joe','email'=>'joe@example.com')));
- $this->assertEquals(array(array('name'=>'joe','email'=>'joe@example.com')), $feed->getItunesOwners());
- }
-
- public function testSetSubtitle()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesSubtitle('abc');
- $this->assertEquals('abc', $feed->getItunesSubtitle());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesSubtitle(str_repeat('a', 256));
- }
-
- public function testSetSummary()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesSummary('abc');
- $this->assertEquals('abc', $feed->getItunesSummary());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetSummaryThrowsExceptionWhenValueExceeds4000Chars()
- {
- $feed = new Zend_Feed_Writer_Feed;
- $feed->setItunesSummary(str_repeat('a',4001));
- }
-
-}
diff --git a/tests/Zend/Feed/Writer/FeedTest.php b/tests/Zend/Feed/Writer/FeedTest.php
deleted file mode 100644
index c37729d155..0000000000
--- a/tests/Zend/Feed/Writer/FeedTest.php
+++ /dev/null
@@ -1,979 +0,0 @@
-_feedSamplePath = dirname(__FILE__) . '/Writer/_files';
- }
-
- public function testAddsAuthorName()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addAuthor('Joe');
- $this->assertEquals(array('name'=>'Joe'), $writer->getAuthor());
- }
-
- public function testAddsAuthorEmail()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addAuthor('Joe', 'joe@example.com');
- $this->assertEquals(array('name'=>'Joe', 'email' => 'joe@example.com'), $writer->getAuthor());
- }
-
- public function testAddsAuthorUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addAuthor('Joe', null, 'http://www.example.com');
- $this->assertEquals(array('name'=>'Joe', 'uri' => 'http://www.example.com'), $writer->getAuthor());
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidName()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addAuthor('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidEmail()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addAuthor('Joe', '');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addAuthor('Joe', null, 'notauri');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddsAuthorNameFromArray()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addAuthor(array('name'=>'Joe'));
- $this->assertEquals(array('name'=>'Joe'), $writer->getAuthor());
- }
-
- public function testAddsAuthorEmailFromArray()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addAuthor(array('name'=>'Joe','email'=>'joe@example.com'));
- $this->assertEquals(array('name'=>'Joe', 'email' => 'joe@example.com'), $writer->getAuthor());
- }
-
- public function testAddsAuthorUriFromArray()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addAuthor(array('name'=>'Joe','uri'=>'http://www.example.com'));
- $this->assertEquals(array('name'=>'Joe', 'uri' => 'http://www.example.com'), $writer->getAuthor());
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidNameFromArray()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addAuthor(array('name'=>''));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidEmailFromArray()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addAuthor(array('name'=>'Joe','email'=>''));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionOnInvalidUriFromArray()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addAuthor(array('name'=>'Joe','uri'=>'notauri'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddAuthorThrowsExceptionIfNameOmittedFromArray()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addAuthor(array('uri'=>'notauri'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddsAuthorsFromArrayOfAuthors()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addAuthors(array(
- array('name'=>'Joe','uri'=>'http://www.example.com'),
- array('name'=>'Jane','uri'=>'http://www.example.com')
- ));
- $this->assertEquals(array('name'=>'Jane', 'uri' => 'http://www.example.com'), $writer->getAuthor(1));
- }
-
- public function testSetsCopyright()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setCopyright('Copyright (c) 2009 Paddy Brady');
- $this->assertEquals('Copyright (c) 2009 Paddy Brady', $writer->getCopyright());
- }
-
- public function testSetCopyrightThrowsExceptionOnInvalidParam()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setCopyright('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetDateCreatedDefaultsToCurrentTime()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateCreated();
- $dateNow = new Zend_Date;
- $this->assertTrue($dateNow->isLater($writer->getDateCreated()) || $dateNow->equals($writer->getDateCreated()));
- }
-
- public function testSetDateCreatedUsesGivenUnixTimestamp()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateCreated(1234567890);
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateCreated()));
- }
-
- /**
- * @group ZF-12023
- */
- public function testSetDateCreatedUsesGivenUnixTimestampThatIsLessThanTenDigits()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateCreated(123456789);
- $myDate = new Zend_Date('123456789', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateCreated()));
- }
-
- /**
- * @group ZF-11610
- */
- public function testSetDateCreatedUsesGivenUnixTimestampThatIsAVerySmallInteger()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateCreated(123);
- $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateCreated()));
- }
-
- public function testSetDateCreatedUsesZendDateObject()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateCreated(new Zend_Date('1234567890', Zend_Date::TIMESTAMP));
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateCreated()));
- }
-
- public function testSetDateModifiedDefaultsToCurrentTime()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateModified();
- $dateNow = new Zend_Date;
- $this->assertTrue($dateNow->isLater($writer->getDateModified()) || $dateNow->equals($writer->getDateModified()));
- }
-
- public function testSetDateModifiedUsesGivenUnixTimestamp()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateModified(1234567890);
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateModified()));
- }
-
- /**
- * @group ZF-12023
- */
- public function testSetDateModifiedUsesGivenUnixTimestampThatIsLessThanTenDigits()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateModified(123456789);
- $myDate = new Zend_Date('123456789', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateModified()));
- }
-
- /**
- * @group ZF-11610
- */
- public function testSetDateModifiedUsesGivenUnixTimestampThatIsAVerySmallInteger()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateModified(123);
- $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateModified()));
- }
-
- public function testSetDateModifiedUsesZendDateObject()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDateModified(new Zend_Date('1234567890', Zend_Date::TIMESTAMP));
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getDateModified()));
- }
-
- public function testSetDateCreatedThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setDateCreated('abc');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetDateModifiedThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setDateModified('abc');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetDateCreatedReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getDateCreated()));
- }
-
- public function testGetDateModifiedReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getDateModified()));
- }
-
- public function testSetLastBuildDateDefaultsToCurrentTime()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setLastBuildDate();
- $dateNow = new Zend_Date;
- $this->assertTrue($dateNow->isLater($writer->getLastBuildDate()) || $dateNow->equals($writer->getLastBuildDate()));
- }
-
- public function testSetLastBuildDateUsesGivenUnixTimestamp()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setLastBuildDate(1234567890);
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getLastBuildDate()));
- }
-
- /**
- * @group ZF-12023
- */
- public function testSetLastBuildDateUsesGivenUnixTimestampThatIsLessThanTenDigits()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setLastBuildDate(123456789);
- $myDate = new Zend_Date('123456789', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getLastBuildDate()));
- }
-
- /**
- * @group ZF-11610
- */
- public function testSetLastBuildDateUsesGivenUnixTimestampThatIsAVerySmallInteger()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setLastBuildDate(123);
- $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getLastBuildDate()));
- }
-
- public function testSetLastBuildDateUsesZendDateObject()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setLastBuildDate(new Zend_Date('1234567890', Zend_Date::TIMESTAMP));
- $myDate = new Zend_Date('1234567890', Zend_Date::TIMESTAMP);
- $this->assertTrue($myDate->equals($writer->getLastBuildDate()));
- }
-
- public function testSetLastBuildDateThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setLastBuildDate('abc');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetLastBuildDateReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getLastBuildDate()));
- }
-
- public function testGetCopyrightReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getCopyright()));
- }
-
- public function testSetsDescription()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setDescription('abc');
- $this->assertEquals('abc', $writer->getDescription());
- }
-
- public function testSetDescriptionThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setDescription('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetDescriptionReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getDescription()));
- }
-
- public function testSetsId()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setId('http://www.example.com/id');
- $this->assertEquals('http://www.example.com/id', $writer->getId());
- }
-
- public function testSetsIdAcceptsUrns()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setId('urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6');
- $this->assertEquals('urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6', $writer->getId());
- }
-
- public function testSetsIdAcceptsSimpleTagUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setId('tag:example.org,2010:/foo/bar/');
- $this->assertEquals('tag:example.org,2010:/foo/bar/', $writer->getId());
- }
-
- public function testSetsIdAcceptsComplexTagUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setId('tag:diveintomark.org,2004-05-27:/archives/2004/05/27/howto-atom-linkblog');
- $this->assertEquals('tag:diveintomark.org,2004-05-27:/archives/2004/05/27/howto-atom-linkblog', $writer->getId());
- }
-
- public function testSetIdThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setId('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetIdThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setId('http://');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetIdReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getId()));
- }
-
- public function testSetsLanguage()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setLanguage('abc');
- $this->assertEquals('abc', $writer->getLanguage());
- }
-
- public function testSetLanguageThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setLanguage('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetLanguageReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getLanguage()));
- }
-
- public function testSetsLink()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setLink('http://www.example.com/id');
- $this->assertEquals('http://www.example.com/id', $writer->getLink());
- }
-
- public function testSetLinkThrowsExceptionOnEmptyString()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setLink('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetLinkThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setLink('http://');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetLinkReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getLink()));
- }
-
- public function testSetsEncoding()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setEncoding('utf-16');
- $this->assertEquals('utf-16', $writer->getEncoding());
- }
-
- public function testSetEncodingThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setEncoding('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetEncodingReturnsUtf8IfNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertEquals('UTF-8', $writer->getEncoding());
- }
-
- public function testSetsTitle()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setTitle('abc');
- $this->assertEquals('abc', $writer->getTitle());
- }
-
- public function testSetTitleThrowsExceptionOnInvalidParameter()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setTitle('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetTitleReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getTitle()));
- }
-
- public function testSetsGeneratorName()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setGenerator(array('name'=>'ZFW'));
- $this->assertEquals(array('name'=>'ZFW'), $writer->getGenerator());
- }
-
- public function testSetsGeneratorVersion()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setGenerator(array('name'=>'ZFW', 'version' => '1.0'));
- $this->assertEquals(array('name'=>'ZFW', 'version' => '1.0'), $writer->getGenerator());
- }
-
- public function testSetsGeneratorUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setGenerator(array('name'=>'ZFW', 'uri'=>'http://www.example.com'));
- $this->assertEquals(array('name'=>'ZFW', 'uri' => 'http://www.example.com'), $writer->getGenerator());
- }
-
- public function testSetsGeneratorThrowsExceptionOnInvalidName()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setGenerator(array());
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetsGeneratorThrowsExceptionOnInvalidVersion()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setGenerator(array('name'=>'ZFW', 'version'=>''));
- $this->fail('Should have failed since version is empty');
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetsGeneratorThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setGenerator(array('name'=>'ZFW','uri'=>'notauri'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- /**
- * @deprecated
- */
- public function testSetsGeneratorName_Deprecated()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setGenerator('ZFW');
- $this->assertEquals(array('name'=>'ZFW'), $writer->getGenerator());
- }
-
- /**
- * @deprecated
- */
- public function testSetsGeneratorVersion_Deprecated()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setGenerator('ZFW', '1.0');
- $this->assertEquals(array('name'=>'ZFW', 'version' => '1.0'), $writer->getGenerator());
- }
-
- /**
- * @deprecated
- */
- public function testSetsGeneratorUri_Deprecated()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setGenerator('ZFW', null, 'http://www.example.com');
- $this->assertEquals(array('name'=>'ZFW', 'uri' => 'http://www.example.com'), $writer->getGenerator());
- }
-
- /**
- * @deprecated
- */
- public function testSetsGeneratorThrowsExceptionOnInvalidName_Deprecated()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setGenerator('');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- /**
- * @deprecated
- */
- public function testSetsGeneratorThrowsExceptionOnInvalidVersion_Deprecated()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setGenerator('ZFW', '');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- /**
- * @deprecated
- */
- public function testSetsGeneratorThrowsExceptionOnInvalidUri_Deprecated()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setGenerator('ZFW', null, 'notauri');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetGeneratorReturnsNullIfDateNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getGenerator()));
- }
-
- public function testSetsFeedLink()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setFeedLink('http://www.example.com/rss', 'RSS');
- $this->assertEquals(array('rss'=>'http://www.example.com/rss'), $writer->getFeedLinks());
- }
-
- public function testSetsFeedLinkThrowsExceptionOnInvalidType()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setFeedLink('http://www.example.com/rss', 'abc');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testSetsFeedLinkThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setFeedLink('http://', 'rss');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetFeedLinksReturnsNullIfNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getFeedLinks()));
- }
-
- public function testSetsBaseUrl()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setBaseUrl('http://www.example.com');
- $this->assertEquals('http://www.example.com', $writer->getBaseUrl());
- }
-
- public function testSetsBaseUrlThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->setBaseUrl('http://');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testGetBaseUrlReturnsNullIfNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getBaseUrl()));
- }
-
- public function testAddsHubUrl()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addHub('http://www.example.com/hub');
- $this->assertEquals(array('http://www.example.com/hub'), $writer->getHubs());
- }
-
- public function testAddsManyHubUrls()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addHubs(array('http://www.example.com/hub', 'http://www.example.com/hub2'));
- $this->assertEquals(array('http://www.example.com/hub', 'http://www.example.com/hub2'), $writer->getHubs());
- }
-
- public function testAddingHubUrlThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addHub('http://');
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddingHubUrlReturnsNullIfNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getHubs()));
- }
-
- public function testCreatesNewEntryDataContainer()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $entry = $writer->createEntry();
- $this->assertTrue($entry instanceof Zend_Feed_Writer_Entry);
- }
-
- public function testAddsCategory()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addCategory(array('term'=>'cat_dog'));
- $this->assertEquals(array(array('term'=>'cat_dog')), $writer->getCategories());
- }
-
- public function testAddsManyCategories()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->addCategories(array(array('term'=>'cat_dog'),array('term'=>'cat_mouse')));
- $this->assertEquals(array(array('term'=>'cat_dog'),array('term'=>'cat_mouse')), $writer->getCategories());
- }
-
- public function testAddingCategoryWithoutTermThrowsException()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addCategory(array('label' => 'Cats & Dogs', 'scheme' => 'http://www.example.com/schema1'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- public function testAddingCategoryWithInvalidUriAsSchemeThrowsException()
- {
- $writer = new Zend_Feed_Writer_Feed;
- try {
- $writer->addCategory(array('term' => 'cat_dog', 'scheme' => 'http://'));
- $this->fail();
- } catch (Zend_Feed_Exception $e) {
- }
- }
-
- // Image Tests
-
- public function testSetsImageUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => 'http://www.example.com/logo.gif'
- ));
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/logo.gif'
- ), $writer->getImage());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetsImageUriThrowsExceptionOnEmptyUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => ''
- ));
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetsImageUriThrowsExceptionOnMissingUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetsImageUriThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => 'http://'
- ));
- }
-
- public function testSetsImageLink()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'link' => 'http://www.example.com'
- ));
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'link' => 'http://www.example.com'
- ), $writer->getImage());
- }
-
- public function testSetsImageTitle()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'title' => 'Image title'
- ));
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'title' => 'Image title'
- ), $writer->getImage());
- }
-
- public function testSetsImageHeight()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'height' => '88'
- ));
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'height' => '88'
- ), $writer->getImage());
- }
-
- public function testSetsImageWidth()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'width' => '88'
- ));
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'width' => '88'
- ), $writer->getImage());
- }
-
- public function testSetsImageDescription()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setImage(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'description' => 'Image description'
- ));
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/logo.gif',
- 'description' => 'Image description'
- ), $writer->getImage());
- }
-
- // Icon Tests
-
- public function testSetsIconUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setIcon(array(
- 'uri' => 'http://www.example.com/logo.gif'
- ));
- $this->assertEquals(array(
- 'uri' => 'http://www.example.com/logo.gif'
- ), $writer->getIcon());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetsIconUriThrowsExceptionOnEmptyUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setIcon(array(
- 'uri' => ''
- ));
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetsIconUriThrowsExceptionOnMissingUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setIcon(array());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testSetsIconUriThrowsExceptionOnInvalidUri()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $writer->setIcon(array(
- 'uri' => 'http://'
- ));
- }
-
- public function testGetCategoriesReturnsNullIfNotSet()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $this->assertTrue(is_null($writer->getCategories()));
- }
-
- public function testAddsAndOrdersEntriesByDateIfRequested()
- {
- $writer = new Zend_Feed_Writer_Feed;
- $entry = $writer->createEntry();
- $entry->setDateCreated(1234567890);
- $entry2 = $writer->createEntry();
- $entry2->setDateCreated(1230000000);
- $writer->addEntry($entry);
- $writer->addEntry($entry2);
- $writer->orderByDate();
- $this->assertEquals(1230000000, $writer->getEntry(1)->getDateCreated()->get(Zend_Date::TIMESTAMP));
- }
-
-}
diff --git a/tests/Zend/Feed/Writer/Renderer/Entry/AtomTest.php b/tests/Zend/Feed/Writer/Renderer/Entry/AtomTest.php
deleted file mode 100644
index e2e9a50188..0000000000
--- a/tests/Zend/Feed/Writer/Renderer/Entry/AtomTest.php
+++ /dev/null
@@ -1,315 +0,0 @@
-_validWriter = new Zend_Feed_Writer_Feed;
-
- $this->_validWriter->setType('atom');
-
- $this->_validWriter->setTitle('This is a test feed.');
- $this->_validWriter->setDescription('This is a test description.');
- $this->_validWriter->setDateModified(1234567890);
- $this->_validWriter->setLink('http://www.example.com');
- $this->_validWriter->setFeedLink('http://www.example.com/atom', 'atom');
- $this->_validWriter->addAuthor('Joe', 'joe@example.com', 'http://www.example.com/joe');
- $this->_validEntry = $this->_validWriter->createEntry();
- $this->_validEntry->setTitle('This is a test entry.');
- $this->_validEntry->setDescription('This is a test entry description.');
- $this->_validEntry->setDateModified(1234567890);
- $this->_validEntry->setDateCreated(1234567000);
- $this->_validEntry->setLink('http://www.example.com/1');
- $this->_validEntry->addAuthor('Jane', 'jane@example.com', 'http://www.example.com/jane');
- $this->_validEntry->setContent('
This is test content for xhtml:
');
- $this->_validWriter->addEntry($this->_validEntry);
- }
-
- public function tearDown()
- {
- $this->_validWriter = null;
- $this->_validEntry = null;
- }
-
- public function testRenderMethodRunsMinimalWriterContainerProperlyBeforeICheckAtomCompliance()
- {
- $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter);
- try {
- $renderer->render();
- } catch (Zend_Feed_Exception $e) {
- $this->fail('Valid Writer object caused an exception when building which should never happen');
- }
- }
-
- public function testEntryEncodingHasBeenSet()
- {
- $this->_validWriter->setEncoding('iso-8859-1');
- $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter);
- $feed = Zend_Feed_Reader::importString($renderer->render()->saveXml());
- $entry = $feed->current();
- $this->assertEquals('iso-8859-1', $entry->getEncoding());
- }
-
- public function testEntryEncodingDefaultIsUsedIfEncodingNotSetByHand()
- {
- $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter);
- $feed = Zend_Feed_Reader::importString($renderer->render()->saveXml());
- $entry = $feed->current();
- $this->assertEquals('UTF-8', $entry->getEncoding());
- }
-
- public function testEntryTitleHasBeenSet()
- {
- $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter);
- $feed = Zend_Feed_Reader::importString($renderer->render()->saveXml());
- $entry = $feed->current();
- $this->assertEquals('This is a test entry.', $entry->getTitle());
- }
-
- /**
- * @expectedException Zend_Feed_Exception
- */
- public function testFeedTitleIfMissingThrowsException()
- {
- $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter);
- $this->_validEntry->remove('title');
- $atomFeed->render();
- }
-
- public function testEntrySummaryDescriptionHasBeenSet()
- {
- $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter);
- $feed = Zend_Feed_Reader::importString($renderer->render()->saveXml());
- $entry = $feed->current();
- $this->assertEquals('This is a test entry description.', $entry->getDescription());
- }
-
- /**
- * @group ZFWATOMCONTENT
- */
- public function testEntryContentHasBeenSet_Xhtml()
- {
- $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter);
- $feed = Zend_Feed_Reader::importString($renderer->render()->saveXml());
- $entry = $feed->current();
- $this->assertEquals('
This is an Atom formatted XML site feed. It is intended to be viewed in a Newsreader or syndicated to another site. Please visit the Blogger Help for more info.
-
-true
-
-
-
-A Googler
-
-2006-01-12T11:53:00-08:00
-2006-01-12T19:55:20Z
-2006-01-11T03:07:43Z
-
-tag:blogger.com,1999:blog-10861780.post-113694886327994245
-Your Google homepage, to go
-
-
-Posted by Abhijit Kalamkar, Software Engineer
-
- Anyone who's ever tried to browse the web on their cell phone knows that it isn't always the best user experience. That's why I'm excited to tell you about Google Mobile Personalized Home. We've designed a way for you to view the things that you really care about, from your Gmail inbox to news headlines, weather, stock quotes, and feeds (Atom or RSS). The interface is optimized for small screens, and we've arranged things so you don't have to click on a bunch of links to locate what you're after -– your personalized content appears on top, right where it should be. Give it a try, and let us know how you like it.
-Posted by Rajen Sheth, Product Manager
-
- Today is the one year anniversary of the Google Mini, Google's solution for website and corporate network search, and to celebrate we thought we'd announce a few more of them. The standard Mini lets you search up to 100,000 documents. Now organizations that constantly crank out new content can opt for either of two new Minis: one searches up to 200,000 documents, and another that can manage up to 300,000. All three deliver the same easy setup, intuitive interface and fast, relevant results that the Mini is already bringing to thousands of websites and corporate networks. You're growing, and the Mini is growing with you.
-
-false
-
-
-
-
-A Googler
-
-2006-01-10T12:49:00-08:00
-2006-01-10T21:02:47Z
-2005-12-31T01:44:54Z
-
-tag:blogger.com,1999:blog-10861780.post-113599349496410640
-Google Earth in a Mac world (PC too)
-
-
-Posted by Chikai Ohazama, Google Earth Team
-
- We feel like proud parents around here. Our eldest, Google Earth for the PC, is officially leaving beta status today, and we couldn't be more pleased. For those of you who downloaded early, upgrade to the latest and discover Google Earth all over again.
- And we have a brand new member of the family -- Google Earth for Macintosh. We're happy to finally have some good news for the, ahem, vocal Mac enthusiasts we've been hearing from. Let's just say that we have gotten more than a few "requests" for a Mac version of Google Earth. They've gone something like this:
- 1) "When is it coming out? Your website says that you are working on it."
- 2) "You know, Mac users are very heavy graphics/mapping/visualization/design/ architecture/education/real estate/geocaching/social-geo-video-networking fans who would certainly use Google Earth a lot."
- 3) "So when is it coming out?"
- We heard you loud and clear. The Mac version runs on OS X 10.4 and up. Happy travels throughout Google Earth, whether you're on a Mac or a PC.
-
-false
-
-
-
-
-A Googler
-
-2006-01-09T22:16:00-08:00
-2006-01-11T20:30:26Z
-2005-12-31T18:25:16Z
-
-tag:blogger.com,1999:blog-10861780.post-113605351620153422
-A new year for Google Video
-<span class="byline-author">Posted by Sanjay Raman, Google Video Team</span><br /><br />Till now, Google Video has been about watching videos and clips online, which is really convenient for videos <a href="http://video.google.com/videoplay?docid=-3496860874967925614&q=fastfocus">like this</a>. But wouldn't it be awesome to watch that episode of <span style="font-style: italic;"><a href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DCSI">CSI</a></span> that you missed when even your trusty DVR failed you? This is one reason we've launched the Google Video store, where you can rent or buy from such well-known media partners as <a href="http://video.google.com/cbs.html">CBS</a>, the <a href="http://video.google.com/nba.html">NBA</a>, The <a href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DCharlie_Rose">Charlie Rose Show</a>, and <a href="http://video.google.com/videosearch?q=Sony+BMG">SONY BMG</a>.<br /><br />We’re not only about mainstream content, though -– we have thousands of titles available (and more coming every day) from every imaginable type of producer, including <a href="http://video.google.com/videosearch?q=1896+tsar+nicholas&so=0">this 1896 clip</a> of the coronation of Tsar Nicholas II – one of the earliest known moving images. We’re especially pleased to offer such quality indie features as Ben Rekhi’s <span style="font-style: italic;"><a href="http://video.google.com/videoplay?docid=-1607114503824678810&q=waterborne ">Waterborne</a></span> (Drops Entertainment) and Lerone Wilson’s <span style="font-style: italic;"><a href="http://video.google.com/videoplay?docid=-4929215594503422280&q=aardvark%27d ">Aardvark’d: 12 Weeks with Geeks</a></span> (Boondoggle Films).<br /><br />When we launched our <a href="https://upload.video.google.com">Upload Program</a> earlier this year, people sent in a huge number of free and compelling videos. But since there's a ton of video that can't be offered for free, we built the <a href="http://video.google.com/">Google Video store</a> to give content owners the option to charge for downloads if they'd like. This means producers large and small can distribute their great content in an easy, secure way. Some of your favorite prime time and classic TV shows, sports, music videos, and documentaries are at your fingertips. Want to see how Shaq scored 30 points last night? Download and watch it (and every <a href="http://video.google.com/nba.html">NBA</a> game for the rest of the season) through Google Video.<br /><br />You can play all the videos you download using the all-new Google Video Player. We're especially pleased about the thumbnail navigation for browsing an entire video so you can play any portion with a single click. And there's another thing: if the content is not copy-protected, you can take your favorite videos with you on your <a href="http://www.apple.com/ipod/">iPod</a> or <a href="http://www.us.playstation.com/psp.aspx">PSP</a> -- our "to go" option.<br /><br />Since it's so early in the year, here's a resolution we intend to keep: make sure new features and content continue to roll out, so that you think Google Video is one of the best ways to find video on the web.<br /><br />These video providers are getting us off to a great start:<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=in_label%3Aowner%3Daquarius">Aquarius Health Care Media</a></span>: A leading producer and distributor of healthcare-related videos will pilot with Google Video using a variety of titles covering SIDS, diabetes, and blindness, among other health issues.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=ardustry">Ardustry Home Entertainment</a></span>: Offers substantial libraries of theatrical motion pictures, television series, documentaries and reality programming, music and sports specials, lifestyle titles, and a wide array of “how-to†products.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=bluehighways">BlueHighways TV</a></span>: Programming service that explores the people, stories, traditions and cultures of America. Discovering the sights and sounds of communities across the country with an up-close, laid-back programming style, BlueHighways TV presents a collage of remarkable music, folklore and information for audiences interested in all aspects of American life and heritage. Programming includes <span style="font-style: italic;">Reno's Old Time Music Festival,</span> <span style="font-style: italic;">American Journeys,</span> <span style="font-style: italic;">Stan Hitchcock's Heart to Heart,</span> and <span style="font-style: italic;">Gospel Sampler</span>.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dcaretalk">CareTALK</a></span>: A multimedia brand dedicated to consumer-directed health care offering programming and tools to help modern family caregivers; initially offering 10-20 hours of health and caregiving-related content (10-20 minutes in length).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/cbs.html">CBS</a>: Includes prime time hits such as <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DCSI">CSI</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3Dncis">NCIS</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DSurvivor_Guatemala">Survivor: Guatemala</a>, and The Amazing Race (available spring ’06), as well as classics like <a style="font-style: italic;" href="http://video.google.com/videosearch?q=I+Love+Lucy">I Love Lucy</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DTwilight_Zone">Twilight Zone</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DBrady_Bunch">Brady Bunch</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=Have+Gun+Will+Travel">Have Gun Will Travel</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DMacGyver">MacGyver</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DStar_Trek_Deep_Space_Nine">Star Trek: Deep Space Nine</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DStar_Trek_Voyager">Star Trek: Voyager</a>, and My Three Sons (coming soon).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DCharlie_Rose">The Charlie Rose Show</a>: Includes interviews with Henry Kissinger, Oliver Stone, Quentin Tarantino, Martha Stewart, Martin Scorsese, Harrison Ford, Dan Rather, Charles M. Schulz, Steve Jobs, Jay Leno, Tom Brokaw, and others.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=Cine+Excel&so=0">Cine Excel</a>: Independent producer will trial on Google Video with 3 DVD movie titles: <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=6833548605067650376&q=Cine+Excel">Bikini Hotel </a>(1997), <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=-9198267889833807992&q=Cine+Excel">Tao of Karate</a> (short-film, 1998) and <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=8241854949946868864&q=Cine+Excel">Karate Wars</a> (1998).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=classic+media">Classic Media</a>: Classic Media owns and manages some of the world's most recognizable family properties across all media including feature film, television, home video and consumer products. The company's extensive library features a diverse collection of popular animated and live-action characters. For lentaries are at your fingertips. Want to see how Shaq scored 30 points last night? Download and watch it (and every <a href="http://video.google.com/nba.html">NBA</a> game for the rest of the season) through Google Video.<br /><br />You can play all the videos you download using the all-new Google Video Player. We're especially pleased about the thumbnail navigation for browsing an entire video so you can play any portion with a single click. And there's another thing: if the content is not copy-protected, you can take your favorite videos with you on your <a href="http://www.apple.com/ipod/">iPod</a> or <a href="http://www.us.playstation.com/psp.aspx">PSP</a> -- our "to go" option.<br /><br />Since it's so early in the year, here's a resolution we intend to keep: make sure new features and content continue to roll out, so that you think Google Video is one of the best ways to find video on the web.<br /><br />These video providers are getting us off to a great start:<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=in_label%3Aowner%3Daquarius">Aquarius Health Care Media</a></span>: A leading producer and distributor of healthcare-related videos will pilot with Google Video using a variety of titles covering SIDS, diabetes, and blindness, among other health issues.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=ardustry">Ardustry Home Entertainment</a></span>: Offers substantial libraries of theatrical motion pictures, television series, documentaries and reality programming, music and sports specials, lifestyle titles, and a wide array of “how-to†products.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=bluehighways">BlueHighways TV</a></span>: Programming service that explores the people, stories, traditions and cultures of America. Discovering the sights and sounds of communities across the country with an up-close, laid-back programming style, BlueHighways TV presents a collage of remarkable music, folklore and information for audiences interested in all aspects of American life and heritage. Programming includes <span style="font-style: italic;">Reno's Old Time Music Festival,</span> <span style="font-style: italic;">American Journeys,</span> <span style="font-style: italic;">Stan Hitchcock's Heart to Heart,</span> and <span style="font-style: italic;">Gospel Sampler</span>.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dcaretalk">CareTALK</a></span>: A multimedia brand dedicated to consumer-directed health care offering programming and tools to help modern family caregivers; initially offering 10-20 hours of health and caregiving-related content (10-20 minutes in length).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/cbs.html">CBS</a>: Includes prime time hits such as <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DCSI">CSI</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3Dncis">NCIS</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DSurvivor_Guatemala">Survivor: Guatemala</a>, and The Amazing Race (available spring ’06), as well as classics like <a style="font-style: italic;" href="http://video.google.com/videosearch?q=I+Love+Lucy">I Love Lucy</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DTwilight_Zone">Twilight Zone</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DBrady_Bunch">Brady Bunch</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=Have+Gun+Will+Travel">Have Gun Will Travel</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DMacGyver">MacGyver</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DStar_Trek_Deep_Space_Nine">Star Trek: Deep Space Nine</a>, <a style="font-style: italic;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DStar_Trek_Voyager">Star Trek: Voyager</a>, and My Three Sons (coming soon).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Atvshow%3DCharlie_Rose">The Charlie Rose Show</a>: Includes interviews with Henry Kissinger, Oliver Stone, Quentin Tarantino, Martha Stewart, Martin Scorsese, Harrison Ford, Dan Rather, Charles M. Schulz, Steve Jobs, Jay Leno, Tom Brokaw, and others.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=Cine+Excel&so=0">Cine Excel</a>: Independent producer will trial on Google Video with 3 DVD movie titles: <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=6833548605067650376&q=Cine+Excel">Bikini Hotel </a>(1997), <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=-9198267889833807992&q=Cine+Excel">Tao of Karate</a> (short-film, 1998) and <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=8241854949946868864&q=Cine+Excel">Karate Wars</a> (1998).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=classic+media">Classic Media</a>: Classic Media owns and manages some of the world's most recognizable family properties across all media including feature film, television, home video and consumer products. The company's extensive library features a diverse collection of popular animated and live-action characters. For launch we will have <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=2700527067868455741&q=classic+media">Rocky & Bullwinkle</a>, <span style="font-style: italic;">Casper</span>, <span style="font-style: italic;">Wendy</span>, <span style="font-style: italic;">Richie Rich</span>, <span style="font-style: italic;">Herman & Katnip</span>, <span style="font-style: italic;">Baby Huey</span>, <span style="font-style: italic;">Little Audrey</span>, <a style="font-style: italic;" href="http://video.google.com/videoplay?docid=-3466783103686653836&q=Mighty+Hercules">Mighty Hercules</a>, <span style="font-style: italic;">Little Lulu</span>, and <span style="font-style: italic;">Felix the Cat</span>.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=clearvue">CLEARVUE & SVE</a>: A leading provider of educational K-12 educational video content. They sell DVDs and run a subscription media-on-demand website with video, audio, and images. CLEARVUE & SVE primarily serves large clients such as schools, school districts or entire states. Leveraging Google Video, they have embarked on a new and bold strategy to target individual customers directly. Among the hundreds of videos you will find on Google, topics vary from classic children's literature to detailed explanations about the workings of the human body.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dechelon">Echelon Home Entertainment 2</a></span>: Focuses on independently produced films made by filmmakers from around the world which offer a unique perspective to the traditional genres: drama, action, thriller, comedy, family, animation, classic, B&W, foreign.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dimage_entertainment">Egami Media</a></span>: A subsidiary of Image Entertainment and a leading independent licensee, producer and distributor of home entertainment programming with over 3,000 titles released in North America. Highlighted content in Google Video includes live concert programs include <span style="font-style: italic;">Kiss: Rock the Nation: Live!</span>, <span style="font-style: italic;">Chick Corea: Rendezvous in New York</span>, <span style="font-style: italic;">Roy Orbison: Black & White Night</span>, and dozens more. Other titles include IMAX programs from MacGillivray Freeman, stand-up comedy and independent, foreign and silent film classics.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dfashion_tv">Fashion TV</a>: The only 24 hours a day, 7 days a week fashion, beauty and style TV station worldwide provides glamorous entertainment with emphasis on the latest trends. Google Video content includes fashion show clips and behind the scenes footage from many fashion shows.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dgetty_images">Getty Images' Archive Films Collection</a>: A diverse collection of short clips that capture personalities, moments and eras throughout history -- selected from vintage newsreels and educational film, as well as contemporary news and events from around the world.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dgreencine">GreenCine.com</a>: Feature length independent films, documentaries and classic titles, including works by legendary Polish director Andrzej Wajda (<span style="font-style: italic;">Zemsta</span>) and award-winning actor-director Caveh Zahedi (<span style="font-style: italic;">In the Bathtub of the World</span>).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=HDNet&so=0">HDNet</a>: Co-founded by Mark Cuban, HDNet has agreed to make select original programming from its library available for the launch of Google's first commercial video offering. The programs to be made available come from HDNet's ever growing library of original content including the <span style="font-style: italic;">HDNet World Report</span>, a groundbreaking series featuring news in HD from around the globe; <span style="font-style: italic;">True Music</span>, a popular weekly music series highlighting up-and-coming bands; <span style="font-style: italic;">Higher Definition</span>, a celebrity interview series hosted by Robert Wilonsky; <span style="font-style: italic;">Young, Beautiful and Trying to Make it in Hollywood</span>, following actresses through the hectic process of getting hired in Hollywood; and <span style="font-style: italic;">Deadline</span>, delivering current events and news from around the world from an irreverent point of view.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=heretv">here!</a>: Gay and lesbian U.S. television network featuring original movies and series and film library (independent and foreign films, documentaries and shorts).<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=hollywood+licensing">Hollywood Licensing's HilariousDownloads.com</a></span>: Hollywood Licensing is the entertainment licensing agency which represents the best and most extensive library of hilarious videos in the world. Tapping into a library boasting tens of thousands of clips, they have custom produced 20 packages of funny themes a celebrity interview series hosted by Robert Wilonsky; <span style="font-style: italic;">Young, Beautiful and Trying to Make it in Hollywood</span>, following actresses through the hectic process of getting hired in Hollywood; and <span style="font-style: italic;">Deadline</span>, delivering current events and news from around the world from an irreverent point of view.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=heretv">here!</a>: Gay and lesbian U.S. television network featuring original movies and series and film library (independent and foreign films, documentaries and shorts).<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=hollywood+licensing">Hollywood Licensing's HilariousDownloads.com</a></span>: Hollywood Licensing is the entertainment licensing agency which represents the best and most extensive library of hilarious videos in the world. Tapping into a library boasting tens of thousands of clips, they have custom produced 20 packages of funny themes for Google Video. For example, if you think that your recent home improvements was nothing but a miserable experience, wait until you see a bucket of wet plaster land on a man's face, a house collapsing or a door falling of its hinges for no particular reason.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Aowner%3Ditn">ITN</a>: One of the world's leading news producers, providing news programming for the main commercial broadcasters in the U.K. and its combined news broadcasts reach over two-thirds of the U.K. population. The company has a strong reputation for the creative and innovative use of modern technology, winning the Royal Television Society's 2004 Innovation Award.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Aowner%3Diwatchnow">iWatchNow.com</a>: Titles include Night of the Living Dead (George Romero), The Chronicles of Narnia: The Lion, Witch, and the Wardrobe (original animated film BBC from1979), The Man Who Knew Too Much (Hitchcock), the hard-to-find Comedy's Dirtiest Dozen (with Chris Rock and Tim Allen), and The Little Shop of Horrors (1960).<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=kantola&so=0">Kantola Productions</a>: Captures unique speaking events given by well-known experts at Stanford University. Topics focus on innovative and practical business advice, such as How Leaders Boost Productivity by John H. (Jack) Zenger and <span style="font-style: italic;">Mastery of Speaking as a Leader</span> by Terry Pearce.<br /><br />• <span style="font-weight: bold;"><a href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dlime">LIME</a></span>: “Healthy Living with a Twist†offers entertaining and revealing programming focused on a greener, healthier, more balanced lifestyle. Programming features inspiration from leading experts, authors, and pop culture icons and covers topics including the environment and sustainability, personal growth, alternative health, healthy foods, and business ethics.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=mediazone.com&so=0">MediaZone.com</a>: Programming covers sporting events, TV episodes, movies, how-to programs. Content includes <span style="font-style: italic;">The Rugby Channel presents ‘The Best Tries of 2004’</span> and <span style="font-style: italic;">The All Blacks of New Zealand Vs. Springboks of South Africa</span>.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dtwi+nobel">Nobel Video Library</a>: A library focused on the achievements of individual Nobel Laureate. The series was developed to introduce students to the work of the laureates as well as to support classroom discussion regarding important issues addressed by Nobel Prize winners in recent decades.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=open+championship&so=0">Open Championship</a>: Official programs from the classic golf tournament, the British Open, such as<span style="font-style: italic;"> </span><span style="font-style: italic;">Reflections: Past Open Champions</span>.<br /><br />•<a style="font-weight: bold;" href="http://video.google.com/videosearch?q=plum+tv"> Plum TV</a>: Provides highly localized programming to the nation’s most influential consumers, and strives to be an incubator of groundbreaking new television programming. Each Plum TV station shares branding which links each station as a network, but still provides original programming customized to reflect each community. Plum TV’s programming includes regionally-focused feature pieces, tourist information (weather, traffic reports, restaurant reviews, retail and lodging information), a real estate show, local news and specially targeted entertainment for each community’s interests.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=porchlight+entertainment">PorchLight Entertainment</a>: Porchlight produces family-oriented motion pictures and TV specials. Google Video will offer 36 titles including <span style="font-style: italic;">Enough Already</span> and <span style="font-style: italic;">Role of a Lifetime</span>.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=SOFA+Entertainment&so=0">SOFA Entertainment</a>: Represents pop culture at its best. Featuring several titles from the classic <span style="font-style: italic;">The Ed Sullivan Show</span> along with documentaries, feature films and music programming. SOFA Entertainment truly offers something for everyone. Some highlights include <span style="font-style: italic;">The Very Best of The Ed Sullivan Show - Vol. 1 & Vol. 2.</span><br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=Sony+BMG">SONY BMG MUSIC ENTERTAINMENT</a>: The lineup of launch videos includes offerings from some of SONY BMG's largest global superstar artists, including Christina Aguilera, Beyonce, Kenny Chesney, Destiny's Child, Kelly Clarkson, Alicia Keys, Lil' Flip, Jessica Simpson, Shakira, System of a Down, Switchfoot, Usher, and many more.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=Tai+Seng&so=0">Tai Seng Entertainment</a>: The definitive Asian cinema powerhouse. Known as the best source for Hong Kong films, Tai Seng also releases cinematic masterpieces from all over the Asia region in a variety of languages. Tai Seng brings to your home the best in class from high-octane action to bone-crushing martial arts, from chilling horror to lush swordplay epics. We are proud to showcase with Google some of Asia's biggest hits like Johnnie To's <span style="font-style: italic;">Running On Karma</span>, Korea's sensuously emotional drama <span style="font-style: italic;">Addicted</span>, martial arts Master Yuen Wo Ping's highly acclaimed <span style="font-style: italic;">Tai Chi Master</span>, and Michelle Yeoh's violently elegant <span style="font-style: italic;">Butterfly Sword</span>.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=Teen+Kids+news">Teen Kids News</a>: A dynamic television news program for teens and pre-teens, by teens. The half-hour weekly program provides 10 eyewitness news segments to students in a way that's educational as well as entertaining. Thirty shows with kids reporting on camera are available on Google Video.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=Trinity+Broadcasting+&so=0">Trinity Broadcasting Network</a>: The world's largest religious network and America's most watched faith channel, TBN offers 24 hours of commercial-free inspirational programming that appeal to people in a wide variety of Protestant, Catholic and Messianic Jewish denominations. <span style="font-style: italic;">The Praise the Lord Program</span> is the only live two-hour Christian program in the world. The program brings the highest caliber of guests from well-known celebrities to laypersons for interview, as well as, singers, musicians, evangelists and the coverage of revivals and crusades from around the world. This award-winning program has been on each week night for over 30 years.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videoplay?docid=8592392906577495616&q=in_label%3Aowner%3Dunion">Union</a>: Offers the best of breed from the world of action sports, including snow, skate, bmx, moto, and surfing. Union is owned by Quiksilver Entertainment, Inc. and Global Media Ventures, LLC.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=wilderness+films+india">WFIL</a>: Wilderness Films India Ltd. is a leading producer and library of stock footage captured in India and across Asia. WFIL will offer 100 hours of high quality video, both free and for sale, on Google Video. Topics vary from helicopter skiing in the Himalaya, broadcast coverage of an Everest climb, and rare wildlife such as the takin and the clouded leopard to imagery spanning India's art, culture, technology, peoples, cities, and rural areas.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=wgbh+boston">WGBH</a>: WGBH Boston is America's preeminent public broadcasting producer, the source of fully one-third of PBS's prime-time lineup, along with some of public television's best-known lifestyle shows and children's programs and many public radio favorites. Programming available includes <span style="font-style: italic;">Nova</span>, <span style="font-style: italic;">La Plaza</span> (the longest running Latino program in the country), <span style="font-style: italic;">Thinking Big</span>, and <span style="font-style: italic;">Basic Black</span>. WGBH is the number one producer of Web sites on pbs.org, one of the most trafficked dot-org Web sites in the world. WGBH is a pioneer in educational multimedia and in technologies and services that make media accessible to the 36 million Americans who rely on captioning or video descriptions. WGBH has been recognized with hundreds of honors: Emmys, Peabodys, duPont-Columbia Awards.even two Oscars. In 2002, WGBH was honored with a special institutional Peabody Award for 50 years of excellence.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=WheelsTV&so=0">WheelsTV</a>: Serves both the general audience and the enthusiast with a wide spectrum of vehicle-based entertainment, news and information. WheelsTV Network, WheelsTV On Demand and WheelsTV.net have been developed by the producers of multi-awarding winning automotive programming for Discovery, PBS, Speedvision, Fox and Outdoor Life Networks including <span style="font-style: italic;">Wild About Wheels</span>, <span style="font-style: italic;">Wheels</span>, and <span style="font-style: italic;">Motor Trend Television</span>. WheelsTV Network’s valuable consumer programs include <span style="font-style: italic;">Top 200™ New Vehicle Test Drives</span>. With <span style="font-style: italic;">Top 200</span> on Google, consumers will be able to download virtual test drives of the best selling and most exciting cars on the road today, saving time and money.<br /><br />• <a style="font-weight: bold;" href="http://video.google.com/videosearch?q=in_label%3Aowner%3Dtwi">Wimbledon</a>: Official programs from the Wimbledon Tennis Championships such as <span style="font-style: italic;">Legends of Wimbledon: Bjorn Borg</span>.
-false
-
-
-
-
-A Googler
-
-2006-01-09T06:27:00-08:00
-2006-01-09T14:30:23Z
-2005-12-18T23:47:55Z
-
-tag:blogger.com,1999:blog-10861780.post-113494967528450491
-The 2006 Anita Borg Scholarships
-
-
-Posted by April Yu, University Programs Team, and Emily Nishi, Diversity Program Manager
-
- The wonderfully-named Dr. Anita Borg (1949 - 2003) was a rebel with a cause: ensuring that technology itself has positive outcomes, and dismantling barriers that keep women and minorities from entering computing and technology fields. Today the Anita Borg Institute for Women and Technology carries on her vision. And because Google shares that passion, we are pleased to sponsor the 2006 Anita Borg Scholarship program. We are inspired by the past scholarship recipients -- and in hopes of finding more, the program is expanded this year to accept applications from students entering their senior year of undergraduate study as well as those enrolled in a graduate program. Last year we awarded 23 scholarships; this year we'd like to do more.
- Tell your friends, or apply yourself - the deadline is January 20.
-
-false
-
-
-
-
-A Googler
-
-2006-01-06T16:51:00-08:00
-2006-01-07T00:54:51Z
-2005-12-31T18:24:44Z
-
-tag:blogger.com,1999:blog-10861780.post-113605348414874975
-Make your computer just work
-<span class="byline-author">Posted by Jesse Savage, Google Pack team</span><br /> <br />So you bought a new PC for yourself or a relative during the holidays. There was the initial excitement about its speed and the nice screen – and then it came time to actually get it running. Which meant embarking on some real work -– downloading a browser, a couple of multimedia players, a PDF reader, a toolbar, and maybe something for voice and instant messaging. Don’t forget the anti-spyware and anti-virus apps – you’ve got to have those. Hours, maybe even days, go by. How many wizards have you clicked through, not to mention license agreements and preference pickers? And then you have to ask: did I get everything? And how am I going to keep all of this up to date?<br /> <br />This was the experience both Sergey and Larry had a year ago. And they’re computer guys, after all. Which led them to ask more of us to make it easier for everyone. So we created the <a href="http://pack.google.com">Google Pack</a> -- a one-stop software package that helps you discover, install, and maintain a wide range of essential PC programs. It’s yours today – and it’s something we hope you find to be painless, easy, and even fun (if computer setup can ever be called that). And it’s free. <br /> <br />We worked with a number of technology companies to identify products that are the best of their type to create <a href="http://www.google.com/support/pack">this suite</a>. (We didn’t pay them, and they aren’t paying us.) For PC users running Windows XP, it downloads in minutes and installs in just a few clicks. There’s only one license agreement – and no wizards. And there’s a new tool called the <a href="http://www.google.com/support/pack/bin/answer.py?answer=30252&topic=8326/">Google Updater</a> that keeps all the software in the Google Pack current. Even if you already have some of the software in the Pack, you can use the Google Updater to update and manage it.<br /> <br />There’s one more thing in the Pack that we think you’ll like. The Pack team asked people what kind of screensavers they like best. They kept saying, “I want my own photos as a screensaver, why can’t I do that?†Good question -- lots of people have trouble with this. So we made the <a href="http://www.google.com/support/pack/bin/answer.py?answer=28076&topic=8315">Google Pack Screensaver</a>, which is the easiest possible way to make your photos into an animated photo collage. And now the question for you is: what will you do with all that time you've saved?
-false
-
-
-
-
-A Googler
-
-2005-12-30T17:18:00-08:00
-2006-01-05T21:52:34Z
-2005-12-31T01:31:39Z
-
-tag:blogger.com,1999:blog-10861780.post-113599269991367646
-A year of Google blogging
-
-
-Posted by Karen Wickre, Google Blog team
-
- This is the 201st post to be published on the Google Blog in 2005. In closing out the first full year of our company-wide effort to share news and views, we thought you might be interested in a few factoids. Since we've had Google Analytics running on this blog since June, some of these numbers reflect only half a year. In that time, 4.3 million unique visitors have generated 8.7 million pageviews. Readers have come from all over the world, not just English-speaking countries: 53,001 visitors from Turkey have stopped by, for example; so have 155,691 from France, 29,614 from Thailand and 8,233 from Peru.
- The most popular posts? Here are a few that have yielded scores of backlinks:
During the year, we've published 38 how-to tips, announced 77 new products and services, and addressed policy questions and legal matters 17 times. We've featured 11 guest bloggers. Forty posts have illuminated something about day to day life at Google; 19 have offered some international perspective.
In 2006, we'll keep up the Google Blog with more posts, more bloggers, and even more topics. Meanwhile, we really appreciate your interest and feedback, now visible through "Links to this post." We know some of you would like to offer comments directly, and we would like that too, when we can add resources to the blog crew. Meanwhile, our best to you and yours for the New Year.
-
-false
-
-
diff --git a/tests/Zend/Feed/_files/AtomTestMozillazine.xml b/tests/Zend/Feed/_files/AtomTestMozillazine.xml
deleted file mode 100644
index 2fa18ece5c..0000000000
--- a/tests/Zend/Feed/_files/AtomTestMozillazine.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
- mozillaZine.org
-
- 2006-01-23T04:04:45-08:00
- Your Source for Daily Mozilla News and Advocacy
- tag:mozillazine.org,2004:1
- Copyright (c) 2004, The Mozillazine Organization
-
- Minutes of the mozilla.org Staff Meeting of Monday 9th January 2006
-
- 2006-01-22T20:04:42-08:00
- 2006-01-22T20:04:42-08:00
- 2006-01-22T20:04:42-08:00
- tag:mozillazine.org,2004:article7935
-
- mozillaZine.org
-
-
- The minutes of the mozilla.org staff meeting held on Monday 9th January 2006 are now online. Issues discussed include Firefox 1.5.0.1 release schedule, Thunderbird 1.5 release and Marketing.]]>
- Talkback]]>
-
-
-
-
- Minutes of the mozilla.org Staff Meeting of Wednesday 4th January 2006
-
- 2006-01-12T09:29:47-08:00
- 2006-01-12T09:29:47-08:00
- 2006-01-12T09:29:47-08:00
- tag:mozillazine.org,2004:article7895
-
- mozillaZine.org
-
-
- The minutes of the mozilla.org staff meeting held on Wednesday 4th January 2006 are now available. Issues discussed include Upcoming Releases, Marketing, Thunderbird, 1.9 Roadmap, Firefox 2 Process and Calendar.
-
The minutes have been posted to the new mozilla.dev.general newsgroup, which is accessible via news.mozilla.org. The previously announced newsgroup migration is in progress. Once mozilla.dev.planning is created, minutes will be posted there.
]]>
- Talkback]]>
-
-
-
-
- Thunderbird 1.5 Released
-
- 2006-01-11T18:19:13-08:00
- 2006-01-11T18:19:13-08:00
- 2006-01-11T18:19:13-08:00
- tag:mozillazine.org,2004:article7892
-
- mozillaZine.org
-
-
- Scott MacGregor writes: "The final release of Mozilla Thunderbird 1.5 is now available for download from getthunderbird.com. Users of RC1 should see the update soon. If you are using RC2, then you already have 1.5 final."
-
"Thunderbird 1.5 introduces several new features including a software update system, spell check as you type, built in phishing detector, auto save as draft, and support for deleting attachments from email messages. Message filtering has also been improved with new filter actions for replying and forwarding. Saved search folders can now search folders across multiple accounts."
"I wanted to thank everyone in the mozillaZine community who helped test the alphas, the betas, and the release candidates that went into this release. Thank you for trusting Thunderbird with your email throughout the development and release cycle for 1.5. I'm looking forward to working with all of you on 2.0 and beyond!"
]]>
- Talkback]]>
-
-
-
-
- Firefox Smoketest Day Planned for January 6, 2006
-
- 2006-01-04T14:14:20-08:00
- 2006-01-04T14:14:20-08:00
- 2006-01-04T14:14:20-08:00
- tag:mozillazine.org,2004:article7859
-
- mozillaZine.org
-
-
- The Mozilla QA team has announced a community test day with focus on smoketesting nightly Firefox 1.5.0.1 builds.
-
Litmus tool will be used for this testing event. There is a FAQ posted on the QA community wiki that will have specific instructions on how this testing day will run.
]]>
- Talkback]]>
-
-
-
-
- Camino 1.0 Beta 2 Released
-
- 2006-01-02T15:23:18-08:00
- 2006-01-02T15:23:18-08:00
- 2006-01-02T15:23:18-08:00
- tag:mozillazine.org,2004:article7850
-
- mozillaZine.org
-
-
- Camino 1.0 beta 2 has been released. This latest version of the native Mac OS X browser is replacing 0.8.4 as the stable Camino release on all systems 10.2+. See the Camino 1.0 Beta 2 Release Notes for more details.]]>
- Talkback]]>
-
-
-
-
- Mozilla Newsgroups Migration Scheduled
-
- 2006-01-02T15:07:27-08:00
- 2006-01-02T15:07:27-08:00
- 2006-01-02T15:07:27-08:00
- tag:mozillazine.org,2004:article7849
-
- mozillaZine.org
-
-
- Frank Wein has announced that the migration and reorganization of Mozilla newsgroups will take place in January 2006. As announced earlier, the new newsgroups will be hosted by Giganews. Access to the news server news.mozilla.org will remain free. The new groups will only be propogated to news.mozilla.org, Giganews Servers and Google Groups in an effort to combat news spam. For more information, refer to the FAQ and the list of new newsgroups.
-]]>
- Talkback]]>
-
-
-
-
- Mozilla Thunderbird 1.5 Release Candidate 2 Available
-
- 2005-12-21T13:58:07-08:00
- 2005-12-21T13:58:07-08:00
- 2005-12-21T13:58:07-08:00
- tag:mozillazine.org,2004:article7823
-
- mozillaZine.org
-
-
- Scott MacGregor writes: "The second release candidate of Mozilla Thunderbird 1.5 is now available for download. Mozilla Thunderbird 1.5 RC2 is intended to allow testers to ensure that there are no last-minute problems with the Thunderbird 1.5 code. "
-
"RC2 contains several key bug fixes that were identified during the RC1 testing cycle. There are no new features or enchancements from RC1. Users of Thunderbird 1.5 RC1 will be offered RC 2 through the software update system."
"I'd like to single out all of the folks who participated in our QA testing day and our localization testing day. We wouldn't have been able to release RC2 before the holidays without all the volunteers who pitched in. Thank you!"
]]>
- Talkback]]>
-
-
-
-
- Interview with Mike Beltzner
-
- 2005-12-20T23:00:29-08:00
- 2005-12-20T23:00:29-08:00
- 2005-12-20T23:00:29-08:00
- tag:mozillazine.org,2004:article7820
-
- mozillaZine.org
-
-
- David Tenser has posted an interview with Mozilla Foundation's User Experience Lead, Mike Beltzner. The interview was conducted over instant messaging sessions during the last week of November. Mike talks about usability studies, design of the Mozilla Developer Central, and the new bookmark system planned for Firefox 2.]]>
- Talkback]]>
-
-
-
-
- Gecko 1.9 Trunk and 1.8 Branch Management Plan Posted
-
- 2005-12-20T18:08:36-08:00
- 2005-12-20T18:08:36-08:00
- 2005-12-20T18:08:36-08:00
- tag:mozillazine.org,2004:article7819
-
- mozillaZine.org
-
-
- Brendan Eich has posted a draft plan for Gecko 1.9 Trunk and 1.8 Branch Management, including a FAQ at the mozilla wiki. Comments should be directed as followups to the newsgroup post.
-]]>
- Talkback]]>
-
-
-
-
- Minutes of the mozilla.org Staff Meeting of Monday 12th December 2005
-
- 2005-12-20T18:04:08-08:00
- 2005-12-20T18:04:08-08:00
- 2005-12-20T18:04:08-08:00
- tag:mozillazine.org,2004:article7818
-
- mozillaZine.org
-
-
- The minutes of the mozilla.org staff meeting held on Monday 12th December 2005 are now online. Issues discussed include Firefox Summit, Engineering, Upgrading, Awards and Newsgroups reorganisation]]>
- Talkback]]>
-
-
-
-
- Minutes of the mozilla.org Staff Meeting of Monday 5th December 2005
-
- 2005-12-20T18:02:08-08:00
- 2005-12-20T18:02:08-08:00
- 2005-12-20T18:02:08-08:00
- tag:mozillazine.org,2004:article7817
-
- mozillaZine.org
-
-
- The minutes of the mozilla.org staff meeting held on Monday 5th December 2005 are now online. Issues discussed include Firefox Summit and Engineering.]]>
- Talkback]]>
-
-
-
-
- SeaMonkey 1.0 Beta Released
-
- 2005-12-20T17:41:12-08:00
- 2005-12-20T17:41:12-08:00
- 2005-12-20T17:41:12-08:00
- tag:mozillazine.org,2004:article7815
-
- mozillaZine.org
-
-
- Robert Kaiser writes: "Today, the SeaMonkey Council announces a new developer release, SeaMonkey 1.0 Beta. Compared to the Alpha version released in September, SeaMonkey 1.0 Beta enhances the product with new features like tab drag and drop, but also is the first release branded with the new SeaMonkey logo, which was unveiled earlier this month."
-
- Here are some fundamental, well made JS goodies: Vectorgraphics Library, Drag'nDrop & DHTML Library, Tooltips with JavaScript Lib, and Rotate Image Lib. A pleasure to work with, and LGPL'ed. Also check out the JS Online Function Grapher.
-
- There's been a lot of talk about the revolutionary change Web 2.0 promises, and it's time to look at the architecture that's leading to that change: a greater split between client and server logic.
-
-
- Simon St. Laurent
- 2006-01-23T08:15:34-08:00
-
-
-
- Don't Give us your Tired Your Poor
- http://www.oreillynet.com/pub/wlg/9083
-
-
-
- Give us your vibrant, exciting, cool, open source Java submissions for this year's OSCON.
-
-
- Daniel H. Steinberg
- 2006-01-23T07:45:36-08:00
-
-
-
- Cutting Through the Patent Thicket
- http://www.oreillynet.com/pub/wlg/9082
-
-
-
- Good succinct summary of the anti-patent argument, including how VC's look at patents and get duped by them.
-
-
- Damien Stolarz
- 2006-01-23T00:45:30-08:00
-
-
-
- The addslashes() Versus mysql_real_escape_string() Debate
- http://www.oreillynet.com/pub/wlg/9081
-
-
-
- Fedora's yum/rpm system includes a little-known capability: it can rollback a system to a previously-installed state.
-
-
- Chris Tyler
- 2006-01-22T13:15:12-08:00
-
-
-
- Shifting Gears: Switching to Django
- http://www.oreillynet.com/pub/wlg/9075
-
-
-
- I've been using TurboGears since its public debut around September of last year. I believe it has incredible potential, but I'm finding myself needing something a little different. That something is Django.
-
-
- Jeremy Jones
- 2006-01-22T12:15:19-08:00
-
-
-
- Are We In A Productivity Crisis?
- http://www.oreillynet.com/pub/wlg/9079
-
-
-
- Are we in a new kind of productivity crisis, one in which there is not too little productivity, but too much?
-
-
- Spencer Critchley
- 2006-01-22T09:45:58-08:00
-
-
-
- What Happens When You Edit an Image Stored Outside of iPhoto 6
- http://www.oreillynet.com/pub/wlg/9078
-
-
-
- Is the edited image stored inside or outside of your iPhoto 6 library?
-
-
- Derrick Story
- 2006-01-22T07:45:58-08:00
-
-
-
- Building emacs22 on Mac OS X
- http://www.oreillynet.com/pub/wlg/9074
-
-
-
- Emacs 22 is Mac OS X aware, and can be built either as a Carbon .app double-clickable, or as a typical X11 program. Problem is, the information about how to build it is pretty scattered. Here's what works for me.
-
-
- Chris Adamson
- 2006-01-21T19:45:53-08:00
-
-
-
- hip to bash web2.0, are we?
- http://www.oreillynet.com/pub/wlg/9034
-
-
-
- It's hip to take some "diggs" at Web 2.0.
-
-
- Timothy M. O'Brien
- 2006-01-21T15:46:26-08:00
-
-
-
- My New Game Development Course at Tufts
- http://www.oreillynet.com/pub/wlg/9076
-
-
-
- I am teaching a new course at the Tufts University, "Introduction to Game Development," this semester.
-
-
- Ming Chow
- 2006-01-21T12:46:56-08:00
-
-
-
- Tune in to Radio Babylon
- http://www.oreillynet.com/pub/wlg/9073
-
-
-
- Hardware hacks we'd like to see in iPods, #1
-
-
- Giles Turnbull
- 2006-01-20T14:15:54-08:00
-
-
-
- A resource for Google maphacks and mashers now at Maphacks,net
- http://www.oreillynet.com/pub/wlg/9072
-
-
-
-
-
-
- Glenn Letham
- 2006-01-20T12:16:05-08:00
-
-
-
- UK film studio on the hunt for Google earth programmers
- http://www.oreillynet.com/pub/wlg/9071
-
-
-
-
-
-
- Glenn Letham
- 2006-01-20T11:47:03-08:00
-
-
-
-
diff --git a/tests/Zend/Feed/_files/AtomTestPlanetPHP.xml b/tests/Zend/Feed/_files/AtomTestPlanetPHP.xml
deleted file mode 100644
index 762f01010d..0000000000
--- a/tests/Zend/Feed/_files/AtomTestPlanetPHP.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-Planet PHPPeople blogging about PHPhttp://www.planet-php.net/
- Planet PHP Aggregator
- 2006-01-23T16:40:00ZeZ components in Gentoo LinuxSebastian Bergmannhttp://www.sebastian-bergmann.de/blog/archives/565-guid.html2006-01-23T16:40:00Z2006-01-23T16:40:00ZeZ components, which provide an enterprise ready general purpose PHP platform, are now available through Gentoo Linux's portage system:
wopr-mobile ~ # emerge -vp ezc-eZcomponents
-
-These are the packages that I would merge, in order:
-
-Calculating dependencies ...done!
-[ebuild N ] app-admin/php-toolkit-1.0-r2 0 kB
-[ebuild N ] dev-lang/php-5.1.2 0 kB [3]
-[ebuild N ] dev-php/PEAR-PEAR-1.4.6 0 kB [2]
-[ebuild N ] dev-php5/ezc-Base-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Database-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-PhpGenerator-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Configuration-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-ImageAnalysis-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Archive-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Translation-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Cache-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-ConsoleTools-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-PersistentObject-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-ImageConversion-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Mail-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-UserInput-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Debug-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-EventLog-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Execution-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-eZcomponents-1.0_rc1 0 kB [2]
-
-Total size of downloads: 0 kB
-Portage overlays:
- [1] /usr/local/overlay/personal
- [2] /usr/local/overlay/cvs
- [3] /usr/local/overlay/php/testing
- [4] /usr/local/overlay/php/experimental
- [5] /usr/local/overlay/gentopia
- [6] /usr/local/overlay/xgl
- ]]>PHP InsecurityChris Shifletthttp://shiflett.org/archive/1852006-01-23T16:15:00Z2006-01-23T16:15:00ZAndrew van der Stock has written a strong criticism of PHP's insecurity. Andrew is a seasoned security expert and a major contributor to OWASP, and he states:
-
After writing PHP forum software for three years now, I've come to the conclusion that it is basically impossible for normal programmers to write secure PHP code. It takes far too much effort.
-
He continues, citing specific areas where he thinks PHP is weak and asserting that "PHP must now mature and take on a proper security architecture."
-
Many of the insecure features he cites (register_globals, magic_quotes_gpc, and safe_mode) are slated to be removed in PHP 6, but his core complaint seems to revolve around the fact that PHP makes too much power too easily accessible, often granting developers more power and flexibility than they realize (e.g., wrappers).
-
Aside from minor language features like taint mode, I don't see what other platforms offer to help prevent inexperienced developers from writing insecure code. Anyone care to enlighten me? :-)
]]>Beta release of mobile webmail client (MIMP)Horde Newshttp://janschneider.de/cweb/home/index,channel,25,story,255.html2006-01-23T10:01:00Z2006-01-23T10:01:00ZMeet me at php|tekThinkPHP /dev/blog - PHPhttp://blog.thinkphp.de/archives/81-guid.html2006-01-22T22:34:00Z2006-01-22T22:34:00Zphp|tek, the next conference from the php|arch
-guys around Marco Tabini who already organized the php|cruise and php|tropics
-conferences, will be from April 26th to 28th at Orlando, Florida. As
-you can read on the recently published schedule
-I'll hold two talks. The first talk will be about PHP on the command
-line, showing PHP's strength beyond the web which can be helpful to
-build, deploy and scale your web-application and even for building apps
-completely independent from anything on the web. My second talk will be
-about PHP's reflection API. In that session I'll give an introduction
-into the API and show how to use it to build modular, dynamic
-applications.
-
If you're in reachable distance you should take the chance to listen and meet PHP developers from all over the world. (Hint: Till January 31st you can get early-bird rates!)
johannes
]]>Quick LookupJohn Coxhttp://wyome.com/index.php?module=articles&func=display&ptid=10&catid=29-31&aid=5072006-01-22T19:23:00Z2006-01-22T19:23:00ZQuick lookup is a very nice little reference tool for lookups of web development documentation. It installs as a simple bookmark which can be changed to your sidebar for look ups of php / css / javascript / mysql documentation. It has a limited scope of features (which isn't a bad thing in my mind):
-
* Multiple tabs
-* PHP / MySQL / CSS / JS reference (MySQL is 55% complete)
-* Examples
-* Search as you type
-* Fast results
-* Remembers your last tab on your revisit
-* Access keys, [alt + (p, m, j, c)]
-
-
I did a cursory install, and it appears to be pretty fast. I think it might be better as part of the Web Developer Extension for Firefox, but as is, I can see the uses.
- ]]>mysql_real_escape_string() versus Prepared StatementsIlia Alshanetskyhttp://ilia.ws/archives/103-guid.html2006-01-22T18:03:00Z2006-01-22T18:03:00ZChris has written a compelling piece about how the use of addslashes() for string escaping in MySQL queries can lead to SQL injection through the abuse of multibyte character sets. In his example he relies on addslashes() to convert an invalid multibyte sequence into a valid one, which also has an embedded ' that is not escaped. And in an ironic twist, the function intended to protect against SQL injection is used to actually trigger it.
-The problem demonstrated, actually goes a bit further, which even makes the prescribed escaping mechanism, mysql_real_escape_string() prone to the same kind of issues affecting addslashes(). The main advantage of the mysql_real_escape_string() over addslashes() lies in the fact that it takes character set into account and thus is able to determine how to properly escape the data. For example, if GBK character set is being used, it will not convert an invalid multibyte sequence 0xbf27 (¿’) into 0xbf5c27 (¿\’ or in GBK a single valid multibyte character followed by a single quote). To determine the proper escaping methodology mysql_real_escape_string() needs to know the character set used, which is normally retrieved from the database connection cursor. Herein lies the “trick”. In MySQL there are two ways to change the character set, you can do it by changing in MySQL configuration file (my.cnf) by doing:
CODE:
[client]
-default-character-set=GBK
-Or you can change on a per-connection basis, which is a common practice done by people without admin level access to the server via the following query:
CODE:
SETÂ CHARACTERÂ SETÂ 'GBK'
-The problem with the latter, is that while it most certainly modified the charset it didnÂ’t let the escaping facilities know about it. Which means that mysql_real_escape_string() still works on the basis of the default charset, which if set to latin1 (common default) will make the function work in a manner identical to addslashes() for our purposes. Another word, 0xbf27 will be converted to 0xbf5c27 facilitating the SQL injection. Here is a brief proof of concept.
Truncated by Planet PHP, read more at the original (another 2694 bytes)
]]>The addslashes() Versus mysql_real_escape_string() DebateChris Shifletthttp://shiflett.org/archive/1842006-01-22T04:15:00Z2006-01-22T04:15:00ZLast month, I discussed Google's XSS Vulnerability and provided an example that demonstrates it. I was hoping to highlight why character encoding consistency is important, but apparently the addslashes() versus mysql_real_escape_string() debate continues. Demonstrating Google's XSS vulnerability was pretty easy. Demonstrating an SQL injection attack that is immune to addslashes() is a bit more involved, but still pretty straightforward.
-
In GBK, 0xbf27 is not a valid multi-byte character, but 0xbf5c is. Interpreted as single-byte characters, 0xbf27 is 0xbf (¿) followed by 0x27 ('), and 0xbf5c is 0xbf (¿) followed by 0x5c (\).
-
How does this help? If I want to attempt an SQL injection attack against a MySQL database, having single quotes escaped with a backslash is a bummer. If you're using addslashes(), however, I'm in luck. All I need to do is inject something like 0xbf27, and addslashes() modifies this to become 0xbf5c27, a valid multi-byte character followed by a single quote. In other words, I can successfully inject a single quote despite your escaping. That's because 0xbf5c is considered to be a single character, not two. Oops, there goes the backslash.
-
I'm going to use MySQL 5.0 and PHP's mysqli extension for this demonstration. If you want to try this yourself, make sure you're using GBK. I just changed /etc/my.cnf, but that's because I'm testing locally:
-
[client]
-default-character-set=GBK
-
Create a table called users:
-
CREATE TABLE users
-(
- username VARCHAR(32) CHARACTER SET GBK,
- password VARCHAR(32) CHARACTER SET GBK,
- PRIMARY KEY (username)
-);
-
-
The following script mimics a situation where only addslashes() is used to escape the data being used in a query:
$_POST['username'] = chr(0xbf) .                      chr(0x27) .                      ' OR username = username /*'; $_POST['password'] = 'guess';
Truncated by Planet PHP, read more at the original (another 4165 bytes)
]]>PHP ConferencesJason E. Sweathttp://blog.casey-sweat.us/?p=692006-01-22T04:04:00Z2006-01-22T04:04:00ZBack from NorwayTobias Schlitthttp://www.schlitt.info/applications/blog/index.php?/archives/407-guid.html2006-01-22T00:30:00Z2006-01-22T00:30:00ZNorway is a somewhat strange country. When I got there - 2 weeks ago to work with Amos, Derick, Fred and Ray on the eZ components - it had the expected amount of snow. A few days later, there was nothing anymore. We had positive celsius values and the weather was really crappy... until Monday. Since then it has been snowing all the time and yesterday we left when it looked like this:
-
-
-
-
Nice to watch, but not real fun to walk onto. :) Anyway, it's been another great stay in Skien, where the eZ headquarter is and I'm pretty much looking forward to our summer conference, where we plan to have the complete eZ team there and lots of people from the PHP world. Thanks for the great time, folks!
wopr-mobile ~ # emerge -vp ezc-eZcomponents
-
-These are the packages that I would merge, in order:
-
-Calculating dependencies ...done!
-[ebuild N ] app-admin/php-toolkit-1.0-r2 0 kB
-[ebuild N ] dev-lang/php-5.1.2 0 kB [3]
-[ebuild N ] dev-php/PEAR-PEAR-1.4.6 0 kB [2]
-[ebuild N ] dev-php5/ezc-Base-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Database-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-PhpGenerator-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Configuration-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-ImageAnalysis-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Archive-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Translation-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Cache-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-ConsoleTools-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-PersistentObject-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-ImageConversion-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Mail-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-UserInput-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Debug-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-EventLog-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-Execution-1.0_rc1 0 kB [2]
-[ebuild N ] dev-php5/ezc-eZcomponents-1.0_rc1 0 kB [2]
-
-Total size of downloads: 0 kB
-Portage overlays:
- [1] /usr/local/overlay/personal
- [2] /usr/local/overlay/cvs
- [3] /usr/local/overlay/php/testing
- [4] /usr/local/overlay/php/experimental
- [5] /usr/local/overlay/gentopia
- [6] /usr/local/overlay/xgl
- ]]>PHP Insecurity - Chris Shifletthttp://shiflett.org/archive/185Mon, 23 Jan 2006 16:15:56 +0000Andrew van der Stock has written a strong criticism of PHP's insecurity. Andrew is a seasoned security expert and a major contributor to OWASP, and he states:
-
After writing PHP forum software for three years now, I've come to the conclusion that it is basically impossible for normal programmers to write secure PHP code. It takes far too much effort.
-
He continues, citing specific areas where he thinks PHP is weak and asserting that "PHP must now mature and take on a proper security architecture."
-
Many of the insecure features he cites (register_globals, magic_quotes_gpc, and safe_mode) are slated to be removed in PHP 6, but his core complaint seems to revolve around the fact that PHP makes too much power too easily accessible, often granting developers more power and flexibility than they realize (e.g., wrappers).
-
Aside from minor language features like taint mode, I don't see what other platforms offer to help prevent inexperienced developers from writing insecure code. Anyone care to enlighten me? :-)
]]>Beta release of mobile webmail client (MIMP) - Horde Newshttp://janschneider.de/cweb/home/index,channel,25,story,255.htmlMon, 23 Jan 2006 10:01:16 +0000Meet me at php|tek - ThinkPHP /dev/blog - PHPhttp://blog.thinkphp.de/archives/81-Meet-me-at-phptek.htmlSun, 22 Jan 2006 22:34:00 +0000php|tek, the next conference from the php|arch
-guys around Marco Tabini who already organized the php|cruise and php|tropics
-conferences, will be from April 26th to 28th at Orlando, Florida. As
-you can read on the recently published schedule
-I'll hold two talks. The first talk will be about PHP on the command
-line, showing PHP's strength beyond the web which can be helpful to
-build, deploy and scale your web-application and even for building apps
-completely independent from anything on the web. My second talk will be
-about PHP's reflection API. In that session I'll give an introduction
-into the API and show how to use it to build modular, dynamic
-applications.
-
If you're in reachable distance you should take the chance to listen and meet PHP developers from all over the world. (Hint: Till January 31st you can get early-bird rates!)
johannes
]]>Quick Lookup - John Coxhttp://wyome.com/index.php?module=articles&func=display&ptid=10&catid=29-31&aid=507Sun, 22 Jan 2006 19:23:31 +0000Quick lookup is a very nice little reference tool for lookups of web development documentation. It installs as a simple bookmark which can be changed to your sidebar for look ups of php / css / javascript / mysql documentation. It has a limited scope of features (which isn't a bad thing in my mind):
-
* Multiple tabs
-* PHP / MySQL / CSS / JS reference (MySQL is 55% complete)
-* Examples
-* Search as you type
-* Fast results
-* Remembers your last tab on your revisit
-* Access keys, [alt + (p, m, j, c)]
-
-
I did a cursory install, and it appears to be pretty fast. I think it might be better as part of the Web Developer Extension for Firefox, but as is, I can see the uses.
- ]]>mysql_real_escape_string() versus Prepared Statements - Ilia Alshanetskyhttp://ilia.ws/archives/103-mysql_real_escape_string-versus-Prepared-Statements.htmlSun, 22 Jan 2006 18:03:59 +0000Chris has written a compelling piece about how the use of addslashes() for string escaping in MySQL queries can lead to SQL injection through the abuse of multibyte character sets. In his example he relies on addslashes() to convert an invalid multibyte sequence into a valid one, which also has an embedded ' that is not escaped. And in an ironic twist, the function intended to protect against SQL injection is used to actually trigger it.
-The problem demonstrated, actually goes a bit further, which even makes the prescribed escaping mechanism, mysql_real_escape_string() prone to the same kind of issues affecting addslashes(). The main advantage of the mysql_real_escape_string() over addslashes() lies in the fact that it takes character set into account and thus is able to determine how to properly escape the data. For example, if GBK character set is being used, it will not convert an invalid multibyte sequence 0xbf27 (¿’) into 0xbf5c27 (¿\’ or in GBK a single valid multibyte character followed by a single quote). To determine the proper escaping methodology mysql_real_escape_string() needs to know the character set used, which is normally retrieved from the database connection cursor. Herein lies the “trick”. In MySQL there are two ways to change the character set, you can do it by changing in MySQL configuration file (my.cnf) by doing:
CODE:
[client]
-default-character-set=GBK
-Or you can change on a per-connection basis, which is a common practice done by people without admin level access to the server via the following query:
CODE:
SETÂ CHARACTERÂ SETÂ 'GBK'
-The problem with the latter, is that while it most certainly modified the charset it didnÂ’t let the escaping facilities know about it. Which means that mysql_real_escape_string() still works on the basis of the default charset, which if set to latin1 (common default) will make the function work in a manner identical to addslashes() for our purposes. Another word, 0xbf27 will be converted to 0xbf5c27 facilitating the SQL injection. Here is a brief proof of concept.
Truncated by Planet PHP, read more at the original (another 2694 bytes)
]]>The addslashes() Versus mysql_real_escape_string() Debate - Chris Shifletthttp://shiflett.org/archive/184Sun, 22 Jan 2006 04:15:58 +0000Last month, I discussed Google's XSS Vulnerability and provided an example that demonstrates it. I was hoping to highlight why character encoding consistency is important, but apparently the addslashes() versus mysql_real_escape_string() debate continues. Demonstrating Google's XSS vulnerability was pretty easy. Demonstrating an SQL injection attack that is immune to addslashes() is a bit more involved, but still pretty straightforward.
-
In GBK, 0xbf27 is not a valid multi-byte character, but 0xbf5c is. Interpreted as single-byte characters, 0xbf27 is 0xbf (¿) followed by 0x27 ('), and 0xbf5c is 0xbf (¿) followed by 0x5c (\).
-
How does this help? If I want to attempt an SQL injection attack against a MySQL database, having single quotes escaped with a backslash is a bummer. If you're using addslashes(), however, I'm in luck. All I need to do is inject something like 0xbf27, and addslashes() modifies this to become 0xbf5c27, a valid multi-byte character followed by a single quote. In other words, I can successfully inject a single quote despite your escaping. That's because 0xbf5c is considered to be a single character, not two. Oops, there goes the backslash.
-
I'm going to use MySQL 5.0 and PHP's mysqli extension for this demonstration. If you want to try this yourself, make sure you're using GBK. I just changed /etc/my.cnf, but that's because I'm testing locally:
-
[client]
-default-character-set=GBK
-
Create a table called users:
-
CREATE TABLE users
-(
- username VARCHAR(32) CHARACTER SET GBK,
- password VARCHAR(32) CHARACTER SET GBK,
- PRIMARY KEY (username)
-);
-
-
The following script mimics a situation where only addslashes() is used to escape the data being used in a query:
$_POST['username'] = chr(0xbf) .                      chr(0x27) .                      ' OR username = username /*'; $_POST['password'] = 'guess';
Truncated by Planet PHP, read more at the original (another 4165 bytes)
]]>PHP Conferences - Jason E. Sweathttp://blog.casey-sweat.us/?p=69Sun, 22 Jan 2006 04:04:14 +0000Back from Norway - Tobias Schlitthttp://www.schlitt.info/applications/blog/index.php?/archives/407-Back-from-Norway.htmlSun, 22 Jan 2006 00:30:57 +0000Norway is a somewhat strange country. When I got there - 2 weeks ago to work with Amos, Derick, Fred and Ray on the eZ components - it had the expected amount of snow. A few days later, there was nothing anymore. We had positive celsius values and the weather was really crappy... until Monday. Since then it has been snowing all the time and yesterday we left when it looked like this:
-
-
-
-
Nice to watch, but not real fun to walk onto. :) Anyway, it's been another great stay in Skien, where the eZ headquarter is and I'm pretty much looking forward to our summer conference, where we plan to have the complete eZ team there and lots of people from the PHP world. Thanks for the great time, folks!
-
- ]]>Solar 0.10.0 Released - Paul M. Joneshttp://paul-m-jones.com/blog/?p=192Sat, 21 Jan 2006 21:44:43 +0000
diff --git a/tests/Zend/Feed/_files/RssTestSlashdot.xml b/tests/Zend/Feed/_files/RssTestSlashdot.xml
deleted file mode 100644
index 2ae85d9ae1..0000000000
--- a/tests/Zend/Feed/_files/RssTestSlashdot.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
- Slashdot
- http://slashdot.org/
- News for nerds, stuff that matters
- en-us
- Copyright 1997-2005, OSTG - Open Source Technology Group, Inc. All Rights Reserved.
- 2006-01-23T20:11:00+00:00
- OSTG
- pater@slashdot.org
- Technology
- hourly
- 1
- 1970-01-01T00:00+00:00
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Slashdot
- http://images.slashdot.org/topics/topicslashdot.gif
- http://slashdot.org/
-
-
- Interview with Mark Spencer of Asterisk
- http://rss.slashdot.org/Slashdot/slashdot?m=3264
- comforteagle writes "OSDir has published an interview with Mark Spencer of Asterisk and Gaim about why and how he got started coding up the software platform PBX system and how it has become much more than -just- another phone system. He also shares his insights for the opportunities within the telecom industry for open source."<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3264"/>
- ScuttleMonkey
- 2006-01-23T19:47:00+00:00
- communications
- ripe-for-open-source
- mainpage
- 15
- 15,13,11,6,2,1,1
- http://slashdot.org/article.pl?sid=06/01/23/1517205&from=rss
-
-
- The Adobe Photoshop Elements Crafts Book
- http://rss.slashdot.org/Slashdot/slashdot?m=3263
- Sdurham writes "Adobe Photoshop and its many siblings have long been a staple of artists, photographers, and programmers interested in doing serious image manipulation. Increasingly, Photoshop's younger sister Photoshop Elements comes prepackaged with digital cameras. Yet many of the users of these cameras lack the time or patience to tackle the steep learning curve of the Photoshop family and are left asking "How do I do ... ?". Elizabeth Bulger's The Adobe Photoshop Elements Crafts Book attempts to bridge the gap between Photoshop skill level and personal creativity by stepping the reader through 14 different craft projects. In doing so, Bulger tries to provide the basic Photoshop Elements skills necessary for readers to pursue their own projects after finishing the book." Read the rest of Sdurham's review.<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3263"/>
- samzenpus
- 2006-01-23T18:54:00+00:00
- books
- update-your-prom-pictures
- books
- 18
- 18,15,9,5,3,1,0
- http://books.slashdot.org/article.pl?sid=06/01/23/1411250&from=rss
-
-
- Supreme Court spurns RIM
- http://rss.slashdot.org/Slashdot/slashdot?m=3262
- l2718 writes "NTP has just won the latest round in its court battle against Research in Motion (makers of the Blackberry). Today's Order List from the US Supreme Court includes a denial of certiorary for RIM's appeal. This follows the Circuit Court of Appeals' denial of review en banc we have covered previously. As sometimes happens, the court nevertheless accepted amicus curiae briefs from several groups, including Intel and the Canadian government." The potential impact of this may mean the shutdown of Blackberry's network. I hope the crackberry addicts have lots of methadone onhand.
-<p><a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=fYMCju"><img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=fYMCju" border="0"></img></a></p><img src="http://rss.slashdot.org/Slashdot/slashdot?g=3262"/>
- Hemos
- 2006-01-23T18:22:00+00:00
- patents
- good-bye-black-berry
- yro
- 138
- 138,131,116,73,15,9,5
- http://yro.slashdot.org/article.pl?sid=06/01/23/1744258&from=rss
-
-
- Adult Entertainment Antes Up In DRM War
- http://rss.slashdot.org/Slashdot/slashdot?m=3261
- At the recent adult entertainment awards, host Greg Fitzsimmons highlighted the deep relationship between the internet and pornography stating "'The Internet was completely funded by porn,' he said [...] And if it wasn't for the Internet, he added, 'you guys would be completely out of business.' The audience, packed with porn actors and adult entertainment moguls like Jenna Jameson and Larry Flynt, roared with laughter." Now it appears that the adult entertainment industry has chosen to ante up in the DRM battle as well. Some companies have chosen to take sides, like Digital Playground who will be supporting Sony's Blu-Ray. Others, like Vivid Entertainment, seem to think that the answer is diversity and will be supporting both Blu-Ray and HD-DVD.<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3261"/>
- ScuttleMonkey
- 2006-01-23T17:37:00+00:00
- media
- can't-we-all-just-get-along
- hardware
- 152
- 152,146,124,84,34,17,12
- http://hardware.slashdot.org/article.pl?sid=06/01/23/1544235&from=rss
-
-
- Slashdot Index Code Update
- http://rss.slashdot.org/Slashdot/slashdot?m=3259
- For years now Slashdot has posted what we call "Sectional Content". That is to say, stories that we think are good, but since we try to keep the Slashdot Main Page to around 15 stories per day, some stuff just gets put into the sections. This content is mostly lost to readers who simply don't know it exists. Today we're deploying new code to help you find that content (and alternatively, to disable it).<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3259"/>
- CmdrTaco
- 2006-01-23T17:00:00+00:00
- slashdot
- zomg-you-got-some-ajax-in-our-ui
- mainpage
- 247
- 247,231,192,142,41,21,14
- http://slashdot.org/article.pl?sid=06/01/19/175253&from=rss
-
-
- IE7 Leaked
- http://rss.slashdot.org/Slashdot/slashdot?m=3260
- lju writes "IE7 has been leaked according to pcpro. From the article: '...last Friday it was revealed that a build of the new browser - version 5299 - along with numerous screenshots, was available online.' "
-<p><a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=jVTbOh"><img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=jVTbOh" border="0"></img></a></p><img src="http://rss.slashdot.org/Slashdot/slashdot?g=3260"/>
- CmdrTaco
- 2006-01-23T16:41:00+00:00
- microsoft
- hate-when-that-happens
- it
- 265
- 265,257,202,137,52,31,19
- http://it.slashdot.org/article.pl?sid=06/01/23/152211&from=rss
-
-
- The Future of e-Commerce and e-Information?
- http://rss.slashdot.org/Slashdot/slashdot?m=3257
- An anonymous reader writes "The Washington Post has an interesting article on what they label 'The Coming Tug of War Over the Internet. From the article: 'Do you prefer to search for information online with Google or Yahoo? What about bargain shopping -- do you go to Amazon or eBay? Many of us make these kinds of decisions several times a day, based on who knows what -- maybe you don't like bidding, or maybe Google's clean white search page suits you better than Yahoo's colorful clutter. But the nation's largest telephone companies have a new business plan, and if it comes to pass you may one day discover that Yahoo suddenly responds much faster to your inquiries, overriding your affinity for Google. Or that Amazon's Web site seems sluggish compared with eBay's.'" Seems like the idea of the 2-tier internet is really catching on with the market-droids.<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3257"/>
- ScuttleMonkey
- 2006-01-23T15:46:00+00:00
- biz
- bad-for-the-internet-good-for-business
- yro
- 159
- 159,157,140,90,25,16,10
- http://yro.slashdot.org/article.pl?sid=06/01/23/1450249&from=rss
-
-
- MacWorld MacBook Only a Prototype?
- http://rss.slashdot.org/Slashdot/slashdot?m=3256
- mahju writes "Hard Mac is reporting that Apple's, unoffical, response in Paris to the the lack of information on battery life, is that the MacBook Pro that were demoed at Mac World SF are only prototypes and the final versions are still under development. "
-<p><a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=qEOB5Q"><img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=qEOB5Q" border="0"></img></a></p><img src="http://rss.slashdot.org/Slashdot/slashdot?g=3256"/>
- CmdrTaco
- 2006-01-23T14:12:00+00:00
- intel
- well-thats-not-surprising
- apple
- 160
- 160,150,136,102,35,21,14
- http://apple.slashdot.org/article.pl?sid=06/01/23/1333220&from=rss
-
-
- Has Microsoft 'Solved' Spam?
- http://rss.slashdot.org/Slashdot/slashdot?m=3254
- MsWillow writes to tell us the Seattle PI is running a story looking back at Bill Gates promise to have the spam problem "solved" in two years. Well, it looks like time is up, and the verdict is -- an emphatic "maybe". From the article: "Microsoft says it sees things differently. To "solve" the problem for consumers in the short run doesn't require eliminating spam entirely, said Ryan Hamlin, the general manager who oversees the company's anti-spam programs. Rather, he said, the idea is to contain it to the point that its impact on in-boxes is minor. In that way, Hamlin said, Gates' prediction has come true for people using the right tactics and advanced filtering technology."<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3254"/>
- ScuttleMonkey
- 2006-01-23T13:37:00+00:00
- spam
- depends-on-your-definition-of-solved
- it
- 283
- 283,277,240,152,57,27,15
- http://it.slashdot.org/article.pl?sid=06/01/23/0340241&from=rss
-
-
- World of Warcraft AQ Gates Open!
- http://rss.slashdot.org/Slashdot/slashdot?m=3255
- Tayman writes "Wow...who didn't see this one coming? The players on the World of Warcraft Medivh server opened the gates to AQ. What happened next? The server crashed repeatedly. Why create content the servers can't handle? The very first time I read about this patch, I knew the servers would crash. The more people who open the gates, the more angry customers Blizzard will have in my opinion. With 5million+ subscribers, you would think Blizzard would have the best servers/connection money can buy. Although, I'm sure it's more complicated than simply plugging in a few ram chips and faster processors though. Most of the people involved in the raid are having a great time though. Could this be the most epic battle ever introduced to the mmorpg market? All signs point to yes. Let's see how long the mobs will respawn. Hopefully, the people of the Medivh server haven't seen anything yet. Either way, I would hate to be a network admin for Blizzard atm. ^_^ Here are some pics of the event. Thanks go out to all of those who took these pics. World of Warcraft AQ Pics Check out MMORPG Veteran to keep up with the events as they unfold." Update: 01/23 13:44 GMT by Z : Additionally, brandor wrote in with a link to some video of the event.<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3255"/>
- Hemos
- 2006-01-23T13:33:00+00:00
- rpg
- of-course-it-will-blow-up
- games
- 330
- 330,313,258,158,46,27,20
- http://games.slashdot.org/article.pl?sid=06/01/23/1244201&from=rss
-
-
- Search Slashdot
- Search Slashdot stories
- query
- http://slashdot.org/search.pl
-
-
-
diff --git a/tests/Zend/Feed/_files/TestAtomFeed.xml b/tests/Zend/Feed/_files/TestAtomFeed.xml
deleted file mode 100644
index 69afce7a60..0000000000
--- a/tests/Zend/Feed/_files/TestAtomFeed.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
- Atom Example
- This is a simple Atom Feed made by XML_Feed_Writer.
-
-
-
- 4
- 3
- 2
- 2005-04-25T00:00:00+02:00
-
- 1
-
- The Item Title
- 2004-09-25T16:03:00+02:00
- 2005-12-25T16:03:00+01:00
-
- David Coallier
-
- Testing something before releasing
-
-
- 2
-
- Second item added to the builder/feeded..
- 2004-01-04T00:00:00+01:00
- 1970-01-01T01:00:00+01:00
-
- David Coallier
-
- Jaws project, visit the website for infos...
-
-
diff --git a/tests/Zend/Feed/_files/TestAtomFeedEntryOnly.xml b/tests/Zend/Feed/_files/TestAtomFeedEntryOnly.xml
deleted file mode 100644
index 9088137da7..0000000000
--- a/tests/Zend/Feed/_files/TestAtomFeedEntryOnly.xml
+++ /dev/null
@@ -1 +0,0 @@
-1Bug1BuggyLong time debugging2005-09-152005-09-18RESOLVEDnormalP2FIXEDexample@example.comThe bug has been fixed.
diff --git a/tests/Zend/Feed/_files/TestAtomFeedNamespaced.xml b/tests/Zend/Feed/_files/TestAtomFeedNamespaced.xml
deleted file mode 100644
index 02d0ee2544..0000000000
--- a/tests/Zend/Feed/_files/TestAtomFeedNamespaced.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
- Atom Example
- This is a simple Atom Feed made by XML_Feed_Writer.
-
-
-
- 4
- 3
- 2
- 2005-04-25T00:00:00+02:00
-
- 1
-
- The Item Title
- 2004-09-25T16:03:00+02:00
- 2005-12-25T16:03:00+01:00
-
- David Coallier
-
- Testing something before releasing
-
-
- 2
-
- Second item added to the builder/feeded..
- 2004-01-04T00:00:00+01:00
- 1970-01-01T01:00:00+01:00
-
- David Coallier
-
- Jaws project, visit the website for infos...
-
-
diff --git a/tests/Zend/Feed/_files/TestFeedEntryRssContentEncoded.xml b/tests/Zend/Feed/_files/TestFeedEntryRssContentEncoded.xml
deleted file mode 100644
index baa70a73b9..0000000000
--- a/tests/Zend/Feed/_files/TestFeedEntryRssContentEncoded.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
- Zend Framework IT
- http://www.zend-framework.it
- Just another Zend Framework (Italian) weblog.
- Sun, 03 Feb 2008 21:07:35 +0000
- http://wordpress.org/?v=2.3.1
- en
-
- Zend_Service_Technorati promosso in Core
- http://www.zend-framework.it/2008/02/03/zend_service_technorati-promosso-in-core/
- http://www.zend-framework.it/2008/02/03/zend_service_technorati-promosso-in-core/#comments
- Sun, 03 Feb 2008 21:06:15 +0000
- weppos
-
-
-
-
- http://www.zend-framework.it/2008/02/03/zend_service_technorati-promosso-in-core/
-
- Il commit r7757 ha ufficialmente decretato la promozione nella core library di un componente al quale sono molto affezionato: Zend_Service_Technorati.
-Non solo si tratta della prima libreria completamente proposta e sviluppata dal sottoscritto, ma è anche un lavoro che mi ha visto occupato per diversi giorni nel tentativo di risolvere i vari problemi di inconsistenza delle API di Technorati, come dimostra il ticket #ZF-2334. (more…)
-]]>
- http://www.zend-framework.it/2008/02/03/zend_service_technorati-promosso-in-core/feed/
-
-
- Proposta per la struttura predefinita di un nuovo progetto Zend Framework
- http://www.zend-framework.it/2008/02/02/proposta-per-la-struttura-predefinita-di-un-nuovo-progetto-zend-framework/
- http://www.zend-framework.it/2008/02/02/proposta-per-la-struttura-predefinita-di-un-nuovo-progetto-zend-framework/#comments
- Sat, 02 Feb 2008 14:21:15 +0000
- weppos
-
-
- http://www.zend-framework.it/2008/02/02/proposta-per-la-struttura-predefinita-di-un-nuovo-progetto-zend-framework/
-
-
- http://www.zend-framework.it/2008/02/02/proposta-per-la-struttura-predefinita-di-un-nuovo-progetto-zend-framework/feed/
-
-
- Installare Zend Framework via PEAR
- http://www.zend-framework.it/2008/01/29/installare-zend-framework-via-pear/
- http://www.zend-framework.it/2008/01/29/installare-zend-framework-via-pear/#comments
- Tue, 29 Jan 2008 08:42:37 +0000
- weppos
-
-
-
- http://www.zend-framework.it/2008/01/29/installare-zend-framework-via-pear/
-
- Introduzione a PEAR
-
Chiunque programmi in PHP avrà sentito parlare, prima o poi, di PEAR.
-PEAR è un enorme repository di librerie PHP. Vi si trovano applicazioni complete, librerie complete ma, ahimè, anche molti componenti abbandonati sul nascere.
-
PEAR offre un eccellente sistema di packaging che consente di installare facilmente una libreria parte del repository ufficiale o una qualsiasi libreria su un altro repository che sia compatibile con gli standard definiti.
-Per chi programma in altri linguaggi, questo sistema è molto simile al concetto di GEM in Ruby o ai moduli di PERL. (more…)