Reputation: 83
Why ist the Zend_Autoloader not able to load my Classes.
Tha path to the library should be: /root/application/modules/modulexy/MyLib
(Zend Version 1.12)
What i did:
set_include_path(implode(PATH_SEPARATOR, array( ... realpath(APPLICATION_PATH . '/modules/modulexy/MyLib'), ... )));
In the Controller
$al = Zend_Loader_Autoloader::getInstance(); $al->registerNamespace("MyLib_");
I don't want to move the library to /root/library
Upvotes: 2
Views: 300
Reputation: 856
Your include path shouldn't include the "MyLib" part.
This should work:
set_include_path(implode(PATH_SEPARATOR, array(
...
realpath(APPLICATION_PATH . '/modules/modulexy'),
...
)));
Alternatively, if you want that lib extra directory, you could have
set_include_path(implode(PATH_SEPARATOR, array(
...
realpath(APPLICATION_PATH . '/modules/modulexy/lib'),
...
)));
And place your class "MyLib_Model_Abstract" in "/modules/modulexy/lib/MyLib/Model/Abstract.php
Upvotes: 2