a few more corrections

This commit is contained in:
euromark 2014-04-08 01:49:33 +02:00
parent 0ece694a75
commit a7744e6ff4
4 changed files with 6 additions and 6 deletions

View file

@ -264,7 +264,7 @@ class DbConfigTask extends AppShell {
$temp = get_class_vars(get_class($db)); $temp = get_class_vars(get_class($db));
foreach ($temp as $configName => $info) { foreach ($temp as $configName => $info) {
$info = array_merge($this->_defaultConfig, $info); $info += $this->_defaultConfig;
if (!isset($info['schema'])) { if (!isset($info['schema'])) {
$info['schema'] = null; $info['schema'] = null;
@ -307,7 +307,7 @@ class DbConfigTask extends AppShell {
$out .= "class DATABASE_CONFIG {\n\n"; $out .= "class DATABASE_CONFIG {\n\n";
foreach ($configs as $config) { foreach ($configs as $config) {
$config = array_merge($this->_defaultConfig, $config); $config += $this->_defaultConfig;
extract($config); extract($config);
if (strpos($datasource, 'Database/') === false) { if (strpos($datasource, 'Database/') === false) {

View file

@ -92,7 +92,7 @@ class Component extends Object {
*/ */
public function __get($name) { public function __get($name) {
if (isset($this->_componentMap[$name]) && !isset($this->{$name})) { if (isset($this->_componentMap[$name]) && !isset($this->{$name})) {
$settings = array_merge((array)$this->_componentMap[$name]['settings'], array('enabled' => false)); $settings = array('enabled' => false) + (array)$this->_componentMap[$name]['settings'];
$this->{$name} = $this->_Collection->load($this->_componentMap[$name]['class'], $settings); $this->{$name} = $this->_Collection->load($this->_componentMap[$name]['class'], $settings);
} }
if (isset($this->{$name})) { if (isset($this->{$name})) {

View file

@ -1135,7 +1135,7 @@ class CakeEmail {
if (!is_array($this->_config['log'])) { if (!is_array($this->_config['log'])) {
$this->_config['log'] = array('level' => $this->_config['log']); $this->_config['log'] = array('level' => $this->_config['log']);
} }
$config = array_merge($config, $this->_config['log']); $config = $this->_config['log'] + $config;
} }
CakeLog::write( CakeLog::write(
$config['level'], $config['level'],
@ -1199,7 +1199,7 @@ class CakeEmail {
} }
$config = $configs->{$config}; $config = $configs->{$config};
} }
$this->_config = array_merge($this->_config, $config); $this->_config = $config + $this->_config;
if (!empty($config['charset'])) { if (!empty($config['charset'])) {
$this->charset = $config['charset']; $this->charset = $config['charset'];
} }

View file

@ -119,7 +119,7 @@ class ClassRegistry {
if (is_array($settings)) { if (is_array($settings)) {
$pluginPath = null; $pluginPath = null;
$settings = array_merge($defaults, $settings); $settings += $defaults;
$class = $settings['class']; $class = $settings['class'];
list($plugin, $class) = pluginSplit($class); list($plugin, $class) = pluginSplit($class);