mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 10:32:40 +00:00
Implementing prefix-based routing, and transitioning configuration away from global constants
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5531 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
82b263a8aa
commit
3e7044d4b8
14 changed files with 219 additions and 113 deletions
|
@ -518,22 +518,31 @@ class Set extends Object {
|
|||
$val2 = $val1;
|
||||
$val1 = $this->get();
|
||||
}
|
||||
|
||||
if (is_object($val2) && (is_a($val2, 'set') || is_a($val2, 'Set'))) {
|
||||
$val2 = $val2->get();
|
||||
}
|
||||
|
||||
$out = array();
|
||||
|
||||
if (empty($val1)) {
|
||||
return (array)$val2;
|
||||
} elseif (empty($val2)) {
|
||||
return (array)$val1;
|
||||
}
|
||||
|
||||
foreach ($val1 as $key => $val) {
|
||||
if (isset($val2[$key]) && $val2[$key] != $val) {
|
||||
$out[$key] = $val;
|
||||
} elseif (!array_key_exists($key, $val2)) {
|
||||
$out[$key] = $val;
|
||||
}
|
||||
unset($val2[$key]);
|
||||
}
|
||||
|
||||
foreach ($val2 as $key => $val) {
|
||||
if (!isset($out[$key])) {
|
||||
$out[$key] = $val;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue