本文整理汇总了PHP中Zend_Feed_Reader::registerExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Feed_Reader::registerExtension方法的具体用法?PHP Zend_Feed_Reader::registerExtension怎么用?PHP Zend_Feed_Reader::registerExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Feed_Reader
的用法示例。
在下文中一共展示了Zend_Feed_Reader::registerExtension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findAlbums
public function findAlbums()
{
if (!$this->_albums) {
$this->_albums = array();
Zend_Feed_Reader::registerExtension('Picasa');
try {
if (empty($offset)) {
$offset = 1;
}
$this->setType('album')->unsAlbumId();
$this->_setPicasaUrl($offset);
$feed = Zend_Feed_Reader::import($this->getLink());
} catch (Exception $e) {
$feed = array();
}
foreach ($feed as $entry) {
$picasa = $entry->getExtension('Picasa');
$this->_albums[] = array('id' => $picasa->getAlbumId(), 'title' => $picasa->getTitle(), 'author' => $picasa->getAuthor(), 'image' => $picasa->getImage());
}
}
return $this->_albums;
}
示例2: testRegistersUserExtension
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'));
}