Monday, February 21, 2011

Zend_Loader_Autoload setup

I'm running Zend on a XP machine, and i had my neat layout working etc when i changed something (i'm still experimenting to find out what broke it) but for the moment, this is my debug issue atm

Debug Warning: /BHAA_ZEND/library/Zend/Loader.php line 165 - fopen(./views\helpers/Doctype.php): failed to open stream: No such file or directory
Debug Warning: /BHAA_ZEND/library/Zend/Loader.php line 165 - fopen(./views\helpers/HeadMeta.php): failed to open stream: No such file or directory

Lots of Debug warnings from Zend_Loader_Autoload suggest that the autoloader needs to be set up perfectly, but doesn't suggest any examples. I'm 100% sure that i'm using PATH_SEPERATOR in all my config and ini files. My index.php look like this

<?php
define('BASE_PATH', realpath(dirname(__FILE__) . '/../'));

// Define path to application directory
define('APPLICATION_PATH', BASE_PATH . '/application');

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Include path
set_include_path(
    BASE_PATH . '/library'
    . PATH_SEPARATOR . get_include_path()
);

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

/** Zend_Application */
require_once 'Zend/Application.php';  

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV, 
    APPLICATION_PATH . '/configs/application.ini'
);

$application->bootstrap();
$application->run();
?>

Should i move the AutoLoader to the Bootstrap.php file?

From stackoverflow
  • What did you change? Did you upgrade the Zend Framework Library? Did you change your server environment?

    Why do you include further files if you want to use autoloader?

    jason : And... perfect example of what comments are good for.

0 comments:

Post a Comment