mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge branch '2.0' of github.com:cakephp/cakephp into 2.0
This commit is contained in:
commit
73057b8853
1 changed files with 6 additions and 12 deletions
|
@ -85,7 +85,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
* @access private
|
||||
*/
|
||||
public function read($id) {
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
$model = ClassRegistry::getObject('Session');
|
||||
|
||||
$row = $model->find('first', array(
|
||||
'conditions' => array($model->primaryKey => $id)
|
||||
|
@ -108,9 +108,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
*/
|
||||
public 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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,10 +119,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
* @access private
|
||||
*/
|
||||
public function destroy($id) {
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
$return = $model->delete($id);
|
||||
|
||||
return $return;
|
||||
return ClassRegistry::getObject('Session')->delete($id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,13 +130,12 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
* @access private
|
||||
*/
|
||||
public function gc($expires = null) {
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
$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