Trouble setting up the Zend_Loader_Autoloader. Pretty easy question, but I'm new to Zend Framework

Read the comments in the code for a description:


class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
public function __construct($configSection){
        $rootDir = dirname(dirname(__FILE__));

        . PATH_SEPARATOR . ROOT_DIR . '/library/'

        //Using this, I receive a deprecated warning.
        include 'Zend/Loader.php';

        //Using this, I recieve an error that autoload() has missing arguments.     

        //Load the configuration file.
        Zend_Registry::set('configSection', $configSection);
        $config = new Zend_Config_Ini(ROOT_DIR . '/application/config.ini',$configSection);


        //Database configuration settings go here. :)
        $db = Zend_Db::factory($config->db);

    public function configureFrontController(){
        $frontController = Zend_Controller_Front::getInstance();
        $frontController->setControllerDirectory(ROOT_DIR . '/application/controllers');

    public function runApp(){

        //Runs the Zend application. :)
        $frontController = Zend_Controller_Front::getInstance();

I'm trying to follow a tutorial that wants me to configure my Zend app to use the autoloading functions that it offers.

When using the registerAutoLoad() method, I receive a deprecated warning and it tells me to use another method, the one below it in my code.

What can I do?

Edit: Why I was using the deprecated method:

One less than ideal aspect of the bootstrap file in the original Hello World is that there are a lot of Zend_Loader::loadClass() calls to load up the classes we need before we use them.

In larger applications, there are even more classes in use, resulting in clutter throughout the application just to ensure that the right classes are included at the right time.

For our Places website, we use PHP’s __autoload() functionality so that PHP will automatically load our classes for us. PHP5 introduced the __autoload() magic function that is called whenever you try to instantiate a class that hasn’t yet been defined.

The Zend_Loader class has a special registerAutoload() method specifically for use with __autoload(), as shown in listing 3.1 b. This method will automatically use PHP5’s Standard PHP Library (SPL) spl_autoload_register() function so that multiple autoloaders can be used.

After Zend_Loader::registerAutoload() has been called, whenever a class is instantiated that has not yet been defined, the file containing the class is included. This solves the problem of Zend_Loader::loadClass() clutter and ensures that only the needed files are loaded for any given request.


Because Autoloading was changed in ZF1.8 you should replace

require_once 'Zend/Loader.php';


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

or use the fallback autoloader with


Depending on the age of your tutorial, I suggest checking out the tutorial for the recent ZF1.10 at Rob Allen's blog as well.

Need Your Help

How to append data to XML file using C#

c# .net xml winforms

I have a image loaded in a picture box.When i click on the image there is some data(not required here) which will be stored in an XML file.But the problem is when ever i click the mouse on image, ...

RuntimeException & Error

java runtime-error runtimeexception

In the exceptions hierarchy, the descendants of

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.