Issues

ZF-6658: autoloading issue with the fallback autoloader

Description

I've enabled the fallback autoloader in my application bootstrap.

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initFallbackAutoload() { Zend_Loader_Autoloader::getInstance() ->setFallbackAutoloader(true) ; } [...] }

This leads to the following error messages. Warning: include(Module/Bootstrap.php) [function.include]: failed to open stream: No such file or directory in /path/to/library/Zend/Loader.php on line 83

Warning: include() [function.include]: Failed opening 'Module/Bootstrap.php' for inclusion (include_path='/path/to/library:.:/usr/local/lib/php') in /path/to/library/Zend/Loader.php on line 83

Warning: include(FrontController.php) [function.include]: failed to open stream: No such file or directory in /path/to/library/Zend/Loader.php on line 83

Warning: include() [function.include]: Failed opening 'FrontController.php' for inclusion (include_path='/path/to/library:.:/usr/local/lib/php') in /path/to/library/Zend/Loader.php on line 83

But the module bootstrap and the front controller would be loaded.

Comments

I have same problem, I think you have to have also set suppressNotFoundWarnings(false) for "global" autoloader to see this warnings.

Could you try and reproduce this issue with 1.8.4? The solution to ZF-7002 might have fixed this.

Now I have tested this issue against Zend Framework 1.8.4 Release (r16258). It still throws both warnings related to the FrontController.php as explained in the description, but the module bootstrap will be loaded without any warnings now.

I also test it with ZF 1.8.4 (r16258) in real app and I think that everything is OK, no warnings for Module/Bootstrap.php and no for FrontController.php. But there is one problem I think.

At all events, ZF 7002 fixed the Module/Bootstrap.php warnings.

FrontController.php warnings are gone because the front controller resource plugin is initialized in the constructor of Zend_Application_Bootstrap_Bootstrap, this is parent for main boostraps in most situations.

But in situation, when the front controller plugin is initialized only from module bootstrap via code from Zend_Application_Module_Bootstrap constructor:

       //ZF-6545: ensure front controller resource is loaded
        if (!$this->hasPluginResource('FrontController')) {
            $this->registerPluginResource('FrontController');
        } 

warnings related to FrontController.php can be populated, because code

if (class_exists($plugin)) { ...

is used in the Zend_Application_Bootstrap_BootstrapAbstract::getPluginResource() as described in the dependent issue.

But is this situation real - when Zend_Application_Bootstrap_Bootstrap isn't used and Zend_Application_Module_Bootstrap is?

patch to solve this is in ZF-7224

Patch applied in trunk and 1.9 release branch

this bug should be opened again, patch has removed in the favor of ZF-7696