From 39852138126e0cca81ecf2a360e41406107f0824 Mon Sep 17 00:00:00 2001 From: phpnut Date: Sat, 29 Oct 2005 03:13:36 +0000 Subject: [PATCH] [1262] Author: phpnut Date: 10:10:22 PM, Friday, October 28, 2005 Message: Fixed errors found in the sessions class Removed code in Model::findAll that was no longer needed git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1263 3807eeeb-6ff5-0310-8944-8be069107fe0 --- VERSION.txt | 2 +- cake/libs/controller/components/session.php | 14 +++++++---- cake/libs/model/model.php | 23 +----------------- cake/libs/session.php | 26 +++++++++++++-------- 4 files changed, 27 insertions(+), 38 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 10deb44ea..d3709ffff 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -0.10.2.1260_alpha \ No newline at end of file +0.10.2.1263_alpha \ No newline at end of file diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 88648f438..e13fae581 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -39,7 +39,7 @@ * @since CakePHP v 0.10.0.1232 * */ -class Session extends Object +class SessionComponent extends Object { /** @@ -54,7 +54,7 @@ class Session extends Object /** * Enter description here... * - * Use like this. $this->session->write('Controller.sessKey', 'session value'); + * Use like this. $this->Session->write('Controller.sessKey', 'session value'); * * @param unknown_type $name * @param unknown_type $value @@ -68,7 +68,7 @@ class Session extends Object /** * Enter description here... * - * Use like this. $this->session->read('Controller.sessKey'); + * Use like this. $this->Session->read('Controller.sessKey'); * * @param unknown_type $name * @return unknown @@ -81,7 +81,7 @@ class Session extends Object /** * Enter description here... * - * Use like this. $this->session->del('Controller.sessKey'); + * Use like this. $this->Session->del('Controller.sessKey'); * * @param unknown_type $name * @return unknown @@ -94,7 +94,7 @@ class Session extends Object /** * Enter description here... * - * Use like this. $this->session->check('Controller.sessKey'); + * Use like this. $this->Session->check('Controller.sessKey'); * * @param unknown_type $name * @return unknown @@ -107,6 +107,8 @@ class Session extends Object /** * Enter description here... * + * Use like this. $this->Session->error(); + * * @return unknown */ function error() @@ -117,6 +119,8 @@ class Session extends Object /** * Enter description here... * + * Use like this. $this->Session->valid(); + * * @param unknown_type $name * @return unknown */ diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 537866fc6..b96bf32b9 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1111,28 +1111,7 @@ class Model extends Object $data = $newValue; } } - - - foreach ($data as $key => $value) - { - foreach ($this->tableToModel as $key1 => $value1) - { - if (isset($data[$key][Inflector::singularize($key1)])) - { - $newData[$key][$value1] = $data[$key][Inflector::singularize($key1)]; - } - } - } - - if (!empty($newData)) - { - $merged = array_merge_recursive($data,$newData); - return $newData; - } - else - { - return $data; - } + return $data; } /** diff --git a/cake/libs/session.php b/cake/libs/session.php index c13457815..c15dd4176 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -156,13 +156,14 @@ class CakeSession extends Object */ function getError($errorNumber) { - if(!is_array($this->error) || !array_key_exists($errorNumber, $this->error)) + $cakeSession =& CakeSession::getInstance(); + if(!is_array($cakeSession->error) || !array_key_exists($errorNumber, $cakeSession->error)) { return false; } else { - return $this->error[$errorNumber]; + return $cakeSession->error[$errorNumber]; } } @@ -173,9 +174,10 @@ class CakeSession extends Object */ function getLastError() { - if($this->lastError) + $cakeSession =& CakeSession::getInstance(); + if($cakeSession->lastError) { - return $this->getError($this->lastError); + return $cakeSession->getError($cakeSession->lastError); } else { @@ -190,7 +192,8 @@ class CakeSession extends Object */ function isValid() { - return $this->valid; + $cakeSession =& CakeSession::getInstance(); + return $cakeSession->valid; } /** @@ -207,7 +210,7 @@ class CakeSession extends Object $result = eval("return ".$cakeSession->_sessionVarNames($name).";"); return $result; } - $this->_setError(2, "$name doesn't exist"); + $cakeSession->_setError(2, "$name doesn't exist"); return false; } @@ -474,6 +477,7 @@ class CakeSession extends Object */ function _sessionVarNames($name) { + $cakeSession =& CakeSession::getInstance(); if(is_string($name)) { if(strpos($name, ".")) @@ -492,6 +496,7 @@ class CakeSession extends Object } return $expression; } + $cakeSession->setError(3, "$name is not a string"); return false; } @@ -504,13 +509,14 @@ class CakeSession extends Object */ function _setError($errorNumber, $errorMessage) { - if($this->error === false) + $cakeSession =& CakeSession::getInstance(); + if($cakeSession->error === false) { - $this->error = array(); + $cakeSession->error = array(); } - $this->error[$errorNumber] = $errorMessage; - $this->lastError = $errorNumber; + $cakeSession->error[$errorNumber] = $errorMessage; + $cakeSession->lastError = $errorNumber; } /**