Просмотр исходного кода

Removed relocated interface/abstract class files (see commit 16953)

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16954 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 лет назад
Родитель
Сommit
936e320b59

+ 0 - 215
library/Zend/Feed/Reader/Entry/EntryAbstract.php

@@ -1,215 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-abstract class Zend_Feed_Reader_Entry_EntryAbstract
-{
-    /**
-     * Feed entry data
-     *
-     * @var array
-     */
-    protected $_data = array();
-
-    /**
-     * DOM document object
-     *
-     * @var DOMDocument
-     */
-    protected $_domDocument = null;
-
-    /**
-     * Entry instance
-     *
-     * @var Zend_Feed_Entry_Interface
-     */
-    protected $_entry = null;
-
-    /**
-     * Pointer to the current entry
-     *
-     * @var int
-     */
-    protected $_entryKey = 0;
-
-    /**
-     * XPath object
-     *
-     * @var DOMXPath
-     */
-    protected $_xpath = null;
-
-    /**
-     * Registered extensions
-     * 
-     * @var array
-     */
-    protected $_extensions = array();
-
-    /**
-     * Constructor
-     * 
-     * @param  DOMElement $entry 
-     * @param  int $entryKey 
-     * @param  string $type 
-     * @return void
-     */
-    public function __construct(DOMElement $entry, $entryKey, $type = null)
-    {
-        $this->_entry       = $entry;
-        $this->_entryKey    = $entryKey;
-        $this->_domDocument = $entry->ownerDocument;
-        if ($type !== null) {
-            $this->_data['type'] = $type;
-        } else {
-            $this->_data['type'] = Zend_Feed_Reader::detectType($feed);
-        }
-        $this->_loadExtensions();
-    }
-
-    /**
-     * Get the DOM
-     *
-     * @return DOMDocument
-     */
-    public function getDomDocument()
-    {
-        return $this->_domDocument;
-    }
-
-    /**
-     * Get the entry element
-     * 
-     * @return Zend_Feed_Entry_Interface
-     */
-    public function getEntryElement()
-    {
-        return $this->_entry;
-    }
-
-    /**
-     * 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'];
-    }
-
-    /**
-     * Get the XPath query object
-     *
-     * @return DOMXPath
-     */
-    public function getXpath()
-    {
-        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;
-    }
-
-    /**
-     * Serialize the entry to an array
-     *
-     * @return array
-     */
-    public function toArray()
-    {
-        return $this->_data;
-    }
-
-    /**
-     * Get registered extensions
-     * 
-     * @return array
-     */
-    public function getExtensions()
-    {
-        return $this->_extensions;
-    }
-
-    /**
-     * 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[$className] = new $className(
-                $this->getEntryElement(), $this->_entryKey, $this->_data['type']
-            );
-        }
-    }
-}

+ 0 - 136
library/Zend/Feed/Reader/Entry/Interface.php

@@ -1,136 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_Feed_Reader_Entry_Interface
-{
-    /**
-     * Get the specified author
-     *
-     * @param  int $index
-     * @return string|null
-     */
-    public function getAuthor($index = 0);
-
-    /**
-     * Get an array with feed authors
-     *
-     * @return array
-     */
-    public function getAuthors();
-
-    /**
-     * Get the entry content
-     *
-     * @return string
-     */
-    public function getContent();
-
-    /**
-     * Get the entry creation date
-     *
-     * @return string
-     */
-    public function getDateCreated();
-
-    /**
-     * Get the entry modification date
-     *
-     * @return string
-     */
-    public function getDateModified();
-
-    /**
-     * Get the entry description
-     *
-     * @return string
-     */
-    public function getDescription();
-
-    /**
-     * Get the entry enclosure
-     *
-     * @return stdClass
-     */
-    public function getEnclosure();
-
-    /**
-     * Get the entry ID
-     *
-     * @return string
-     */
-    public function getId();
-
-    /**
-     * Get a specific link
-     *
-     * @param  int $index
-     * @return string
-     */
-    public function getLink($index = 0);
-
-    /**
-     * Get all links
-     *
-     * @return array
-     */
-    public function getLinks();
-
-    /**
-     * Get a permalink to the entry
-     *
-     * @return string
-     */
-    public function getPermalink();
-
-    /**
-     * Get the entry title
-     *
-     * @return string
-     */
-    public function getTitle();
-
-    /**
-     * Get the number of comments/replies for current entry
-     *
-     * @return integer
-     */
-    public function getCommentCount();
-
-    /**
-     * Returns a URI pointing to the HTML page where comments can be made on this entry
-     *
-     * @return string
-     */
-    public function getCommentLink();
-
-    /**
-     * Returns a URI pointing to a feed of all comments for this entry
-     *
-     * @return string
-     */
-    public function getCommentFeedLink();
-}

