zend_loader_autoloader 似乎没有加载抽象类 [英] zend_loader_autoloader does not seem to load abstract class

查看:39
本文介绍了zend_loader_autoloader 似乎没有加载抽象类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我掌握了 Zend_Autoload,但我拥有的一个非 zend 类在扩展时没有加载.

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?

推荐答案

Zend_loader_autoloader 实际上确实加载抽象类,同一个类可以实现的任何接口.甜.

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

直接在 Zend_Loader 类中的几个调试调用很快就指出了我的问题:我的文件名为 AbstractTableFetch.php ,该类名为 FetchTable.

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.

这篇关于zend_loader_autoloader 似乎没有加载抽象类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