Permalink
Browse files

Removing method chaining from core session library & adding assign by…

… references for php4 compatibility.
  • Loading branch information...
1 parent cadc64c commit 75f303f7b8598e5230b97258889906103be220cb @jperras jperras committed Apr 14, 2009
Showing with 9 additions and 5 deletions.
  1. +9 −5 cake/libs/session.php
View
14 cake/libs/session.php
@@ -698,7 +698,7 @@ function __close() {
* @access private
*/
function __read($id) {
- $model = ClassRegistry::getObject('Session');
+ $model =& ClassRegistry::getObject('Session');
$row = $model->find('first', array(
'conditions' => array($model->primaryKey => $id)
@@ -733,7 +733,9 @@ function __write($id, $data) {
}
$expires = time() + Configure::read('Session.timeout') * $factor;
- $return = ClassRegistry::getObject('Session')->save(compact('id', 'data', 'expires'));
+
+ $model =& ClassRegistry::getObject('Session');
+ $return = $model->save(compact('id', 'data', 'expires'));
return $return;
}
@@ -745,7 +747,9 @@ function __write($id, $data) {
* @access private
*/
function __destroy($id) {
- $return = ClassRegistry::getObject('Session')->delete($id);
+ $model =& ClassRegistry::getObject('Session');
+ $return = $model->delete($id);
+
return $return;
}
/**
@@ -756,13 +760,13 @@ function __destroy($id) {
* @access private
*/
function __gc($expires = null) {
- $model = ClassRegistry::getObject('Session');
+ $model =& ClassRegistry::getObject('Session');
if (!$expires) {
$expires = time();
}
- $return = $model->deleteAll(array("$alias.expires <" => $expires), false, false);
+ $return = $model->deleteAll(array("$alias.expires <" => $expires), false, false);
return $return;
}
}

0 comments on commit 75f303f

Please sign in to comment.