本文整理汇总了PHP中Zend_Feed_Abstract::__wakeup方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Feed_Abstract::__wakeup方法的具体用法?PHP Zend_Feed_Abstract::__wakeup怎么用?PHP Zend_Feed_Abstract::__wakeup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Feed_Abstract
的用法示例。
在下文中一共展示了Zend_Feed_Abstract::__wakeup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __wakeup
/**
* 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: __wakeup
/**
* 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: __wakeup
/**
* 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: __wakeup
/**
* 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: __wakeup
/**
* 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();
}