Zend_loader'S autoloader has been deprecated in the upcoming Zend Framework version 1.8 and so you now get a notice if you use it:
Notice: Zend_loader: registerautoload is deprecated as of 1.8.0 and will be removed with 2.0.0; Use zend_loader_autoloader instead in/Www/ZF-tutorial/library/Zend/loader. phpOn line 207
Notice: Zend_loader: autoload is deprecated as of 1.8.0 and will be removed with 2.0.0; Use zend_loader_autoloader instead in/Www/ZF-tutorial/library/Zend/loader. phpOn line 186
Notice: Zend_loader: autoload is deprecated as of 1.8.0 and will be removed with 2.0.0; Use zend_loader_autoloader instead in/Www/ZF-tutorial/library/Zend/loader. phpOn line 186
(And so on)
This is because you have the lines:
require_once 'Zend/Loader.php';Zend_Loader::registerAutoload();
(Or similar) somewhere in your Bootstrap system.
The easiest solution is to change them:
require_once 'Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('App_');
Where 'app _ 'is the name of a directory on your include path that has classes within it that follow the Zend framework naming convention, so change it as appropriate and add more if you need them.
If you need generic autoloading ability, for instance because yourModelsDirectory is on your include path and you don't namespace your model classes, then add this:
$loader->setFallbackAutoloader(true);
You shoshould also add:
$loader->suppressNotFoundWarnings(false);
When in development mode as then the new autoloader will actually tell you what the syntax error is rather than showing you a white page
Now you shoshould go and readZend_loader_autoloaderDocumentation to learn how very useful it is!
Update: You shoshould also read Matthew's article on zend_loader_autoloader as it explains this all in detail!
This entry was posted on Thursday, 30th limit l 2009 at and is filed under Zend framework. you can follow any responses to this entry through the RSS 2.0 feed. you can skip to the end and leave a response. pinging is currently not allowed.