zend autoloader cannot find file

1.1k Views Asked by At

i want to add Uploader class into my zend application

in library folder i add uploder.php and inside the Uploder.php i start class with class Amjad_Uploder {...}

in application.ini i add the following lines

includePaths.library = APPLICATION_PATH "/../library"

appnamespace= "Application"

autoloaderNamespaces[] ="Amjad_"

in controller i call the class by writing

$uploder=new Amjad_Uploder();

i still have these errors

Warning: include_once(Amjad\Uploader.php): failed to open stream: No such file or directory in C:\wamp\www\amjad\library\Zend\Loader.php on line 134

Warning: include_once(): Failed opening 'Amjad\Uploader.php' for inclusion (include_path='C:\wamp\www\amjad\application/../library;C:\wamp\www\amjad/library;.;c:\php\includes;D:\Zend Library\') in C:\wamp\www\amjad\library\Zend\Loader.php on line 134

Fatal error: Class 'Amjad_Uploader' not found in C:\wamp\www\amjad\application\modules\admin\controllers\scincetificController.php on line 34

2

There are 2 best solutions below

0
On

The mistake is that in the library folder, you need to create a folder called Amjad and place Uploder.php in there. It sounds like you put Uploder.php directly in library.

0
On

I always thought that I should have in the application.ini

autoloaderNamespaces[] ="Amjad"

and not

autoloaderNamespaces[] ="Amjad_"