|
|||
|
Running 1.0.3 on Ubuntu with PHP5 & MySQL5. I have an __autoload($class) that that checks $class for specific classes, and defaults to Zend_Loader::loadClass($class,null). When I comment out the default Zend_Loader, I get the missing index.....phtml as expected because I do not have the view template defined yet, but if I leave it uncommented, then I am getting this error:
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "IndexController.php" was not found' in /var/www/alertusa/_library/Zend/Loader.php:159 Stack trace: #0 /var/www/alertusa/_library/Zend/Loader.php(91): Zend_Loader::loadFile('IndexController...', Array, true) #1 /var/www/alertusa/_include/settings.php(23): Zend_Loader::loadClass('IndexController', NULL) #2 [internal function]: __autoload('IndexController') #3 /var/www/alertusa/_library/Zend/Controller/Dispatcher/Standard.php(165): class_exists('IndexController') #4 /var/www/alertusa/_library/Zend/Controller/Dispatcher/Standard.php(194): Zend_Controller_Dispatcher_Standard->isDispatchable(Object(Zend_Controller_Request_Htt p)) #5 /var/www/alertusa/_library/Zend/Controller/Front.php(929): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #6 /var/www/alertusa/public/index.php(30): Zend_Controller_Front->dispatch() #7 {main} thrown in /var/www/alertusa/_library/Zend/Loader.php on line 159 Anyone have any ideas? Is there more information needed. the settings.php referred to is where the __autoload is along with a few other things and is required_once from the bootstrap. If I comment that out, same thing as if I just comment out the Zend_Loader in the __autoload function. TIA Steven |
|
|||
|
i had the same error, what you need to do is removing your own written custom __autoload() function and using the zend_loader implementation, so instead of using something like this:
function __autoload($class) { Zend_Loader::loadClass($class); } you should be using: include_once 'Zend/Loader.php'; Zend_Loader::registerAutoload(); if you have specific needs, i suggest you extend zend_loader, and implement your own version of the registerAutoload() method, while still be able to use the parents functionality. public static function registerAutoload() { parent::registerAutoload(); // add your code here } Last edited by ignace : 01-30-2008 at 06:40 PM. |
|
|||
|
That sounds good. In the __autoload I have defined, there are a couple of conditions that I have where I load the class from other than the include path, and these circumstances do not really use the right naming convention to be handled by registered autoloader, I doubt.
I am trying to integrate the ORM portion of qcodo so I have two conditions, one where the class name begins with "QBase" which requires me to load the main class of the qcodo ORM module, and the other condition is that the class begins with "orm" which is how I set the qcodo to name the data model classes, in which case I would need to load the class from the application/models directory (using the standard directory structure). So, I am presuming the I can do the same thing in the redefined registered autoloader where I first test for thes two conditions and failing those then call the parent method? Does that sound about right? Thanks for your reply. Steven |
![]() |
| Thread Tools | |
| Display Modes | |
|
|