[Phpmyadmin-devel] Re: problem with PMA_array_merge_recursive()

Michal Čihař michal at cihar.com
Fri Jan 6 05:33:17 CET 2006


Hi Marc

On Thu, 05 Jan 2006 14:38:40 -0500
Marc Delisle <Marc.Delisle at cegepsherbrooke.qc.ca> wrote:

> can someone have a look at this, as I'm not familiar with this function.
> Here is my problem: in config.default.php we have
> 
> $cfg['ForeignKeyDropdownOrder'] =  array( 'content-id', 'id-content');
> 
> If in config.inc.php I put
> $cfg['ForeignKeyDropdownOrder'] =  array( 'content-id');
> 
> the effective $cfg['ForeignKeyDropdownOrder'] after the merge contains
> 2 values and not just one are I configured.
> 
> This problem can potentially happen with any directive containing an array.

Problem is that it merges also array which do not contain
configuration. We need to merge stuff like:

$cfg['A']['B'] = 'something';
$cfg['A']['C'] = 'something';

But we need to avoid merging of 

$cfg['D'] = array('a', 'b');

I do simmilar think in setup.php while generating configuration, by
checking array type. You might want to look at function get_cfg_val.

-- 
	Michal Čihař | http://cihar.com




More information about the Developers mailing list