Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.6
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Application_Resource
-
Labels:None
Description
I was writing a Resource where I was always missing the first option inside My_Application_Resource_Foo::init();
Some Code:
--------------------------------------------------------
$options = array(
array('someData'),
array('someMoreData'),
);
$resource = new My_Application_Resource_Foo($options);
$resource->init();
--------------------------------------------------------
The problem is when $options is an array with numeric indizes the 0 always gets dropped because of this line:
if ('bootstrap' == $key) {
unset($options[$key]);
}
in Zend_Application_Resource_ResourceAbstract::setOptions()
because ('bootstrap' == 0) == true
using === instead of == fixed the problem for me:
if ('bootstrap' === $key) {
unset($options[$key]);
}
}
Fixed in trunk.