mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Removing reference assignments.
This commit is contained in:
parent
5257a66fe5
commit
465b15c64e
1 changed files with 5 additions and 14 deletions
|
@ -55,8 +55,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
* @access private
|
||||
*/
|
||||
public static function read($id) {
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
|
||||
$model = ClassRegistry::getObject('Session');
|
||||
$row = $model->find('first', array(
|
||||
'conditions' => array($model->primaryKey => $id)
|
||||
));
|
||||
|
@ -78,9 +77,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
*/
|
||||
public static function write($id, $data) {
|
||||
$expires = time() + (Configure::read('Session.timeout') * 60);
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
$return = $model->save(compact('id', 'data', 'expires'));
|
||||
return $return;
|
||||
return ClassRegistry::getObject('Session')->save(compact('id', 'data', 'expires'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,10 +88,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
* @access private
|
||||
*/
|
||||
public static function destroy($id) {
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
$return = $model->delete($id);
|
||||
|
||||
return $return;
|
||||
return ClassRegistry::getObject('Session')->delete($id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,13 +99,10 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
* @access private
|
||||
*/
|
||||
public static function gc($expires = null) {
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
|
||||
if (!$expires) {
|
||||
$expires = time();
|
||||
}
|
||||
|
||||
$return = $model->deleteAll(array($model->alias . ".expires <" => $expires), false, false);
|
||||
return $return;
|
||||
$model = ClassRegistry::getObject('Session');
|
||||
return $model->deleteAll(array($model->alias . ".expires <" => $expires), false, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue