-- wenbert <[email protected]> wrote
(on Wednesday, 03 June 2009, 02:52 AM -0700):
> I have this in my application.ini
> 
> resources.frontController.plugins.CheckHasAcess = 
> "Wenbert_Controller_Plugin_CheckHasAccess"
> 
> But when I do that, I get this error:
> 
> Fatal error: Class 'Wenbert_Controller_Plugin_CheckHasAccess' not found in 
> /opt/apache2/htdocs/apps/ZendFramework/library/Zend/Application/Resource/Frontcontroller.php
>  on line 90
> 
> How do I specify a directory for plugins in application.ini?

The easiest way is to ensure that your include_path and autoloader are
setup such that the class may be autoloaded. If it can, this should work
seamlessly (and, in fact, there are unit tests covering this use case).

It looks from your bootstrap that it's likely on your include_path. Is
it possible that the class name contained in the file is incorrect?

> My work-around for the moment is to add this in my Bootstrap.php
> 
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
>     protected function _initAutoload()
>     {
>         $autoloader = new Zend_Application_Module_Autoloader(array(
>             'namespace' => 'Default',
>             'basePath'  => dirname(__FILE__),
>         ));
> 
>         //Added this as a work-around.
>         require_once 'Wenbert/Controller/Plugin/CheckHasAccess.php';
> 
>         return $autoloader;
>     }
> 
>     protected function _initDoctype()
>     {
>         $this->bootstrap('view');
>         $view = $this->getResource('view');
>         $view->doctype('XHTML1_STRICT');
>     }
> 
>     protected function _initView()
>     {
>         $view = new Zend_View();
>         // more initialization...
>         return $view;
>     }
> }
> 
> I am stuck at the moment. Any reply would be great. Thanks!
> http://blog.ekini.net

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to