Description

When Zend_Application_Bootstrap_BootstrapAbstract::getPluginResource($plugin) tries to find $plugin, it loops through the ini/array specified resource plugins in order, loading them along the way. At the end of the loop it tries a call to class_exists($plugin) to see if it exists (line 354, Zend/Application/Bootstrap/BootstrapAbstract.php). If the class does not exist, a warning is emitted by PHP. (I'm sure whoever's reading this knows all this, just some background).

I have a situation where:

a resource plugin needs to be loaded before the FrontController plugin and the Session plugin, and so BootstrapAbstract tries to load it before the session has started.

I am testing and have errors and warnings displaying.

The emitted warnings from the failed include call in Zend_Loader (Zend/Loader.php, line 83) caused a fatal error when Zend_Session threw an (uncaught) exception, as the warnings emitted had already gone out to the browser.

I have the errors and warnings displayed so I can smoke em' out, but don't need to know about the class not existing warning, which is crashing everything (the warning itself, not the cause of it).

Given that the warning is just saying "I didn't find it on this loop", and isn't describing any bug in the application, I suppressed the warnings by changing line 354 in BootstrapAbstract to:

if (@class_exists($plugin)) {

I don't know how common this kind of situation will be, but it definitely helps it.

Also, as a rule, we only allow the suppression operator in very, very exceptional circumstances. It's expensive, and using it can make debugging many issues incredibly difficult. See if current trunk fixes your issues, and please update with the status.