HostOnNet Blog

registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0

On a new Zend Framework project created with Zend Studio, accessing the public folder, git following error

Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in /usr/local/zend/share/ZendFramework/library/Zend/Loader.php on line 207

This was fixed by editing Initializer.php

Find

require_once "Zend/Loader.php"; 

Replace with

require_once 'Zend/Loader/Autoloader.php';

Find

Zend_Loader::registerAutoload();

Replace with

$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('App_');

Posted in PHP

  • solat

    AOA

    it works. but when I placed a class in models
    it says that ‘class not found’
    but If I go with old one then model class in picked by frame work.
    Regards
    Solat

  • Add following code

    $autoloader->setFallbackAutoloader(true);

    After

    $loader = Zend_Loader_Autoloader::getInstance();

    It will work.

  • mesay

    thanks! it works!!