禁用 Zend 自动加载器 [英] Disable Zend Autoloader

查看:35
本文介绍了禁用 Zend 自动加载器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何禁用 Zend_Loader_Autoloader?

解决方案

您可以手动强制自动加载器卸载,但这可能会导致组件出现问题,具体取决于它是否已注册:请确保您的其他加载器涵盖了这一点.

>

spl_autoload_unregister(array('Zend_Loader_Autoloader','autoload'));

我从 Zend_Loader_Autoloader 的构造函数中剥离了它,并将其更改为在类之外工作,并取消注册而不是注册加载器.

How can I disable the Zend_Loader_Autoloader?

解决方案

You could manually force the Autoloader to unload, but this may lead to trouble with components depending on it being registered: make sure your other loader covers that.

spl_autoload_unregister(array('Zend_Loader_Autoloader','autoload'));

I stripped this from the constructor of Zend_Loader_Autoloader, and changed it to work outside of the class, and to unregister instead of register the loader.

这篇关于禁用 Zend 自动加载器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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