Upgrade CakePHP from 2.2.5 to 2.9.5

This commit is contained in:
Brm Ko 2017-02-26 15:29:44 +01:00
parent 5a580df460
commit 235a541597
793 changed files with 60746 additions and 23753 deletions

View file

@ -2,19 +2,18 @@
/**
* SessionComponent. Provides access to Sessions from the Controller layer
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Controller.Component
* @since CakePHP(tm) v 0.10.0.1232
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
App::uses('Component', 'Controller');
@ -35,21 +34,21 @@ class SessionComponent extends Component {
* Get / Set the userAgent
*
* @param string $userAgent Set the userAgent
* @return void
* @return string Current user agent.
*/
public function userAgent($userAgent = null) {
return CakeSession::userAgent($userAgent);
}
/**
* Used to write a value to a session key.
* Writes a value to a session key.
*
* In your controller: $this->Session->write('Controller.sessKey', 'session value');
*
* @param string $name The name of the key your are setting in the session.
* This should be in a Controller.key format for better organizing
* @param string $value The value you want to store in a session.
* @return boolean Success
* @return bool Success
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::write
*/
public function write($name, $value = null) {
@ -57,7 +56,7 @@ class SessionComponent extends Component {
}
/**
* Used to read a session values for a key or return values for all keys.
* Reads a session value for a key or returns values for all keys.
*
* In your controller: $this->Session->read('Controller.sessKey');
* Calling the method without a param will return all session vars
@ -71,12 +70,12 @@ class SessionComponent extends Component {
}
/**
* Wrapper for SessionComponent::del();
* Deletes a session value for a key.
*
* In your controller: $this->Session->delete('Controller.sessKey');
*
* @param string $name the name of the session key you want to delete
* @return boolean true is session variable is set and can be deleted, false is variable was not set.
* @return bool true is session variable is set and can be deleted, false is variable was not set.
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::delete
*/
public function delete($name) {
@ -84,12 +83,24 @@ class SessionComponent extends Component {
}
/**
* Used to check if a session variable is set
* Reads and deletes a session value for a key.
*
* In your controller: `$this->Session->consume('Controller.sessKey');`
*
* @param string $name the name of the session key you want to read
* @return mixed values from the session vars
*/
public function consume($name) {
return CakeSession::consume($name);
}
/**
* Checks if a session variable is set.
*
* In your controller: $this->Session->check('Controller.sessKey');
*
* @param string $name the name of the session key you want to check
* @return boolean true is session variable is set, false if not
* @return bool true is session variable is set, false if not
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::check
*/
public function check($name) {
@ -122,6 +133,7 @@ class SessionComponent extends Component {
* @param string $key Message key, default is 'flash'
* @return void
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#creating-notification-messages
* @deprecated 3.0.0 Since 2.7, use the FlashComponent instead.
*/
public function setFlash($message, $element = 'default', $params = array(), $key = 'flash') {
CakeSession::write('Message.' . $key, compact('message', 'element', 'params'));
@ -143,7 +155,7 @@ class SessionComponent extends Component {
*
* In your controller: $this->Session->valid();
*
* @return boolean true is session is valid, false is session is invalid
* @return bool true is session is valid, false is session is invalid
*/
public function valid() {
return CakeSession::valid();
@ -165,7 +177,7 @@ class SessionComponent extends Component {
* Get/Set the session id.
*
* When fetching the session id, the session will be started
* if it has not already been started. When setting the session id,
* if it has not already been started. When setting the session id,
* the session will not be started.
*
* @param string $id Id to use (optional)
@ -181,7 +193,7 @@ class SessionComponent extends Component {
/**
* Returns a bool, whether or not the session has been started.
*
* @return boolean
* @return bool
*/
public function started() {
return CakeSession::started();