+ 0 - 260
library/Zend/Feed/Reader/Feed/FeedAbstract.php

@@ -1,260 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @see Zend_Feed_Reader
- */
-require_once 'Zend/Feed/Reader.php';
-
-/**
- * @see Zend_Feed_Reader_Entry_Atom
- */
-require_once 'Zend/Feed/Reader/Entry/Atom.php';
-
-
-/**
- * @see Zend_Feed_Reader_Entry_Rss
- */
-require_once 'Zend/Feed/Reader/Entry/Rss.php';
-
-/**
- * @see Zend_feed_Reader_Feed_Interface
- */
-require_once 'Zend/Feed/Reader/Feed/Interface.php';
-
-/**
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-abstract class Zend_Feed_Reader_Feed_FeedAbstract implements Zend_Feed_Reader_Feed_Interface
-{
-	/**
-     * Parsed feed data
-     *
-     * @var array
-     */
-    protected $_data = array();
-
-    /**
-     * Parsed feed data in the shape of a DOMDocument
-     *
-     * @var DOMDocument
-     */
-    protected $_domDocument = null;
-
-    /**
-     * An array of parsed feed entries
-     *
-     * @var array
-     */
-    protected $_entries = array();
-
-    /**
-     * A pointer for the iterator to keep track of the entries array
-     *
-     * @var int
-     */
-    protected $_entriesKey = 0;
-
-    /**
-     * The base XPath query used to retrieve feed data
-     *
-     * @var DOMXPath
-     */
-    protected $_xpath = null;
-
-    protected $_extensions = array();
-
-    /**
-     * Constructor
-     *
-     * @param DomDocument The DOM object for the feed's XML
-     * @param string $type Feed type
-     */
-    public function __construct(DomDocument $domDocument, $type = null)
-    {
-        $this->_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();
-    }
-
-	/**
-     * 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()
-    {
-        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;
-        return $assumed;
-    }
-
-    /**
-     * 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;
-    }
-
-    /**
-     * Return the feed as an array
-     *
-     * @return array
-     */
-    public function toArray() // untested
-    {
-        return $this->_data;
-    }
-
-    /**
-     * 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');
-    }
-
-    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[$className] = 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();
-}

+ 0 - 115
library/Zend/Feed/Reader/Feed/Interface.php

@@ -1,115 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @category   Zend
- * @package    Zend_Feed_Reader
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_Feed_Reader_Feed_Interface extends Iterator, Countable
-{
-    /**
-     * Get a single author
-     *
-     * @param  int $index
-     * @return string|null
-     */
-    public function getAuthor($index = 0);
-
-    /**
-     * Get an array with feed authors
-     *
-     * @return array
-     */
-    public function getAuthors();
-
-    /**
-     * Get the copyright entry
-     *
-     * @return string|null
-     */
-    public function getCopyright();
-
-    /**
-     * Get the feed creation date
-     *
-     * @return string|null
-     */
-    public function getDateCreated();
-
-    /**
-     * Get the feed modification date
-     *
-     * @return string|null
-     */
-    public function getDateModified();
-
-    /**
-     * Get the feed description
-     *
-     * @return string|null
-     */
-    public function getDescription();
-
-    /**
-     * Get the feed generator entry
-     *
-     * @return string|null
-     */
-    public function getGenerator();
-
-    /**
-     * Get the feed ID
-     *
-     * @return string|null
-     */
-    public function getId();
-
-    /**
-     * Get the feed language
-     *
-     * @return string|null
-     */
-    public function getLanguage();
-
-    /**
-     * Get a link to the HTML source
-     *
-     * @return string|null
-     */
-    public function getLink();
-
-    /**
-     * Get a link to the XML feed
-     *
-     * @return string|null
-     */
-    public function getFeedLink();
-
-    /**
-     * Get the feed title
-     *
-     * @return string|null
-     */
-    public function getTitle();
-
-}