mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Refactoring SessionHelper and SessionComponent
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4514 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
eaa0881285
commit
b6bc6d6033
3 changed files with 11 additions and 13 deletions
|
@ -161,7 +161,7 @@ class SessionComponent extends CakeSession {
|
|||
*/
|
||||
function error() {
|
||||
if ($this->__active === true) {
|
||||
return parent::getLastError();
|
||||
return parent::error();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ class SessionComponent extends CakeSession {
|
|||
*/
|
||||
function valid() {
|
||||
if ($this->__active === true) {
|
||||
return parent::isValid();
|
||||
return parent::valid();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -257,5 +257,4 @@ class SessionComponent extends CakeSession {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -184,7 +184,7 @@ class CakeSession extends Object {
|
|||
}
|
||||
$this->__setError(3, "$name is not a string");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Removes a variable from session.
|
||||
*
|
||||
|
@ -211,7 +211,7 @@ class CakeSession extends Object {
|
|||
* @return string Error as string
|
||||
* @access public
|
||||
*/
|
||||
function getError($errorNumber) {
|
||||
function __error($errorNumber) {
|
||||
if (!is_array($this->error) || !array_key_exists($errorNumber, $this->error)) {
|
||||
return false;
|
||||
} else {
|
||||
|
@ -224,9 +224,9 @@ class CakeSession extends Object {
|
|||
* @return mixed Error description as a string, or false.
|
||||
* @access public
|
||||
*/
|
||||
function getLastError() {
|
||||
function error() {
|
||||
if ($this->lastError) {
|
||||
return $this->getError($this->lastError);
|
||||
return $this->__error($this->lastError);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ class CakeSession extends Object {
|
|||
* @return boolean
|
||||
* @access public
|
||||
*/
|
||||
function isValid() {
|
||||
function valid() {
|
||||
return $this->valid;
|
||||
}
|
||||
/**
|
||||
|
@ -249,7 +249,7 @@ class CakeSession extends Object {
|
|||
*/
|
||||
function read($name = null) {
|
||||
if (is_null($name)) {
|
||||
return $this->returnSessionVars();
|
||||
return $this->__returnSessionVars();
|
||||
}
|
||||
if (empty($name)) {
|
||||
return false;
|
||||
|
@ -268,7 +268,7 @@ class CakeSession extends Object {
|
|||
* @return mixed Full $_SESSION array, or false on error.
|
||||
* @access public
|
||||
*/
|
||||
function returnSessionVars() {
|
||||
function __returnSessionVars() {
|
||||
if (!empty($_SESSION)) {
|
||||
return $_SESSION;
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ class SessionHelper extends CakeSession {
|
|||
*/
|
||||
function error() {
|
||||
if ($this->__active === true) {
|
||||
return parent::getLastError();
|
||||
return parent::error();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -130,9 +130,8 @@ class SessionHelper extends CakeSession {
|
|||
*/
|
||||
function valid() {
|
||||
if ($this->__active === true) {
|
||||
return parent::isValid();
|
||||
return parent::valid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in a new issue