Unable to override Zend_Loader_Autoloader class

I use Zend Debugger to debug my php application built on top of the Zend Framework. I am currently running version 1.10.6. When debugging my application, I get this error:

Compile Error: /var/www/Zend/ZendFramework-1.10.6/library/Zend/Loader/Autoloader.php line 36 - Cannot redeclare class Zend_Loader_Autoloader

Is this just a bug in the Zend Framework or has something to do with the wrong configuration in my application.php application?

$paths = array(

    realpath(dirname(__FILE__).'/../library'),
    '.',
);
*/


defined('APPLICATION_PATH') 
    or define('APPLICATION_PATH', realpath(dirname(__FILE__).'/../application'));
defined('APPLICATION_ENV')
    or define('APPLICATION_ENV', 'development');

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH.'/../library'),
)));    


//require_once('Zend/Loader/Autoloader.php');   
require_once('Zend/Application.php');

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH.'/configs/events.ini'  
);

$application->bootstrap()->run();
+3
source share
3 answers

You may have included () - ing or require () in a file somewhere without knowing it. Try sticking to this code at the top of Autoloader.php:

if (!isset($GLOBALS['zend_autoloader_loaded'])) {
    $GLOBALS['zend_autoloader_loaded'] = true;
}
else {
    print_r(debug_backtrace());
    die;
}

The trace will indicate where Autoloader.php is required a second time.

+2

zend optimizer, zend

+3

, Zend Server, , , .

+1

Source: https://habr.com/ru/post/1757183/


All Articles