Issues

ZF-8299: getPluginResource tries to load already defined class

Description

I looks like getPluginResource is trying to load a class that is already defined. Therefore it throws a fatal error:

{{Fatal error: Cannot redeclare class Zend_Layout in /Users/edwin/Sites/sqills/lottery_test/library/Zend/layout.php on line 31}}

The fatal error is thrown at line 354 of Zend_Application_Bootstrap_BootstrapAbstract.php in the call of {{class_exists}}.

The error is only thrown once the resource you are trying to load (with {{$this->bootstrap('memcache')}}) doesn't have any entries in the application.ini file. I've defined a resource in my own namespace: {{Lottery_Application_Resource_Memcache}}. In {{bootstrap.php}} I'm using the information in the resource, so I call {{$this->bootstrap('memcache')}} to make sure the resource is loaded. This goes well if the application.ini contains entries for the memcache resource. Once I comment the memcache entries out (because I want to disable the memcache feature), the fatal error occurs.

Comments

Can the reporter check if this is still the case on current trunk? A patch for ZF-8225 has been committed but there no reproduce code this specific included.

Patched in r24393. Reporter should verify as there is no reproduction code with which to test their specific problem. The associated patch should shut out any class which is not a Zend_Application_Resource_Resource subclass which should prevent any unrelated classes getting through.