Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.8.1
-
Component/s: Zend_Application
-
Labels:None
Description
The union operator found in
Zend_Application_Bootstrap_BootstrapAbstract::setOptions() Line 135
}
public function setOptions(array $options)
// ..
$this->_options = $this->_options + $options;
return $this;
}
$a = array ('config'=>array('key1'=>'$a1','key2'=>'$a2'));
$b = array ('config'=>array('key1'=>'$b1','key3'=>'$b2'));
var_dump ($a + $b);
array(1) {
["config"]=>
array(2) {
["key1"]=>
string(3) "$a1"
["key2"]=>
string(3) "$a2"
}
}
'array_merge' does the same in the other direction, it overwrite the value of a existing key, instead of ignoring it. 'array_merge_recursive' will merge two scalar to one array and so it will destroy the config structure.
Zend_Config has a method merge() which act like expected, but its not used here. So the method 'setOptions()' has to convert one config into a 'Zend_Config', merge and deconvert into an array again, or it must implement its own merge-Method.
Version is trunk 15243
[1]http://de.php.net/manual/en/language.operators.array.php
Issue Links
| This issue is related to: | ||||
| ZF-6679 | Items configured from Zend_Application::setOptions() via a config entry do not have their keys cast to lower case |
|
|
|
Resolved in trunk and 1.8 release branch