Created
July 9, 2010 11:46
-
-
Save anonymous/469387 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Controller: http://www.example.com/ | |
<?php | |
class IndexController extends Zend_Controller_Action | |
{ | |
public function indexAction() | |
{ | |
if(!Zend_Feed_Reader::isRegistered('JungleBooks')) { | |
Zend_Feed_Reader::addPrefixPath( | |
'/var/www/html/zendframework/application/My/FeedReader/Extension', 'My_FeedReader_Extension' | |
); | |
Zend_Feed_Reader::registerExtension('JungleBooks'); | |
} | |
} | |
} | |
2. File exist here: /var/www/html/zendframework/application/My/FeedReader/Extension/JungleBooks.php | |
<?php | |
class My_FeedReader_Extension_JungleBooks_Entry extends Zend_Feed_Reader_Extension_EntryAbstract | |
{ | |
public function getIsbn() | |
{ | |
if (isset($this->_data['isbn'])) { | |
return $this->_data['isbn']; | |
} | |
$isbn = $this->_xpath->evaluate( | |
'string(' . $this->getXpathPrefix() . '/jungle:isbn)' | |
); | |
if (!$isbn) { | |
$isbn = null; | |
} | |
$this->_data['isbn'] = $isbn; | |
return $this->_data['isbn']; | |
} | |
protected function _registerNamespaces() | |
{ | |
$this->_xpath->registerNamespace( | |
'jungle', 'http://example.com/junglebooks/rss/module/1.0/' | |
); | |
} | |
} | |
3. Application error | |
object(Zend_Feed_Exception)#35 (8) { | |
["_previous":"Zend_Exception":private]=> | |
NULL | |
["message":protected]=> | |
string(113) "Could not load extension: JungleBooksusing Plugin Loader. Check prefix paths are configured and extension exists." | |
["string":"Exception":private]=> | |
string(0) "" | |
["code":protected]=> | |
int(0) | |
["file":protected]=> | |
string(47) "/var/www/html/zendframework/library/Zend/Feed/Reader.php" | |
["line":protected]=> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment