本文整理匯總了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();
}