lithium\storage\session\adapter\Php::overwrite()
Overwrites session keys and values.
Parameters
-
array
$old
Reference to the array that needs to be overwritten. Will usually be
$_SESSION
. -
array
$new
The data that should overwrite the keys/values in
$old
.
Returns
booleanAlways true
.
Source
public function overwrite(&$old, $new) {
if (!empty($old)) {
foreach ($old as $key => $value) {
if (!isset($new[$key])) {
unset($old[$key]);
}
}
}
foreach ($new as $key => $value) {
$old[$key] = $value;
}
return true;
}