Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

This commit is contained in:
Mark Story 2010-09-06 13:39:37 -04:00
commit 73057b8853

View file

@ -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);
}
}