ZF-8299: getPluginResource tries to load already defined class

Issue Type: Bug Created: 2009-11-13T02:39:37.000+0000 Last Updated: 2011-08-21T13:53:39.000+0000 Status: Resolved Fix version(s): Reporter: Edwin Vlieg (edwinv) Assignee: Pádraic Brady (padraic) Tags: - Zend_Application

  • zf-crteam-padraic
  • zf-crteam-priority

Related issues: - ZF-8225



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.


Posted by Pádraic Brady (padraic) on 2011-08-21T13:48:42.000+0000

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.

Posted by Pádraic Brady (padraic) on 2011-08-21T13:53:39.000+0000

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.