ZF-8509: CLONE -Zend_Application_Bootstrap_BootstrapAbstract::hasResourcePlugin() causes warnings.

Description

Zend_Application_Bootstrap_BootstrapAbstract::hasResourcePlugin() causes warnings.

See the next code:


require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()
    ->suppressNotFoundWarnings(false)
    ->setFallbackAutoloader(true);
$bootstrap = new Zend_Application_Bootstrap_Bootstrap(new Zend_Application('test'));
if ($bootstrap->hasPluginResource('foo')) {   // causes warnings.
}

This warning caused by Zend_Application_Bootstrap_BootstrapAbstract::getPluginResource($resource) method. See the next code:


    public function getPluginResource($resource)
    {
        //...
            if (class_exists($plugin)) {    // <-- here. May be need to be class_exists($plugin, false);
                $spec = (array) $spec;
                $spec['bootstrap'] = $this;
                $instance = new $plugin($spec);
                $pluginName = $this->_resolvePluginResourceName($instance);
                unset($this->_pluginResources[$plugin]);
                $this->_pluginResources[$pluginName] = $instance;

                if (0 === strcasecmp($resource, $pluginName)) {
                    return $instance;
                }
            }
        //...
    }

Comments

Please try the following code:


$bootstrap = new Zend_Application_Bootstrap_Bootstrap(new Zend_Application('test'));
if ($bootstrap->hasPluginResource('test')) {}

Causes warnings:


Warning: include(FrontController.php) [function.include]: failed to open stream: No such file or directory in Z:\usr\local\php-5.2.8\include\Zend\Loader.php on line 136

Warning: include() [function.include]: Failed opening 'FrontController.php' for inclusion (include_path='Z:\home\localhost\www/library;.;z:/usr/local/php-5.2.8/include') in Z:\usr\local\php-5.2.8\include\Zend\Loader.php on line 136

I checked out last working copy from a repositary in problem still here.

Since you already noticed it is a duplicate of a non-issue. Do you agree with me to close this issue as 'duplicate'?

No, problem still in SVN repositary.

But problem may be caused no this line: if (class_exists($plugin)) {. Please try the code that I have posted.

The problem is that if we fixed it by adding a 2nd parameter, other people's code breaks. You appear to rely on the fallback autoloader here, and that's not supported. Please see the issue this one duplicates for more info.

Closing as duplicate