zend_loader_autoloader does not seem to load abstract class

你。 提交于 2020-01-04 04:05:10

问题


I am getting a grip on Zend_Autoload but a non-zend class I have is not loading when extended.

The autoloader is initialized like so:

 // Initialise Autoloader
 $autoloader = Zend_Loader_Autoloader::getInstance();
 $autoloader->suppressNotFoundWarnings(true);
 $autoloader->setFallbackAutoloader(true);
 $autoloader->registerNamespace('lib_');
 }

It all works fine with other classes. Is it required to load abstract class files and implemented interfaces manually beforehand?


回答1:


Zend_loader_autoloader actually does load abstract classes, idem for any interface a class may implement. Sweet.

A couple of debugging calls straight in the Zend_Loader class quickly indicated my problem: My file was named AbstractTableFetch.php , the class was called FetchTable.

The autoloader obviously will only works if the filename and class name are the same.



来源:https://stackoverflow.com/questions/5739325/zend-loader-autoloader-does-not-seem-to-load-abstract-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!