added PMA_array_merge_recursive()
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2005-12-05 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||
* libraries/common.lib.php: added PMA_array_merge_recursive()
|
||||
|
||||
2005-12-05 Michal Čihař <michal@cihar.com>
|
||||
* many files: Use same script tag, use CDATA for scripts (RFE #995065).
|
||||
* export.php: Check for correct parameters.
|
||||
@@ -36,7 +39,6 @@ $Source$
|
||||
tbl_indexes.php: revised XHTML output
|
||||
* themes/original/css/theme_left|right_css.php: use $GLOBALS
|
||||
|
||||
|
||||
2005-12-01 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||
* libraries/common.lib.php, Theme.class.php:
|
||||
missing '/' in img path (bug #1370437)
|
||||
@@ -64,7 +66,6 @@ $Source$
|
||||
* scripts/setup.php, scripts/upgrade.pl: use class PMA_Config
|
||||
* scripts/create-release.sh: removed references to defines.lib.php
|
||||
|
||||
|
||||
2005-11-29 Michal Čihař <michal@cihar.com>
|
||||
* lang/sync_lang.sh: Add workaround for multibyte chars that can contain \
|
||||
as last byte.
|
||||
|
@@ -400,6 +400,55 @@ function PMA_dl( $module ) {
|
||||
return @dl( $module_file );
|
||||
}
|
||||
|
||||
/**
|
||||
* merges array recursive like array_merge_recursive() but keyed-values are
|
||||
* always overwritten.
|
||||
*
|
||||
* array PMA_array_merge_recursive( array array1 [, array array2 [, array ...]] )
|
||||
*
|
||||
* @see http://php.net/array_merge
|
||||
* @see http://php.net/array_merge_recursive
|
||||
* @uses func_num_args()
|
||||
* @uses func_get_arg()
|
||||
* @uses is_array()
|
||||
* @uses call_user_func_array()
|
||||
* @param array array to merge
|
||||
* @param array array to merge
|
||||
* @param array ...
|
||||
* @return array merged array
|
||||
*/
|
||||
function PMA_array_merge_recursive() {
|
||||
switch( func_num_args() ) {
|
||||
case 0 :
|
||||
return false;
|
||||
break;
|
||||
case 1 :
|
||||
return func_get_arg(0);
|
||||
break;
|
||||
case 2 :
|
||||
$args = func_get_args();
|
||||
if ( ! is_array($args[0]) || ! is_array($args[1]) ) {
|
||||
return $args[1];
|
||||
}
|
||||
foreach ( $args[1] AS $key2 => $value2 ) {
|
||||
if ( isset( $args[0][$key2] ) ) {
|
||||
$args[0][$key2] = PMA_array_merge_recursive($args[0][$key2],
|
||||
$value2);
|
||||
} else {
|
||||
$args[0][$key2] = $value2;
|
||||
}
|
||||
}
|
||||
return $args[0];
|
||||
break;
|
||||
default :
|
||||
$args = func_get_args();
|
||||
$args[1] = PMA_array_merge_recursive($args[0], $args[1]);
|
||||
array_shift($args);
|
||||
return call_user_func_array('PMA_array_merge_recursive', $args);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* include here only libraries which contain only function definitions
|
||||
* no code im main()!
|
||||
|
Reference in New Issue
Block a user