Пример #1
0
 /**
  * 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 <entry> 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 <feed> 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();
 }
Пример #2
0
 /**
  * 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.
     $rdf = $this->_element->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'RDF')->item(0);
     if ($rdf) {
         $this->_element = $rdf;
         $channel = $this->_element->getElementsByTagName('channel')->item(0);
         if ($channel->getElementsByTagName('title')->item(0)) {
             $this->_element->appendChild($channel->getElementsByTagName('title')->item(0));
         }
         if ($channel->getElementsByTagName('link')->item(0)) {
             $this->_element->appendChild($channel->getElementsByTagName('link')->item(0));
         }
         if ($channel->getElementsByTagName('description')->item(0)) {
             $this->_element->appendChild($channel->getElementsByTagName('description')->item(0));
         }
     } else {
         $this->_element = $this->_element->getElementsByTagName('channel')->item(0);
     }
     if (!$this->_element) {
         /**
          * @see Zend_Feed_Exception
          */
         require_once 'external/Zend/Feed/Exception.php';
         throw new Zend_Feed_Exception('No root <channel> element found, cannot parse channel.');
     }
     // Find the entries and save a pointer to them for speed and
     // simplicity.
     $this->_buildEntryCache();
 }
Пример #3
0
 /**
  * Override Zend_Feed_Abstract to set up the $_element and $_entries aliases.
  */
 public function __wakeup()
 {
     parent::__wakeup();
     // Find the base feed element and create an alias to it.
     $this->_element = $this->_element->getElementsByTagName('channel')->item(0);
     if (!$this->_element) {
         throw new Zend_Feed_Exception('No root <channel> element found, cannot parse feed.');
     }
     // Find the entries and save a pointer to them for speed and
     // simplicity.
     $this->_buildEntryCache();
 }
Пример #4
0
 /**
  * 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.
     $this->_element = $this->_element->getElementsByTagName('channel')->item(0);
     if (!$this->_element) {
         /** 
          * @see Zend_Feed_Exception
          */
         require_once 'src/common/Zend/Feed/Exception.php';
         throw new Zend_Feed_Exception('No root <channel> element found, cannot parse channel.');
     }
     // Find the entries and save a pointer to them for speed and
     // simplicity.
     $this->_buildEntryCache();
 }
Пример #5
0
 /**
  * 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
          */
         throw new Zend_Feed_Exception('No root <channel> element found, cannot parse channel.');
     }
     // Find the entries and save a pointer to them for speed and
     // simplicity.
     $this->_buildEntryCache();
 }