This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via a64d640d1933b3d598afff24fac0c2a8e8f85016 (commit)
from eb086e4de63d19515064221da5a6bf55cef05d51 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a64d640d1933b3d598afff24fac0c2a8e8f85016
Author: Ivan Borzenkov <iva...@li...>
Date: Sun Jun 12 01:07:56 2011 +0400
Используется array_replace_recursive
diff --git a/QFW/QuickFW/Config.php b/QFW/QuickFW/Config.php
index cd93802..c1af2a7 100644
--- a/QFW/QuickFW/Config.php
+++ b/QFW/QuickFW/Config.php
@@ -120,7 +120,7 @@ class QuickFW_Config implements ArrayAccess
$new = $config;
if (!empty($new))
$data = (is_array($data) && is_array($new)) ?
- array_merge_replace_recursive($data, $new) : $new;
+ array_replace_recursive($data, $new) : $new;
}
return $data;
}
@@ -132,36 +132,3 @@ class QuickFW_Config implements ArrayAccess
public function __unset($offset) { return $this->offsetUnset($offset); }
}
-
-/**
- * Merges any number of arrays of any dimensions, the later overwriting
- * previous keys, unless the key is numeric, in whitch case, duplicated
- * values will not be added.
- *
- * The arrays to be merged are passed as arguments to the function.
- *
- * @access public
- * @return array Resulting array, once all have been merged
- */
-function array_merge_replace_recursive()
-{
- // Holds all the arrays passed
- $params = func_get_args();
- // First array is used as the base, everything else overwrites on it
- $return = array_shift($params);
- // Merge all arrays on the first array
- foreach ($params as $array)
- foreach ($array as $key => $value)
- // Numeric keyed values are added (unless already there)
- if (is_numeric($key) && (!in_array($value, $return)))
- if (is_array($value))
- $return[] = array_merge_replace_recursive($return[$key], $value);
- else
- $return[] = $value;
- else // String keyed values are replaced
- if (isset($return[$key]) && is_array($value) && is_array($return[$key]))
- $return[$key] = array_merge_replace_recursive($return[$key], $value);
- else
- $return[$key] = $value;
- return $return;
-}
-----------------------------------------------------------------------
Summary of changes:
QFW/QuickFW/Config.php | 35 +----------------------------------
1 files changed, 1 insertions(+), 34 deletions(-)
hooks/post-receive
--
quickfw
|