ZF-7365: Zend_Application_Bootstrap_BootstrapAbstract lower case names convert plugins and array_key_exists


Look at BootStrapAbstract.php function : public function getPluginResource($resource) code: if (array_key_exists(strtolower($resource), $this->_pluginResources)) {

var_dump(strtolower($resource)) = "layout211_resource_layout"

but in the var_dump( $this->_pluginResources) = "Layout211_Resource_Layout" it still as original

Look at PluginLoader.php function: public function setOptions(array $options) code: $options = array_change_key_case($options, CASE_LOWER);

And strlower conversion problem in function: protected function _loadPluginResource($resource, $options) code: $className = $this->getPluginLoader()->load(strtolower($resource), false);

This code convert only first line in array.

If i set Resource name as :

$application->setOptions( $application->mergeOptions( $application->getOptions(), array( 'pluginPaths'=> array( 'Layout211_Resource_Layout'=> APPLICATION_PATH .'/resource' ), 'resources' => array( 'Layout211_Resource_Layout' => array() ) ) ) );


It might not be the best issue description in the world, but there is definitely case consistency issues with plugin resource names in Zend_Application_Bootstrap_BootstrapAbstract. I am battling them right now, in Zend Framework 1.11.11.

Quick example case:

  • MyBootstrap extends Zend_Application_Bootstrap_Bootstrap ;
  • Zend_Application_Bootstrap_Bootstrap::__construct() does $this->registerPluginResource('FrontController') ;
  • In MyBootstrap::__construct(), you might want to do $this->unregisterPluginResource('FrontController'), but it will not work, because unregisterPluginResource() will strtolower('FrontController') but registerPluginResource() registered it as 'FrontController' in $this->_pluginResources.

I have seen many inconsistencies with how $this->_pluginResources is handled in Zend_Application_Bootstrap_BootstrapAbstract. Please review all accesses to $this->_pluginResources and make sure that they are always either case sensitive or not.

Feel free to ask questions about the problem, there is definitely some things to fix in there. Thanks!