Zend框架:插件路径

问题描述:

我有ZF 1.11运行没有问题,并按照其性能指南中的说明删除require_once语句。正如他们所说,我已经将自动加载器添加到我的索引文件中(在旁注中,我不明白为什么这不能进入boostrap),但现在我的插件没有找到。Zend框架:插件路径

例如,一种形式是使用“和DijitElement”装饰,它返回错误:

Zend_Loader_PluginLoader_Exception: Plugin by name 'DijitElement' was not found in the registry; used paths: Zend_Form_Decorator_: Zend/Form/Decorator/ in C:\wamp\www\cms\library\Zend\Loader\PluginLoader.php on line 412 

在这种形式构造我已经增加了以下尝试,并与没有用修复:

$this->addPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'DECORATOR'); 

如果我重新命名装饰用的,而不是仅仅 '和DijitElement' Zend_Dojo_Form_Decorator_DijitElement'我得到:

Plugin by name 'Zend_Dojo_Form_Decorator_DijitElement' was not found in the registry; used paths: Zend_Dojo_Form_Decorator_: Zend/Dojo/Form/Decorator/ Zend_Form_Decorator_: Zend/Form/Decorator/ 

在我的bootstap中,我使用插件缓存,在删除require_once之前,我没有在构造函数中可以正常工作的前缀路径,但是在删除后,我尝试了使用和不使用,都没有工作。

protected function _initPluginCache() { 
    $path = '/cache/pluginLoaderCache.php'; 
    if(file_exists($path)) include_once $path; 
    $loader = new Zend_Loader_PluginLoader(array(
     'Zend_View_Helper'=>LIBRARY_PATH.'/Zend/View/Helper/', 
     'Zend_Dojo_View_Helper'=>LIBRARY_PATH.'/Zend/Dojo/View/Helper', 
     'Zend_Dojo_Form_Decorator'=>'Zend/Dojo/Form/Decorator', 
     'Zend_Dojo_Form_Element'=>LIBRARY_PATH.'/Zend/Dojo/Form/Element' 
    )); 
    $loader = Zend_Loader_PluginLoader::setIncludeFileCache($path); 
} 

如何告诉Zend文件在哪里?我假定这是与我的自动加载但导向只是说添加这将这样的伎俩:

require_once 'Zend/Loader/Autoloader.php'; 
Zend_Loader_Autoloader::getInstance(); 

仅供参考,导游是这里http://framework.zend.com/manual/en/performance.classloading.html

+0

为什么你在引导_initPluginChache()Zend_Loader_PluginLoader中设置这些默认路径? – 2010-11-09 18:36:34

+0

这只是一个实验,我已经尝试过,没有这些 – Ashley 2010-11-09 20:40:52

,我发现我的解决方案,这个问题是什么与删除需求或自动加载器有关,但实际上是一个元素装饰器。添加一个在非dojo元素上使用'DijitElement'的装饰器数组会给这个插件错误。一个愚蠢的错误,为一个小错误