Zend Framework

autoloading issue with the fallback autoloader

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4
  • Fix Version/s: 1.9.1
  • Component/s: Zend_Application
  • Labels:
    None

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.

Issue Links

Activity

Hide
Miroslav Kubelik added a comment -

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

Show
Miroslav Kubelik added a comment - I have same problem, I think you have to have also set suppressNotFoundWarnings(false) for "global" autoloader to see this warnings.
Hide
Jurrien Stutterheim added a comment -

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

Show
Jurrien Stutterheim added a comment - Could you try and reproduce this issue with 1.8.4? The solution to ZF-7002 might have fixed this.
Hide
Martin Adler added a comment -

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.

Show
Martin Adler added a comment - 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.
Hide
Miroslav Kubelik added a comment -

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?

Show
Miroslav Kubelik added a comment - 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?
Hide
Miroslav Kubelik added a comment -

patch to solve this is in ZF-7224

Show
Miroslav Kubelik added a comment - patch to solve this is in ZF-7224
Hide
Matthew Weier O'Phinney added a comment -

Patch applied in trunk and 1.9 release branch

Show
Matthew Weier O'Phinney added a comment - Patch applied in trunk and 1.9 release branch
Hide
Margus Sipria added a comment -

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

Show
Margus Sipria added a comment - this bug should be opened again, patch has removed in the favor of ZF-7696

People

Vote (4)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: