I am stuck and looking for a solution to fix the following error:
Fatal error: Class ‘Plugin_AccessCheck’ not found in /…/application/Bootstrap.php on line 18
I’m trying to register a new plugin. My code is:
protected function _initAutoLoad()
{
$modelLoader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH));
$acl = new Application_Model_LibraryAcl();
$auth = Zend_Auth::getInstance();
$frontcontroller = Zend_Controller_Front::getInstance();
$frontcontroller->registerPlugin(new Plugin_AccessCheck($acl, $auth));
return $modelLoader;
}
(This is ZF 1.11)
To achieve what you’re trying to do, you need to satisfy the following requirements (all names and paths are case sensitive)…
Plugin_AccessChecksomewhere in your projectinclude_path(your appslibrarydirectory for example) at the relative pathPlugin/AccessCheck.phpThe autoloader has been informed that it should autoload classes beginning with the
Pluginprefix. For example, in yourapplication.iniconfig fileThere are other ways to achieve this however I’m taking the path of least resistance here.
As an aside, if this is inside a
Bootstrap_init*method, don’t fetch the Front Controller like that. Use this instead