mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removing trailing spaces.
This commit is contained in:
parent
7581db2cf2
commit
16ef234180
58 changed files with 150 additions and 151 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Wincache storage engine for cache.
|
* Wincache storage engine for cache.
|
||||||
*
|
*
|
||||||
* Supports wincache 1.1.0 and higher.
|
* Supports wincache 1.1.0 and higher.
|
||||||
*
|
*
|
||||||
|
@ -67,7 +67,7 @@ class WincacheEngine extends CacheEngine {
|
||||||
* Read a key from the cache
|
* Read a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return mixed The cached data, or false if the data doesn't exist, has expired, or if
|
* @return mixed The cached data, or false if the data doesn't exist, has expired, or if
|
||||||
* there was an error fetching it
|
* there was an error fetching it
|
||||||
*/
|
*/
|
||||||
public function read($key) {
|
public function read($key) {
|
||||||
|
@ -112,7 +112,7 @@ class WincacheEngine extends CacheEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache. This will clear every cache value stored
|
* Delete all keys from the cache. This will clear every cache value stored
|
||||||
* in wincache.
|
* in wincache.
|
||||||
*
|
*
|
||||||
* @param boolean $check
|
* @param boolean $check
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
* You can combine `.` separated values with sections to create more deeply
|
* You can combine `.` separated values with sections to create more deeply
|
||||||
* nested structures.
|
* nested structures.
|
||||||
*
|
*
|
||||||
* IniReader also manipulates how the special ini values of
|
* IniReader also manipulates how the special ini values of
|
||||||
* 'yes', 'no', 'on', 'off', 'null' are handled. These values will be
|
* 'yes', 'no', 'on', 'off', 'null' are handled. These values will be
|
||||||
* converted to their boolean equivalents.
|
* converted to their boolean equivalents.
|
||||||
*
|
*
|
||||||
* @package Cake.Configure
|
* @package Cake.Configure
|
||||||
|
|
|
@ -76,7 +76,7 @@ class CommandListShell extends Shell {
|
||||||
/**
|
/**
|
||||||
* Gets the shell command listing.
|
* Gets the shell command listing.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function _getShellList() {
|
protected function _getShellList() {
|
||||||
$shellList = array();
|
$shellList = array();
|
||||||
|
|
|
@ -52,7 +52,7 @@ class ProjectTask extends Shell {
|
||||||
$prompt = __d('cake_console', "What is the path to the project you want to bake?");
|
$prompt = __d('cake_console', "What is the path to the project you want to bake?");
|
||||||
$project = $this->in($prompt, null, APP . 'myapp');
|
$project = $this->in($prompt, null, APP . 'myapp');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($project && !Folder::isAbsolute($project) && isset($_SERVER['PWD'])) {
|
if ($project && !Folder::isAbsolute($project) && isset($_SERVER['PWD'])) {
|
||||||
$project = $_SERVER['PWD'] . DS . $project;
|
$project = $_SERVER['PWD'] . DS . $project;
|
||||||
|
|
|
@ -20,7 +20,7 @@ App::uses('ConsoleOutput', 'Console');
|
||||||
App::uses('CakeLog', 'Log');
|
App::uses('CakeLog', 'Log');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Error Handler for Cake console. Does simple printing of the
|
* Error Handler for Cake console. Does simple printing of the
|
||||||
* exception that occurred and the stack trace of the error.
|
* exception that occurred and the stack trace of the error.
|
||||||
*
|
*
|
||||||
* @package Cake.Console
|
* @package Cake.Console
|
||||||
|
@ -55,7 +55,7 @@ class ConsoleErrorHandler extends ErrorHandler {
|
||||||
public static function handleException(Exception $exception) {
|
public static function handleException(Exception $exception) {
|
||||||
$stderr = self::getStderr();
|
$stderr = self::getStderr();
|
||||||
$stderr->write(__d('cake_console', "<error>Error:</error> %s\n%s",
|
$stderr->write(__d('cake_console', "<error>Error:</error> %s\n%s",
|
||||||
$exception->getMessage(),
|
$exception->getMessage(),
|
||||||
$exception->getTraceAsString()
|
$exception->getTraceAsString()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Object wrapper for interacting with stdin
|
* Object wrapper for interacting with stdin
|
||||||
*
|
*
|
||||||
* @package Cake.Console
|
* @package Cake.Console
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -85,7 +85,7 @@ class ConsoleInputArgument {
|
||||||
* Generate the help for this argument.
|
* Generate the help for this argument.
|
||||||
*
|
*
|
||||||
* @param integer $width The width to make the name of the option.
|
* @param integer $width The width to make the name of the option.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function help($width = 0) {
|
public function help($width = 0) {
|
||||||
$name = $this->_name;
|
$name = $this->_name;
|
||||||
|
@ -141,7 +141,7 @@ class ConsoleInputArgument {
|
||||||
}
|
}
|
||||||
if (!in_array($value, $this->_choices)) {
|
if (!in_array($value, $this->_choices)) {
|
||||||
throw new ConsoleException(
|
throw new ConsoleException(
|
||||||
__d('cake_console', '"%s" is not a valid value for %s. Please use one of "%s"',
|
__d('cake_console', '"%s" is not a valid value for %s. Please use one of "%s"',
|
||||||
$value, $this->_name, implode(', ', $this->_choices)
|
$value, $this->_name, implode(', ', $this->_choices)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ class ConsoleInputOption {
|
||||||
* Generate the help for this this option.
|
* Generate the help for this this option.
|
||||||
*
|
*
|
||||||
* @param integer $width The width to make the name of the option.
|
* @param integer $width The width to make the name of the option.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function help($width = 0) {
|
public function help($width = 0) {
|
||||||
$default = $short = '';
|
$default = $short = '';
|
||||||
|
|
|
@ -37,7 +37,7 @@ class ConsoleInputSubcommand {
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $_help;
|
protected $_help;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ConsoleOptionParser for this subcommand.
|
* The ConsoleOptionParser for this subcommand.
|
||||||
|
@ -51,7 +51,7 @@ class ConsoleInputSubcommand {
|
||||||
*
|
*
|
||||||
* @param mixed $name The long name of the subcommand, or an array with all the properties.
|
* @param mixed $name The long name of the subcommand, or an array with all the properties.
|
||||||
* @param string $help The help text for this option
|
* @param string $help The help text for this option
|
||||||
* @param mixed $parser A parser for this subcommand. Either a ConsoleOptionParser, or an array that can be
|
* @param mixed $parser A parser for this subcommand. Either a ConsoleOptionParser, or an array that can be
|
||||||
* used with ConsoleOptionParser::buildFromArray()
|
* used with ConsoleOptionParser::buildFromArray()
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $help = '', $parser = null) {
|
public function __construct($name, $help = '', $parser = null) {
|
||||||
|
@ -83,7 +83,7 @@ class ConsoleInputSubcommand {
|
||||||
* Generate the help for this this subcommand.
|
* Generate the help for this this subcommand.
|
||||||
*
|
*
|
||||||
* @param integer $width The width to make the name of the subcommand.
|
* @param integer $width The width to make the name of the subcommand.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function help($width = 0) {
|
public function help($width = 0) {
|
||||||
$name = $this->_name;
|
$name = $this->_name;
|
||||||
|
|
|
@ -232,7 +232,7 @@ class ConsoleOptionParser {
|
||||||
/**
|
/**
|
||||||
* Get or set the description text for shell/task.
|
* Get or set the description text for shell/task.
|
||||||
*
|
*
|
||||||
* @param mixed $text The text to set, or null if you want to read. If an array the
|
* @param mixed $text The text to set, or null if you want to read. If an array the
|
||||||
* text will be imploded with "\n"
|
* text will be imploded with "\n"
|
||||||
* @return mixed If reading, the value of the description. If setting $this will be returned
|
* @return mixed If reading, the value of the description. If setting $this will be returned
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
/**
|
/**
|
||||||
* Object wrapper for outputting information from a shell application.
|
* Object wrapper for outputting information from a shell application.
|
||||||
* Can be connected to any stream resource that can be used with fopen()
|
* Can be connected to any stream resource that can be used with fopen()
|
||||||
*
|
*
|
||||||
* Can generate colorized output on consoles that support it. There are a few
|
* Can generate colorized output on consoles that support it. There are a few
|
||||||
* built in styles
|
* built in styles
|
||||||
*
|
*
|
||||||
* - `error` Error messages.
|
* - `error` Error messages.
|
||||||
|
@ -141,7 +141,7 @@ class ConsoleOutput {
|
||||||
*
|
*
|
||||||
* Checks for a pretty console environment. Ansicon allows pretty consoles
|
* Checks for a pretty console environment. Ansicon allows pretty consoles
|
||||||
* on windows, and is supported.
|
* on windows, and is supported.
|
||||||
*
|
*
|
||||||
* @param string $stream The identifier of the stream to write output to.
|
* @param string $stream The identifier of the stream to write output to.
|
||||||
*/
|
*/
|
||||||
public function __construct($stream = 'php://stdout') {
|
public function __construct($stream = 'php://stdout') {
|
||||||
|
@ -265,7 +265,7 @@ class ConsoleOutput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get/Set the output type to use. The output type how formatting tags are treated.
|
* Get/Set the output type to use. The output type how formatting tags are treated.
|
||||||
*
|
*
|
||||||
* @param integer $type The output type to use. Should be one of the class constants.
|
* @param integer $type The output type to use. Should be one of the class constants.
|
||||||
* @return mixed Either null or the value if getting.
|
* @return mixed Either null or the value if getting.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -180,7 +180,7 @@ class HelpFormatter {
|
||||||
$xml = new SimpleXmlElement('<shell></shell>');
|
$xml = new SimpleXmlElement('<shell></shell>');
|
||||||
$xml->addChild('command', $parser->command());
|
$xml->addChild('command', $parser->command());
|
||||||
$xml->addChild('description', $parser->description());
|
$xml->addChild('description', $parser->description());
|
||||||
|
|
||||||
$xml->addChild('epilog', $parser->epilog());
|
$xml->addChild('epilog', $parser->epilog());
|
||||||
$subcommands = $xml->addChild('subcommands');
|
$subcommands = $xml->addChild('subcommands');
|
||||||
foreach ($parser->subcommands() as $command) {
|
foreach ($parser->subcommands() as $command) {
|
||||||
|
|
|
@ -353,7 +353,7 @@ class Shell extends Object {
|
||||||
} catch (ConsoleException $e) {
|
} catch (ConsoleException $e) {
|
||||||
return $this->out($this->OptionParser->help($command));
|
return $this->out($this->OptionParser->help($command));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->command = $command;
|
$this->command = $command;
|
||||||
if (!empty($this->params['help'])) {
|
if (!empty($this->params['help'])) {
|
||||||
return $this->_displayHelp($command);
|
return $this->_displayHelp($command);
|
||||||
|
|
|
@ -50,7 +50,7 @@ class TaskCollection extends ObjectCollection {
|
||||||
/**
|
/**
|
||||||
* Loads/constructs a task. Will return the instance in the collection
|
* Loads/constructs a task. Will return the instance in the collection
|
||||||
* if it already exists.
|
* if it already exists.
|
||||||
*
|
*
|
||||||
* @param string $task Task name to load
|
* @param string $task Task name to load
|
||||||
* @param array $settings Settings for the task.
|
* @param array $settings Settings for the task.
|
||||||
* @return Task A task object, Either the existing loaded task or a new one.
|
* @return Task A task object, Either the existing loaded task or a new one.
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
App::uses('BaseAuthorize', 'Controller/Component/Auth');
|
App::uses('BaseAuthorize', 'Controller/Component/Auth');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,10 +99,10 @@ abstract class BaseAuthenticate {
|
||||||
abstract public function authenticate(CakeRequest $request, CakeResponse $response);
|
abstract public function authenticate(CakeRequest $request, CakeResponse $response);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows you to hook into AuthComponent::logout(),
|
* Allows you to hook into AuthComponent::logout(),
|
||||||
* and implement specialized logout behaviour.
|
* and implement specialized logout behaviour.
|
||||||
*
|
*
|
||||||
* All attached authentication objects will have this method
|
* All attached authentication objects will have this method
|
||||||
* called when a user logs out.
|
* called when a user logs out.
|
||||||
*
|
*
|
||||||
* @param array $user The user about to be logged out.
|
* @param array $user The user about to be logged out.
|
||||||
|
|
|
@ -34,7 +34,7 @@ abstract class BaseAuthorize {
|
||||||
* @var ComponentCollection
|
* @var ComponentCollection
|
||||||
*/
|
*/
|
||||||
protected $_Collection;
|
protected $_Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings for authorize objects.
|
* Settings for authorize objects.
|
||||||
*
|
*
|
||||||
|
@ -75,7 +75,7 @@ abstract class BaseAuthorize {
|
||||||
* Checks user authorization.
|
* Checks user authorization.
|
||||||
*
|
*
|
||||||
* @param array $user Active user data
|
* @param array $user Active user data
|
||||||
* @param CakeRequest $request
|
* @param CakeRequest $request
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
abstract public function authorize($user, CakeRequest $request);
|
abstract public function authorize($user, CakeRequest $request);
|
||||||
|
|
|
@ -24,7 +24,7 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth');
|
||||||
* Auth must support cookies.
|
* Auth must support cookies.
|
||||||
*
|
*
|
||||||
* ### Using Basic auth
|
* ### Using Basic auth
|
||||||
*
|
*
|
||||||
* In your controller's components array, add auth + the required settings.
|
* In your controller's components array, add auth + the required settings.
|
||||||
* {{{
|
* {{{
|
||||||
* var $components = array(
|
* var $components = array(
|
||||||
|
@ -76,7 +76,7 @@ class BasicAuthenticate extends BaseAuthenticate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticate a user using basic HTTP auth. Will use the configured User model and attempt a
|
* Authenticate a user using basic HTTP auth. Will use the configured User model and attempt a
|
||||||
* login using basic HTTP auth.
|
* login using basic HTTP auth.
|
||||||
*
|
*
|
||||||
* @param CakeRequest $request The request to authenticate with.
|
* @param CakeRequest $request The request to authenticate with.
|
||||||
|
@ -104,7 +104,7 @@ class BasicAuthenticate extends BaseAuthenticate {
|
||||||
public function getUser($request) {
|
public function getUser($request) {
|
||||||
$username = env('PHP_AUTH_USER');
|
$username = env('PHP_AUTH_USER');
|
||||||
$pass = env('PHP_AUTH_PW');
|
$pass = env('PHP_AUTH_PW');
|
||||||
|
|
||||||
if (empty($username) || empty($pass)) {
|
if (empty($username) || empty($pass)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ class ControllerAuthorize extends BaseAuthorize {
|
||||||
* Checks user authorization using a controller callback.
|
* Checks user authorization using a controller callback.
|
||||||
*
|
*
|
||||||
* @param array $user Active user data
|
* @param array $user Active user data
|
||||||
* @param CakeRequest $request
|
* @param CakeRequest $request
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function authorize($user, CakeRequest $request) {
|
public function authorize($user, CakeRequest $request) {
|
||||||
|
|
|
@ -81,9 +81,9 @@ class CrudAuthorize extends BaseAuthorize {
|
||||||
*/
|
*/
|
||||||
public function authorize($user, CakeRequest $request) {
|
public function authorize($user, CakeRequest $request) {
|
||||||
if (!isset($this->settings['actionMap'][$request->params['action']])) {
|
if (!isset($this->settings['actionMap'][$request->params['action']])) {
|
||||||
trigger_error(__d('cake_dev',
|
trigger_error(__d('cake_dev',
|
||||||
'CrudAuthorize::authorize() - Attempted access of un-mapped action "%1$s" in controller "%2$s"',
|
'CrudAuthorize::authorize() - Attempted access of un-mapped action "%1$s" in controller "%2$s"',
|
||||||
$request->action,
|
$request->action,
|
||||||
$request->controller
|
$request->controller
|
||||||
),
|
),
|
||||||
E_USER_WARNING
|
E_USER_WARNING
|
||||||
|
|
|
@ -20,14 +20,14 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth');
|
||||||
*
|
*
|
||||||
* Provides Digest HTTP authentication support for AuthComponent. Unlike most AuthComponent adapters,
|
* Provides Digest HTTP authentication support for AuthComponent. Unlike most AuthComponent adapters,
|
||||||
* DigestAuthenticate requires a special password hash that conforms to RFC2617. You can create this
|
* DigestAuthenticate requires a special password hash that conforms to RFC2617. You can create this
|
||||||
* password using `DigestAuthenticate::password()`. If you wish to use digest authentication alongside other
|
* password using `DigestAuthenticate::password()`. If you wish to use digest authentication alongside other
|
||||||
* authentication methods, its recommended that you store the digest authentication separately.
|
* authentication methods, its recommended that you store the digest authentication separately.
|
||||||
*
|
*
|
||||||
* Clients using Digest Authentication must support cookies. Since AuthComponent identifies users based
|
* Clients using Digest Authentication must support cookies. Since AuthComponent identifies users based
|
||||||
* on Session contents, clients without support for cookies will not function properly.
|
* on Session contents, clients without support for cookies will not function properly.
|
||||||
*
|
*
|
||||||
* ### Using Digest auth
|
* ### Using Digest auth
|
||||||
*
|
*
|
||||||
* In your controller's components array, add auth + the required settings.
|
* In your controller's components array, add auth + the required settings.
|
||||||
* {{{
|
* {{{
|
||||||
* var $components = array(
|
* var $components = array(
|
||||||
|
@ -47,7 +47,7 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth');
|
||||||
*
|
*
|
||||||
* `$digestPass = DigestAuthenticate::password($username, env('SERVER_NAME'), $password);`
|
* `$digestPass = DigestAuthenticate::password($username, env('SERVER_NAME'), $password);`
|
||||||
*
|
*
|
||||||
* Its recommended that you store this digest auth only password separate from password hashes used for other
|
* Its recommended that you store this digest auth only password separate from password hashes used for other
|
||||||
* login methods. For example `User.digest_pass` could be used for a digest password, while `User.password` would
|
* login methods. For example `User.digest_pass` could be used for a digest password, while `User.password` would
|
||||||
* store the password hash for use with other methods like Basic or Form.
|
* store the password hash for use with other methods like Basic or Form.
|
||||||
*
|
*
|
||||||
|
@ -101,7 +101,7 @@ class DigestAuthenticate extends BaseAuthenticate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Authenticate a user using Digest HTTP auth. Will use the configured User model and attempt a
|
* Authenticate a user using Digest HTTP auth. Will use the configured User model and attempt a
|
||||||
* login using Digest HTTP auth.
|
* login using Digest HTTP auth.
|
||||||
*
|
*
|
||||||
* @param CakeRequest $request The request to authenticate with.
|
* @param CakeRequest $request The request to authenticate with.
|
||||||
|
@ -230,7 +230,7 @@ class DigestAuthenticate extends BaseAuthenticate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an auth digest password hash to store
|
* Creates an auth digest password hash to store
|
||||||
*
|
*
|
||||||
* @param string $username The username to use in the digest hash.
|
* @param string $username The username to use in the digest hash.
|
||||||
* @param string $password The unhashed password to make a digest hash for.
|
* @param string $password The unhashed password to make a digest hash for.
|
||||||
|
|
|
@ -38,7 +38,7 @@ class FormAuthenticate extends BaseAuthenticate {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields`
|
* Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields`
|
||||||
* to find POST data that is used to find a matching record in the `settings.userModel`. Will return false if
|
* to find POST data that is used to find a matching record in the `settings.userModel`. Will return false if
|
||||||
* there is no post data, either username or password is missing, of if the scope conditions have not been met.
|
* there is no post data, either username or password is missing, of if the scope conditions have not been met.
|
||||||
*
|
*
|
||||||
* @param CakeRequest $request The request that contains login information.
|
* @param CakeRequest $request The request that contains login information.
|
||||||
|
|
|
@ -109,7 +109,7 @@ class CookieComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* HTTP only cookie
|
* HTTP only cookie
|
||||||
*
|
*
|
||||||
* Set to true to make HTTP only cookies. Cookies that are HTTP only
|
* Set to true to make HTTP only cookies. Cookies that are HTTP only
|
||||||
* are not accessible in Javascript.
|
* are not accessible in Javascript.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
|
@ -205,7 +205,7 @@ class CookieComponent extends Component {
|
||||||
}
|
}
|
||||||
$this->_encrypted = $encrypt;
|
$this->_encrypted = $encrypt;
|
||||||
$this->_expire($expires);
|
$this->_expire($expires);
|
||||||
|
|
||||||
if (!is_array($key)) {
|
if (!is_array($key)) {
|
||||||
$key = array($key => $value);
|
$key = array($key => $value);
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ class CookieComponent extends Component {
|
||||||
*/
|
*/
|
||||||
protected function _write($name, $value) {
|
protected function _write($name, $value) {
|
||||||
$this->_setcookie(
|
$this->_setcookie(
|
||||||
$this->name . $name, $this->_encrypt($value),
|
$this->name . $name, $this->_encrypt($value),
|
||||||
$this->_expires, $this->path, $this->domain, $this->secure, $this->httpOnly
|
$this->_expires, $this->path, $this->domain, $this->secure, $this->httpOnly
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ class CookieComponent extends Component {
|
||||||
*/
|
*/
|
||||||
protected function _delete($name) {
|
protected function _delete($name) {
|
||||||
$this->_setcookie(
|
$this->_setcookie(
|
||||||
$this->name . $name, '',
|
$this->name . $name, '',
|
||||||
time() - 42000, $this->path, $this->domain, $this->secure, $this->httpOnly
|
time() - 42000, $this->path, $this->domain, $this->secure, $this->httpOnly
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ class PaginatorComponent extends Component {
|
||||||
*
|
*
|
||||||
* @param mixed $object Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel')
|
* @param mixed $object Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel')
|
||||||
* @param mixed $scope Additional find conditions to use while paginating
|
* @param mixed $scope Additional find conditions to use while paginating
|
||||||
* @param array $whitelist List of allowed fields for ordering. This allows you to prevent ordering
|
* @param array $whitelist List of allowed fields for ordering. This allows you to prevent ordering
|
||||||
* on non-indexed, or undesirable columns.
|
* on non-indexed, or undesirable columns.
|
||||||
* @return array Model query results
|
* @return array Model query results
|
||||||
* @throws MissingModelException
|
* @throws MissingModelException
|
||||||
|
@ -308,7 +308,7 @@ class PaginatorComponent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate that the desired sorting can be performed on the $object. Only fields or
|
* Validate that the desired sorting can be performed on the $object. Only fields or
|
||||||
* virtualFields can be sorted on. The direction param will also be sanitized. Lastly
|
* virtualFields can be sorted on. The direction param will also be sanitized. Lastly
|
||||||
* sort + direction keys will be converted into the model friendly order key.
|
* sort + direction keys will be converted into the model friendly order key.
|
||||||
*
|
*
|
||||||
|
@ -331,14 +331,14 @@ class PaginatorComponent extends Component {
|
||||||
}
|
}
|
||||||
$options['order'] = array($options['sort'] => $direction);
|
$options['order'] = array($options['sort'] => $direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($whitelist)) {
|
if (!empty($whitelist)) {
|
||||||
$field = key($options['order']);
|
$field = key($options['order']);
|
||||||
if (!in_array($field, $whitelist)) {
|
if (!in_array($field, $whitelist)) {
|
||||||
$options['order'] = null;
|
$options['order'] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($options['order']) && is_array($options['order'])) {
|
if (!empty($options['order']) && is_array($options['order'])) {
|
||||||
$alias = $object->alias ;
|
$alias = $object->alias ;
|
||||||
$key = $field = key($options['order']);
|
$key = $field = key($options['order']);
|
||||||
|
@ -357,7 +357,7 @@ class PaginatorComponent extends Component {
|
||||||
$options['order'][$alias . '.' . $field] = $value;
|
$options['order'][$alias . '.' . $field] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ class RequestHandlerComponent extends Component {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the component, gets a reference to Controller::$parameters, and
|
* Initializes the component, gets a reference to Controller::$parameters, and
|
||||||
* checks to see if a file extension has been parsed by the Router. Or if the
|
* checks to see if a file extension has been parsed by the Router. Or if the
|
||||||
* HTTP_ACCEPT_TYPE is set to a single value that is a supported extension and mapped type.
|
* HTTP_ACCEPT_TYPE is set to a single value that is a supported extension and mapped type.
|
||||||
* If yes, RequestHandler::$ext is set to that value
|
* If yes, RequestHandler::$ext is set to that value
|
||||||
*
|
*
|
||||||
|
@ -172,7 +172,7 @@ class RequestHandlerComponent extends Component {
|
||||||
* Helper method to parse xml input data, due to lack of anonymous functions
|
* Helper method to parse xml input data, due to lack of anonymous functions
|
||||||
* this lives here.
|
* this lives here.
|
||||||
*
|
*
|
||||||
* @param string $xml
|
* @param string $xml
|
||||||
* @return array Xml array data
|
* @return array Xml array data
|
||||||
*/
|
*/
|
||||||
public function _convertXml($xml) {
|
public function _convertXml($xml) {
|
||||||
|
@ -437,7 +437,7 @@ class RequestHandlerComponent extends Component {
|
||||||
if (!$this->request->is('post') && !$this->request->is('put')) {
|
if (!$this->request->is('post') && !$this->request->is('put')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
list($contentType) = explode(';', env('CONTENT_TYPE'));
|
list($contentType) = explode(';', env('CONTENT_TYPE'));
|
||||||
if ($type == null) {
|
if ($type == null) {
|
||||||
return $this->mapType($contentType);
|
return $this->mapType($contentType);
|
||||||
|
@ -498,7 +498,7 @@ class RequestHandlerComponent extends Component {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the layout and template paths for the content type defined by $type.
|
* Sets the layout and template paths for the content type defined by $type.
|
||||||
*
|
*
|
||||||
* ### Usage:
|
* ### Usage:
|
||||||
*
|
*
|
||||||
* Render the response as an 'ajax' response.
|
* Render the response as an 'ajax' response.
|
||||||
|
@ -652,7 +652,7 @@ class RequestHandlerComponent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new mapped input type. Mapped input types are automatically
|
* Add a new mapped input type. Mapped input types are automatically
|
||||||
* converted by RequestHandlerComponent during the startup() callback.
|
* converted by RequestHandlerComponent during the startup() callback.
|
||||||
*
|
*
|
||||||
* @param string $type The type alias being converted, ie. json
|
* @param string $type The type alias being converted, ie. json
|
||||||
|
|
|
@ -140,7 +140,7 @@ class SecurityComponent extends Component {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The duration from when a CSRF token is created that it will expire on.
|
* The duration from when a CSRF token is created that it will expire on.
|
||||||
* Each form/page request will generate a new token that can only be submitted once unless
|
* Each form/page request will generate a new token that can only be submitted once unless
|
||||||
* it expires. Can be any value compatible with strtotime()
|
* it expires. Can be any value compatible with strtotime()
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
|
@ -498,7 +498,7 @@ class SecurityComponent extends Component {
|
||||||
if (!empty($tokenData['csrfTokens']) && is_array($tokenData['csrfTokens'])) {
|
if (!empty($tokenData['csrfTokens']) && is_array($tokenData['csrfTokens'])) {
|
||||||
$token['csrfTokens'] = $this->_expireTokens($tokenData['csrfTokens']);
|
$token['csrfTokens'] = $this->_expireTokens($tokenData['csrfTokens']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->csrfCheck && ($this->csrfUseOnce || empty($token['csrfTokens'])) ) {
|
if ($this->csrfCheck && ($this->csrfUseOnce || empty($token['csrfTokens'])) ) {
|
||||||
$token['csrfTokens'][$authKey] = strtotime($this->csrfExpires);
|
$token['csrfTokens'][$authKey] = strtotime($this->csrfExpires);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ App::uses('CakeSession', 'Model/Datasource');
|
||||||
class SessionComponent extends Component {
|
class SessionComponent extends Component {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get / Set the userAgent
|
* Get / Set the userAgent
|
||||||
*
|
*
|
||||||
* @param string $userAgent Set the userAgent
|
* @param string $userAgent Set the userAgent
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
@ -69,7 +69,7 @@ class ComponentCollection extends ObjectCollection {
|
||||||
* );
|
* );
|
||||||
* }}}
|
* }}}
|
||||||
* All calls to the `Email` component would use `AliasedEmail` instead.
|
* All calls to the `Email` component would use `AliasedEmail` instead.
|
||||||
*
|
*
|
||||||
* @param string $component Component name to load
|
* @param string $component Component name to load
|
||||||
* @param array $settings Settings for the component.
|
* @param array $settings Settings for the component.
|
||||||
* @return Component A component object, Either the existing loaded component or a new one.
|
* @return Component A component object, Either the existing loaded component or a new one.
|
||||||
|
|
|
@ -301,7 +301,7 @@ class Controller extends Object {
|
||||||
*
|
*
|
||||||
* @param CakeRequest $request Request object for this controller. Can be null for testing,
|
* @param CakeRequest $request Request object for this controller. Can be null for testing,
|
||||||
* but expect that features that use the request parameters will not work.
|
* but expect that features that use the request parameters will not work.
|
||||||
* @param CakeResponse $response Response object for this controller.
|
* @param CakeResponse $response Response object for this controller.
|
||||||
*/
|
*/
|
||||||
public function __construct($request = null, $response = null) {
|
public function __construct($request = null, $response = null) {
|
||||||
if ($this->name === null) {
|
if ($this->name === null) {
|
||||||
|
@ -455,7 +455,7 @@ class Controller extends Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispatches the controller action. Checks that the action
|
* Dispatches the controller action. Checks that the action
|
||||||
* exists and isn't private.
|
* exists and isn't private.
|
||||||
*
|
*
|
||||||
* @param CakeRequest $request
|
* @param CakeRequest $request
|
||||||
|
@ -487,7 +487,7 @@ class Controller extends Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the request's action is marked as private, with an underscore,
|
* Check if the request's action is marked as private, with an underscore,
|
||||||
* or if the request is attempting to directly accessing a prefixed action.
|
* or if the request is attempting to directly accessing a prefixed action.
|
||||||
*
|
*
|
||||||
* @param ReflectionMethod $method The method to be invoked.
|
* @param ReflectionMethod $method The method to be invoked.
|
||||||
|
@ -496,7 +496,7 @@ class Controller extends Object {
|
||||||
*/
|
*/
|
||||||
protected function _isPrivateAction(ReflectionMethod $method, CakeRequest $request) {
|
protected function _isPrivateAction(ReflectionMethod $method, CakeRequest $request) {
|
||||||
$privateAction = (
|
$privateAction = (
|
||||||
$method->name[0] === '_' ||
|
$method->name[0] === '_' ||
|
||||||
!$method->isPublic() ||
|
!$method->isPublic() ||
|
||||||
!in_array($method->name, $this->methods)
|
!in_array($method->name, $this->methods)
|
||||||
);
|
);
|
||||||
|
@ -882,7 +882,7 @@ class Controller extends Object {
|
||||||
$this->request->params['models'][$className] = compact('plugin', 'className');
|
$this->request->params['models'][$className] = compact('plugin', 'className');
|
||||||
}
|
}
|
||||||
} if (!empty($this->modelClass) && ($this->uses === false || $this->uses === array())) {
|
} if (!empty($this->modelClass) && ($this->uses === false || $this->uses === array())) {
|
||||||
$this->request->params['models'][$this->modelClass] = array('plugin' => $this->plugin, 'className' => $this->modelClass);
|
$this->request->params['models'][$this->modelClass] = array('plugin' => $this->plugin, 'className' => $this->modelClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
$models = ClassRegistry::keys();
|
$models = ClassRegistry::keys();
|
||||||
|
|
|
@ -26,7 +26,7 @@ App::uses('AppController', 'Controller');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Error Handler provides basic error and exception handling for your application. It captures and
|
* Error Handler provides basic error and exception handling for your application. It captures and
|
||||||
* handles all unhandled exceptions and errors. Displays helpful framework errors when debug > 1.
|
* handles all unhandled exceptions and errors. Displays helpful framework errors when debug > 1.
|
||||||
*
|
*
|
||||||
* ### Uncaught exceptions
|
* ### Uncaught exceptions
|
||||||
|
@ -47,7 +47,7 @@ App::uses('AppController', 'Controller');
|
||||||
*
|
*
|
||||||
* This gives you full control over the exception handling process. The class you choose should be
|
* This gives you full control over the exception handling process. The class you choose should be
|
||||||
* loaded in your app/Config/bootstrap.php, so its available to handle any exceptions. You can
|
* loaded in your app/Config/bootstrap.php, so its available to handle any exceptions. You can
|
||||||
* define the handler as any callback type. Using Exception.handler overrides all other exception
|
* define the handler as any callback type. Using Exception.handler overrides all other exception
|
||||||
* handling settings and logic.
|
* handling settings and logic.
|
||||||
*
|
*
|
||||||
* #### Using `AppController::appError();`
|
* #### Using `AppController::appError();`
|
||||||
|
@ -67,8 +67,8 @@ App::uses('AppController', 'Controller');
|
||||||
*
|
*
|
||||||
* #### Logging exceptions
|
* #### Logging exceptions
|
||||||
*
|
*
|
||||||
* Using the built-in exception handling, you can log all the exceptions
|
* Using the built-in exception handling, you can log all the exceptions
|
||||||
* that are dealt with by ErrorHandler by setting `Exception.log` to true in your core.php.
|
* that are dealt with by ErrorHandler by setting `Exception.log` to true in your core.php.
|
||||||
* Enabling this will log every exception to CakeLog and the configured loggers.
|
* Enabling this will log every exception to CakeLog and the configured loggers.
|
||||||
*
|
*
|
||||||
* ### PHP errors
|
* ### PHP errors
|
||||||
|
@ -139,7 +139,7 @@ class ErrorHandler {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set as the default error handler by CakePHP. Use Configure::write('Error.handler', $callback), to use your own
|
* Set as the default error handler by CakePHP. Use Configure::write('Error.handler', $callback), to use your own
|
||||||
* error handling methods. This function will use Debugger to display errors when debug > 0. And
|
* error handling methods. This function will use Debugger to display errors when debug > 0. And
|
||||||
* will log errors to CakeLog, when debug == 0.
|
* will log errors to CakeLog, when debug == 0.
|
||||||
*
|
*
|
||||||
* You can use Configure::write('Error.level', $value); to set what type of errors will be handled here.
|
* You can use Configure::write('Error.level', $value); to set what type of errors will be handled here.
|
||||||
|
|
|
@ -171,7 +171,7 @@ class CakeLog {
|
||||||
* ### Usage:
|
* ### Usage:
|
||||||
*
|
*
|
||||||
* Write a message to the 'warning' log:
|
* Write a message to the 'warning' log:
|
||||||
*
|
*
|
||||||
* `CakeLog::write('warning', 'Stuff is broken here');`
|
* `CakeLog::write('warning', 'Stuff is broken here');`
|
||||||
*
|
*
|
||||||
* @param string $type Type of message being written
|
* @param string $type Type of message being written
|
||||||
|
|
|
@ -27,8 +27,8 @@ interface CakeLogInterface {
|
||||||
/**
|
/**
|
||||||
* Write method to handle writes being made to the Logger
|
* Write method to handle writes being made to the Logger
|
||||||
*
|
*
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function write($type, $message);
|
public function write($type, $message);
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
App::uses('CakeLogInterface', 'Log');
|
App::uses('CakeLogInterface', 'Log');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File Storage stream for Logging. Writes logs to different files
|
* File Storage stream for Logging. Writes logs to different files
|
||||||
* based on the type of log it is.
|
* based on the type of log it is.
|
||||||
|
@ -37,7 +36,7 @@ class FileLog implements CakeLogInterface {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new File Logger.
|
* Constructs a new File Logger.
|
||||||
*
|
*
|
||||||
* Options
|
* Options
|
||||||
*
|
*
|
||||||
* - `path` the path to save logs on.
|
* - `path` the path to save logs on.
|
||||||
|
|
|
@ -106,7 +106,7 @@ class ContainableBehavior extends ModelBehavior {
|
||||||
$contain = array_merge($contain, (array)$query['contain']);
|
$contain = array_merge($contain, (array)$query['contain']);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
$noContain || !$contain || in_array($contain, array(null, false), true) ||
|
$noContain || !$contain || in_array($contain, array(null, false), true) ||
|
||||||
(isset($contain[0]) && $contain[0] === null)
|
(isset($contain[0]) && $contain[0] === null)
|
||||||
) {
|
) {
|
||||||
if ($noContain) {
|
if ($noContain) {
|
||||||
|
|
|
@ -277,7 +277,7 @@ class CakeSchema extends Object {
|
||||||
if (in_array($withTable, $currentTables)) {
|
if (in_array($withTable, $currentTables)) {
|
||||||
$key = array_search($withTable, $currentTables);
|
$key = array_search($withTable, $currentTables);
|
||||||
$noPrefixWith = $this->_noPrefixTable($prefix, $withTable);
|
$noPrefixWith = $this->_noPrefixTable($prefix, $withTable);
|
||||||
|
|
||||||
$tables[$noPrefixWith] = $this->__columns($Object->$class);
|
$tables[$noPrefixWith] = $this->__columns($Object->$class);
|
||||||
$tables[$noPrefixWith]['indexes'] = $db->index($Object->$class);
|
$tables[$noPrefixWith]['indexes'] = $db->index($Object->$class);
|
||||||
$tables[$noPrefixWith]['tableParameters'] = $db->readTableParameters($withTable);
|
$tables[$noPrefixWith]['tableParameters'] = $db->readTableParameters($withTable);
|
||||||
|
|
|
@ -325,7 +325,7 @@ class CakeSession {
|
||||||
/**
|
/**
|
||||||
* Tests that the user agent is valid and that the session hasn't 'timed out'.
|
* Tests that the user agent is valid and that the session hasn't 'timed out'.
|
||||||
* Since timeouts are implemented in CakeSession it checks the current self::$time
|
* Since timeouts are implemented in CakeSession it checks the current self::$time
|
||||||
* against the time the session is set to expire. The User agent is only checked
|
* against the time the session is set to expire. The User agent is only checked
|
||||||
* if Session.checkAgent == true.
|
* if Session.checkAgent == true.
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
|
|
@ -211,15 +211,15 @@ class Sqlserver extends DboSource {
|
||||||
$fields = array();
|
$fields = array();
|
||||||
$table = $this->fullTableName($model, false);
|
$table = $this->fullTableName($model, false);
|
||||||
$cols = $this->_execute(
|
$cols = $this->_execute(
|
||||||
"SELECT
|
"SELECT
|
||||||
COLUMN_NAME as Field,
|
COLUMN_NAME as Field,
|
||||||
DATA_TYPE as Type,
|
DATA_TYPE as Type,
|
||||||
COL_LENGTH('" . $table . "', COLUMN_NAME) as Length,
|
COL_LENGTH('" . $table . "', COLUMN_NAME) as Length,
|
||||||
IS_NULLABLE As [Null],
|
IS_NULLABLE As [Null],
|
||||||
COLUMN_DEFAULT as [Default],
|
COLUMN_DEFAULT as [Default],
|
||||||
COLUMNPROPERTY(OBJECT_ID('" . $table . "'), COLUMN_NAME, 'IsIdentity') as [Key],
|
COLUMNPROPERTY(OBJECT_ID('" . $table . "'), COLUMN_NAME, 'IsIdentity') as [Key],
|
||||||
NUMERIC_SCALE as Size
|
NUMERIC_SCALE as Size
|
||||||
FROM INFORMATION_SCHEMA.COLUMNS
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
WHERE TABLE_NAME = '" . $table . "'"
|
WHERE TABLE_NAME = '" . $table . "'"
|
||||||
);
|
);
|
||||||
if (!$cols) {
|
if (!$cols) {
|
||||||
|
|
|
@ -30,7 +30,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$modelName = Configure::read('Session.handler.model');
|
$modelName = Configure::read('Session.handler.model');
|
||||||
|
|
||||||
if (empty($modelName)) {
|
if (empty($modelName)) {
|
||||||
$settings = array(
|
$settings = array(
|
||||||
'class' =>'Session',
|
'class' =>'Session',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* CakeRequest
|
* CakeRequest
|
||||||
*
|
*
|
||||||
* PHP 5
|
* PHP 5
|
||||||
*
|
*
|
||||||
|
@ -21,7 +21,7 @@ App::uses('Set', 'Utility');
|
||||||
/**
|
/**
|
||||||
* A class that helps wrap Request information and particulars about a single request.
|
* A class that helps wrap Request information and particulars about a single request.
|
||||||
* Provides methods commonly used to introspect on the request headers and request body.
|
* Provides methods commonly used to introspect on the request headers and request body.
|
||||||
*
|
*
|
||||||
* Has both an Array and Object interface. You can access framework parameters using indexes:
|
* Has both an Array and Object interface. You can access framework parameters using indexes:
|
||||||
*
|
*
|
||||||
* `$request['controller']` or `$request->controller`.
|
* `$request['controller']` or `$request->controller`.
|
||||||
|
@ -84,7 +84,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* The built in detectors used with `is()` can be modified with `addDetector()`.
|
* The built in detectors used with `is()` can be modified with `addDetector()`.
|
||||||
*
|
*
|
||||||
* There are several ways to specify a detector, see CakeRequest::addDetector() for the
|
* There are several ways to specify a detector, see CakeRequest::addDetector() for the
|
||||||
* various formats and ways to define detectors.
|
* various formats and ways to define detectors.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
|
@ -116,7 +116,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
private $__input = '';
|
private $__input = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param string $url Trimmed url string to use. Should not contain the application base path.
|
* @param string $url Trimmed url string to use. Should not contain the application base path.
|
||||||
* @param boolean $parseEnvironment Set to false to not auto parse the environment. ie. GET, POST and FILES.
|
* @param boolean $parseEnvironment Set to false to not auto parse the environment. ie. GET, POST and FILES.
|
||||||
|
@ -410,7 +410,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether or not a Request is a certain type. Uses the built in detection rules
|
* Check whether or not a Request is a certain type. Uses the built in detection rules
|
||||||
* as well as additional rules defined with CakeRequest::addDetector(). Any detector can be called
|
* as well as additional rules defined with CakeRequest::addDetector(). Any detector can be called
|
||||||
* as `is($type)` or `is$Type()`.
|
* as `is($type)` or `is$Type()`.
|
||||||
*
|
*
|
||||||
* @param string $type The type of request you want to check.
|
* @param string $type The type of request you want to check.
|
||||||
|
@ -454,7 +454,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
* ### Pattern value comparison
|
* ### Pattern value comparison
|
||||||
*
|
*
|
||||||
* Pattern value comparison allows you to compare a value fetched from `env()` to a regular expression.
|
* Pattern value comparison allows you to compare a value fetched from `env()` to a regular expression.
|
||||||
*
|
*
|
||||||
* e.g `addDetector('iphone', array('env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'));`
|
* e.g `addDetector('iphone', array('env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'));`
|
||||||
*
|
*
|
||||||
* ### Option based comparison
|
* ### Option based comparison
|
||||||
|
@ -543,10 +543,10 @@ class CakeRequest implements ArrayAccess {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the HTTP method used for this request.
|
* Get the HTTP method used for this request.
|
||||||
* There are a few ways to specify a method.
|
* There are a few ways to specify a method.
|
||||||
*
|
*
|
||||||
* - If your client supports it you can use native HTTP methods.
|
* - If your client supports it you can use native HTTP methods.
|
||||||
* - You can set the HTTP-X-Method-Override header.
|
* - You can set the HTTP-X-Method-Override header.
|
||||||
* - You can submit an input with the name `_method`
|
* - You can submit an input with the name `_method`
|
||||||
*
|
*
|
||||||
* Any of these 3 approaches can be used to set the HTTP method used
|
* Any of these 3 approaches can be used to set the HTTP method used
|
||||||
|
@ -570,7 +570,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* Get the domain name and include $tldLength segments of the tld.
|
* Get the domain name and include $tldLength segments of the tld.
|
||||||
*
|
*
|
||||||
* @param integer $tldLength Number of segments your tld contains. For example: `example.com` contains 1 tld.
|
* @param integer $tldLength Number of segments your tld contains. For example: `example.com` contains 1 tld.
|
||||||
* While `example.co.uk` contains 2.
|
* While `example.co.uk` contains 2.
|
||||||
* @return string Domain name without subdomains.
|
* @return string Domain name without subdomains.
|
||||||
*/
|
*/
|
||||||
|
@ -583,7 +583,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* Get the subdomains for a host.
|
* Get the subdomains for a host.
|
||||||
*
|
*
|
||||||
* @param integer $tldLength Number of segments your tld contains. For example: `example.com` contains 1 tld.
|
* @param integer $tldLength Number of segments your tld contains. For example: `example.com` contains 1 tld.
|
||||||
* While `example.co.uk` contains 2.
|
* While `example.co.uk` contains 2.
|
||||||
* @return array of subdomains.
|
* @return array of subdomains.
|
||||||
*/
|
*/
|
||||||
|
@ -593,7 +593,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find out which content types the client accepts or check if they accept a
|
* Find out which content types the client accepts or check if they accept a
|
||||||
* particular type of content.
|
* particular type of content.
|
||||||
*
|
*
|
||||||
* #### Get all types:
|
* #### Get all types:
|
||||||
|
@ -683,7 +683,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* Read data from `php://stdin`. Useful when interacting with XML or JSON
|
* Read data from `php://stdin`. Useful when interacting with XML or JSON
|
||||||
* request body content.
|
* request body content.
|
||||||
*
|
*
|
||||||
* Getting input with a decoding function:
|
* Getting input with a decoding function:
|
||||||
*
|
*
|
||||||
* `$this->request->input('json_decode');`
|
* `$this->request->input('json_decode');`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* CakeResponse
|
* CakeResponse
|
||||||
*
|
*
|
||||||
* PHP 5
|
* PHP 5
|
||||||
*
|
*
|
||||||
|
@ -18,8 +18,8 @@
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* CakeResponse is responsible for managing the response text, status and headers of a HTTP response.
|
* CakeResponse is responsible for managing the response text, status and headers of a HTTP response.
|
||||||
*
|
*
|
||||||
* By default controllers will use this class to render their response. If you are going to use
|
* By default controllers will use this class to render their response. If you are going to use
|
||||||
* a custom response class it should subclass this object in order to ensure compatibility.
|
* a custom response class it should subclass this object in order to ensure compatibility.
|
||||||
*
|
*
|
||||||
* @package Cake.Network
|
* @package Cake.Network
|
||||||
|
|
|
@ -108,7 +108,7 @@ class Dispatcher {
|
||||||
$render = false;
|
$render = false;
|
||||||
$response = $result;
|
$response = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($render && $controller->autoRender) {
|
if ($render && $controller->autoRender) {
|
||||||
$response = $controller->render();
|
$response = $controller->render();
|
||||||
} elseif ($response->body() === null) {
|
} elseif ($response->body() === null) {
|
||||||
|
|
|
@ -218,7 +218,7 @@ class CakeRoute {
|
||||||
}
|
}
|
||||||
$route[$key] = $value;
|
$route[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($route['_args_'])) {
|
if (isset($route['_args_'])) {
|
||||||
list($pass, $named) = $this->_parseArgs($route['_args_'], $route);
|
list($pass, $named) = $this->_parseArgs($route['_args_'], $route);
|
||||||
$route['pass'] = array_merge($route['pass'], $pass);
|
$route['pass'] = array_merge($route['pass'], $pass);
|
||||||
|
@ -323,7 +323,7 @@ class CakeRoute {
|
||||||
}
|
}
|
||||||
|
|
||||||
$controllerMatches = (
|
$controllerMatches = (
|
||||||
!isset($rule['controller'], $context['controller']) ||
|
!isset($rule['controller'], $context['controller']) ||
|
||||||
in_array($context['controller'], (array)$rule['controller'])
|
in_array($context['controller'], (array)$rule['controller'])
|
||||||
);
|
);
|
||||||
if (!$controllerMatches) {
|
if (!$controllerMatches) {
|
||||||
|
@ -340,8 +340,8 @@ class CakeRoute {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply persistent parameters to a url array. Persistant parameters are a special
|
* Apply persistent parameters to a url array. Persistant parameters are a special
|
||||||
* key used during route creation to force route parameters to persist when omitted from
|
* key used during route creation to force route parameters to persist when omitted from
|
||||||
* a url array.
|
* a url array.
|
||||||
*
|
*
|
||||||
* @param array $url The array to apply persistent parameters to.
|
* @param array $url The array to apply persistent parameters to.
|
||||||
|
@ -401,7 +401,7 @@ class CakeRoute {
|
||||||
} elseif ($defaultExists) {
|
} elseif ($defaultExists) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the key is a routed key, its not different yet.
|
// If the key is a routed key, its not different yet.
|
||||||
if (array_key_exists($key, $keyNames)) {
|
if (array_key_exists($key, $keyNames)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -21,7 +21,7 @@ App::uses('CakeRoute', 'Routing/Route');
|
||||||
class PluginShortRoute extends CakeRoute {
|
class PluginShortRoute extends CakeRoute {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a string url into an array. If a plugin key is found, it will be copied to the
|
* Parses a string url into an array. If a plugin key is found, it will be copied to the
|
||||||
* controller parameter
|
* controller parameter
|
||||||
*
|
*
|
||||||
* @param string $url The url to parse
|
* @param string $url The url to parse
|
||||||
|
|
|
@ -4,7 +4,7 @@ App::uses('CakeRoute', 'Routing/Route');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect route will perform an immediate redirect. Redirect routes
|
* Redirect route will perform an immediate redirect. Redirect routes
|
||||||
* are useful when you want to have Routing layer redirects occur in your
|
* are useful when you want to have Routing layer redirects occur in your
|
||||||
* application, for when URLs move.
|
* application, for when URLs move.
|
||||||
*
|
*
|
||||||
* PHP5
|
* PHP5
|
||||||
|
|
|
@ -203,7 +203,7 @@ class Router {
|
||||||
* Shows connecting a route with custom route parameters as well as providing patterns for those parameters.
|
* Shows connecting a route with custom route parameters as well as providing patterns for those parameters.
|
||||||
* Patterns for routing parameters do not need capturing groups, as one will be added for each route params.
|
* Patterns for routing parameters do not need capturing groups, as one will be added for each route params.
|
||||||
*
|
*
|
||||||
* $options offers four 'special' keys. `pass`, `named`, `persist` and `routeClass`
|
* $options offers four 'special' keys. `pass`, `named`, `persist` and `routeClass`
|
||||||
* have special meaning in the $options array.
|
* have special meaning in the $options array.
|
||||||
*
|
*
|
||||||
* `pass` is used to define which of the routed parameters should be shifted into the pass array. Adding a
|
* `pass` is used to define which of the routed parameters should be shifted into the pass array. Adding a
|
||||||
|
@ -216,7 +216,7 @@ class Router {
|
||||||
* `routeClass` is used to extend and change how individual routes parse requests and handle reverse routing,
|
* `routeClass` is used to extend and change how individual routes parse requests and handle reverse routing,
|
||||||
* via a custom routing class. Ex. `'routeClass' => 'SlugRoute'`
|
* via a custom routing class. Ex. `'routeClass' => 'SlugRoute'`
|
||||||
*
|
*
|
||||||
* `named` is used to configure named parameters at the route level. This key uses the same options
|
* `named` is used to configure named parameters at the route level. This key uses the same options
|
||||||
* as Router::connectNamed()
|
* as Router::connectNamed()
|
||||||
*
|
*
|
||||||
* @param string $route A string describing the template of the route
|
* @param string $route A string describing the template of the route
|
||||||
|
@ -243,7 +243,7 @@ class Router {
|
||||||
}
|
}
|
||||||
$defaults += array('plugin' => null);
|
$defaults += array('plugin' => null);
|
||||||
if (empty($options['action'])) {
|
if (empty($options['action'])) {
|
||||||
$defaults += array('action' => 'index');
|
$defaults += array('action' => 'index');
|
||||||
}
|
}
|
||||||
$routeClass = 'CakeRoute';
|
$routeClass = 'CakeRoute';
|
||||||
if (isset($options['routeClass'])) {
|
if (isset($options['routeClass'])) {
|
||||||
|
@ -271,7 +271,7 @@ class Router {
|
||||||
*
|
*
|
||||||
* `Router::redirect('/home/*', array('controller' => 'posts', 'action' => 'view', array('persist' => true));`
|
* `Router::redirect('/home/*', array('controller' => 'posts', 'action' => 'view', array('persist' => true));`
|
||||||
*
|
*
|
||||||
* Redirects /home/* to /posts/view and passes the parameters to /posts/view. Using an array as the
|
* Redirects /home/* to /posts/view and passes the parameters to /posts/view. Using an array as the
|
||||||
* redirect destination allows you to use other routes to define where a url string should be redirected to.
|
* redirect destination allows you to use other routes to define where a url string should be redirected to.
|
||||||
*
|
*
|
||||||
* `Router::redirect('/posts/*', 'http://google.com', array('status' => 302));`
|
* `Router::redirect('/posts/*', 'http://google.com', array('status' => 302));`
|
||||||
|
@ -337,18 +337,18 @@ class Router {
|
||||||
* Router::connectNamed(
|
* Router::connectNamed(
|
||||||
* array('page' => array('action' => 'index', 'controller' => 'pages')),
|
* array('page' => array('action' => 'index', 'controller' => 'pages')),
|
||||||
* array('default' => false, 'greedy' => false)
|
* array('default' => false, 'greedy' => false)
|
||||||
* );
|
* );
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* ### Options
|
* ### Options
|
||||||
*
|
*
|
||||||
* - `greedy` Setting this to true will make Router parse all named params. Setting it to false will
|
* - `greedy` Setting this to true will make Router parse all named params. Setting it to false will
|
||||||
* parse only the connected named params.
|
* parse only the connected named params.
|
||||||
* - `default` Set this to true to merge in the default set of named parameters.
|
* - `default` Set this to true to merge in the default set of named parameters.
|
||||||
* - `reset` Set to true to clear existing rules and start fresh.
|
* - `reset` Set to true to clear existing rules and start fresh.
|
||||||
* - `separator` Change the string used to separate the key & value in a named parameter. Defaults to `:`
|
* - `separator` Change the string used to separate the key & value in a named parameter. Defaults to `:`
|
||||||
*
|
*
|
||||||
* @param array $named A list of named parameters. Key value pairs are accepted where values are
|
* @param array $named A list of named parameters. Key value pairs are accepted where values are
|
||||||
* either regex strings to match, or arrays as seen above.
|
* either regex strings to match, or arrays as seen above.
|
||||||
* @param array $options Allows to control all settings: separator, greedy, reset, default
|
* @param array $options Allows to control all settings: separator, greedy, reset, default
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -510,7 +510,7 @@ class Router {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes parameter and path information back from the Dispatcher, sets these
|
* Takes parameter and path information back from the Dispatcher, sets these
|
||||||
* parameters as the current request parameters that are merged with url arrays
|
* parameters as the current request parameters that are merged with url arrays
|
||||||
* created later in the request.
|
* created later in the request.
|
||||||
*
|
*
|
||||||
* Nested requests will create a stack of requests. You can remove requests using
|
* Nested requests will create a stack of requests. You can remove requests using
|
||||||
|
@ -606,7 +606,7 @@ class Router {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reloads default Router settings. Resets all class variables and
|
* Reloads default Router settings. Resets all class variables and
|
||||||
* removes all connected routes.
|
* removes all connected routes.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
@ -656,7 +656,7 @@ class Router {
|
||||||
* - A combination of controller/action - the method will find url for it.
|
* - A combination of controller/action - the method will find url for it.
|
||||||
*
|
*
|
||||||
* There are a few 'special' parameters that can change the final URL string that is generated
|
* There are a few 'special' parameters that can change the final URL string that is generated
|
||||||
*
|
*
|
||||||
* - `base` - Set to false to remove the base path from the generated url. If your application
|
* - `base` - Set to false to remove the base path from the generated url. If your application
|
||||||
* is not in the root directory, this can be used to generate urls that are 'cake relative'.
|
* is not in the root directory, this can be used to generate urls that are 'cake relative'.
|
||||||
* cake relative urls are required when using requestAction.
|
* cake relative urls are required when using requestAction.
|
||||||
|
@ -692,7 +692,7 @@ class Router {
|
||||||
|
|
||||||
$base = $path['base'];
|
$base = $path['base'];
|
||||||
$extension = $output = $q = $frag = null;
|
$extension = $output = $q = $frag = null;
|
||||||
|
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
$output = isset($path['here']) ? $path['here'] : '/';
|
$output = isset($path['here']) ? $path['here'] : '/';
|
||||||
if ($full && defined('FULL_BASE_URL')) {
|
if ($full && defined('FULL_BASE_URL')) {
|
||||||
|
@ -762,8 +762,8 @@ class Router {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
(strpos($url, '://') ||
|
(strpos($url, '://') ||
|
||||||
(strpos($url, 'javascript:') === 0) ||
|
(strpos($url, 'javascript:') === 0) ||
|
||||||
(strpos($url, 'mailto:') === 0)) ||
|
(strpos($url, 'mailto:') === 0)) ||
|
||||||
(!strncmp($url, '#', 1))
|
(!strncmp($url, '#', 1))
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -86,7 +86,7 @@ class ClassRegistry {
|
||||||
* }}}
|
* }}}
|
||||||
* @param mixed $class as a string or a single key => value array instance will be created,
|
* @param mixed $class as a string or a single key => value array instance will be created,
|
||||||
* stored in the registry and returned.
|
* stored in the registry and returned.
|
||||||
* @param boolean $strict if set to true it will return false if the class was not found instead
|
* @param boolean $strict if set to true it will return false if the class was not found instead
|
||||||
* of trying to create an AppModel
|
* of trying to create an AppModel
|
||||||
* @return object instance of ClassName
|
* @return object instance of ClassName
|
||||||
*/
|
*/
|
||||||
|
@ -111,7 +111,7 @@ class ClassRegistry {
|
||||||
$pluginPath = null;
|
$pluginPath = null;
|
||||||
$settings = array_merge($defaults, $settings);
|
$settings = array_merge($defaults, $settings);
|
||||||
$class = $settings['class'];
|
$class = $settings['class'];
|
||||||
|
|
||||||
list($plugin, $class) = pluginSplit($class);
|
list($plugin, $class) = pluginSplit($class);
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
$pluginPath = $plugin . '.';
|
$pluginPath = $plugin . '.';
|
||||||
|
|
|
@ -442,7 +442,7 @@ class Debugger {
|
||||||
/**
|
/**
|
||||||
* Converts a variable to a string for debug output.
|
* Converts a variable to a string for debug output.
|
||||||
*
|
*
|
||||||
* *Note:* The following keys will have their contents replaced with
|
* *Note:* The following keys will have their contents replaced with
|
||||||
* `*****`:
|
* `*****`:
|
||||||
*
|
*
|
||||||
* - password
|
* - password
|
||||||
|
|
|
@ -53,7 +53,7 @@ abstract class ObjectCollection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger a callback method on every object in the collection.
|
* Trigger a callback method on every object in the collection.
|
||||||
* Used to trigger methods on objects in the collection. Will fire the methods in the
|
* Used to trigger methods on objects in the collection. Will fire the methods in the
|
||||||
* order they were attached.
|
* order they were attached.
|
||||||
*
|
*
|
||||||
* ### Options
|
* ### Options
|
||||||
|
@ -75,8 +75,8 @@ abstract class ObjectCollection {
|
||||||
* Setting modParams to an integer value will allow you to modify the parameter with that index.
|
* Setting modParams to an integer value will allow you to modify the parameter with that index.
|
||||||
* Any non-null value will modify the parameter index indicated.
|
* Any non-null value will modify the parameter index indicated.
|
||||||
* Defaults to false.
|
* Defaults to false.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param string $callback Method to fire on all the objects. Its assumed all the objects implement
|
* @param string $callback Method to fire on all the objects. Its assumed all the objects implement
|
||||||
* the method you are calling.
|
* the method you are calling.
|
||||||
* @param array $params Array of parameters for the triggered callback.
|
* @param array $params Array of parameters for the triggered callback.
|
||||||
|
|
|
@ -318,7 +318,7 @@ class Validation {
|
||||||
/**
|
/**
|
||||||
* Validates a datetime value
|
* Validates a datetime value
|
||||||
* All values matching the "date" core validation rule, and the "time" one will be valid
|
* All values matching the "date" core validation rule, and the "time" one will be valid
|
||||||
*
|
*
|
||||||
* @param array $check Value to check
|
* @param array $check Value to check
|
||||||
* @param mixed $dateFormat Format of the date part
|
* @param mixed $dateFormat Format of the date part
|
||||||
* Use a string or an array of the keys below. Arrays should be passed as array('dmy', 'mdy', etc)
|
* Use a string or an array of the keys below. Arrays should be passed as array('dmy', 'mdy', etc)
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Xml {
|
||||||
* );
|
* );
|
||||||
* $xml = Xml::build($value);
|
* $xml = Xml::build($value);
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* When building XML from an array ensure that there is only one top level element.
|
* When building XML from an array ensure that there is only one top level element.
|
||||||
*
|
*
|
||||||
* ### Options
|
* ### Options
|
||||||
|
@ -116,7 +116,7 @@ class Xml {
|
||||||
* - `return` If return object of SimpleXMLElement ('simplexml') or DOMDocument ('domdocument'). Default is SimpleXMLElement.
|
* - `return` If return object of SimpleXMLElement ('simplexml') or DOMDocument ('domdocument'). Default is SimpleXMLElement.
|
||||||
*
|
*
|
||||||
* Using the following data:
|
* Using the following data:
|
||||||
*
|
*
|
||||||
* {{{
|
* {{{
|
||||||
* $value = array(
|
* $value = array(
|
||||||
* 'root' => array(
|
* 'root' => array(
|
||||||
|
|
|
@ -457,7 +457,7 @@ class Helper extends Object {
|
||||||
|
|
||||||
// habtm models are special
|
// habtm models are special
|
||||||
if (
|
if (
|
||||||
isset($this->fieldset[$this->_modelScope]['fields'][$parts[0]]['type']) &&
|
isset($this->fieldset[$this->_modelScope]['fields'][$parts[0]]['type']) &&
|
||||||
$this->fieldset[$this->_modelScope]['fields'][$parts[0]]['type'] === 'multiple'
|
$this->fieldset[$this->_modelScope]['fields'][$parts[0]]['type'] === 'multiple'
|
||||||
) {
|
) {
|
||||||
$entity = $parts[0] . '.' . $parts[0];
|
$entity = $parts[0] . '.' . $parts[0];
|
||||||
|
|
|
@ -65,7 +65,7 @@ class FormHelper extends AppHelper {
|
||||||
public $fields = array();
|
public $fields = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant used internally to skip the securing process,
|
* Constant used internally to skip the securing process,
|
||||||
* and neither add the field to the hash or to the unlocked fields.
|
* and neither add the field to the hash or to the unlocked fields.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
|
@ -240,7 +240,7 @@ class FormHelper extends AppHelper {
|
||||||
if (empty($field)) {
|
if (empty($field)) {
|
||||||
return $this->fieldset[$model]['validates'];
|
return $this->fieldset[$model]['validates'];
|
||||||
} else {
|
} else {
|
||||||
return isset($this->fieldset[$model]['validates'][$field]) ?
|
return isset($this->fieldset[$model]['validates'][$field]) ?
|
||||||
$this->fieldset[$model]['validates'] : null;
|
$this->fieldset[$model]['validates'] : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1483,7 +1483,7 @@ class FormHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an HTML link, but access the url using method POST.
|
* Creates an HTML link, but access the url using method POST.
|
||||||
* Requires javascript to be enabled in browser.
|
* Requires javascript to be enabled in browser.
|
||||||
*
|
*
|
||||||
* This method creates a `<form>` element. So do not use this method inside an existing form.
|
* This method creates a `<form>` element. So do not use this method inside an existing form.
|
||||||
|
|
|
@ -173,7 +173,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a domReady event. For jQuery. This method does not
|
* Create a domReady event. For jQuery. This method does not
|
||||||
* bind a 'traditional event' as `$(document).bind('ready', fn)`
|
* bind a 'traditional event' as `$(document).bind('ready', fn)`
|
||||||
* Works in an entirely different fashion than `$(document).ready()`
|
* Works in an entirely different fashion than `$(document).ready()`
|
||||||
* The first will not run the function when eval()'d as part of a response
|
* The first will not run the function when eval()'d as part of a response
|
||||||
|
|
|
@ -186,7 +186,7 @@ class JsHelper extends AppHelper {
|
||||||
public function writeBuffer($options = array()) {
|
public function writeBuffer($options = array()) {
|
||||||
$domReady = $this->request->is('ajax');
|
$domReady = $this->request->is('ajax');
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
'onDomReady' => $domReady, 'inline' => true,
|
'onDomReady' => $domReady, 'inline' => true,
|
||||||
'cache' => false, 'clear' => true, 'safe' => true
|
'cache' => false, 'clear' => true, 'safe' => true
|
||||||
);
|
);
|
||||||
$options = array_merge($defaults, $options);
|
$options = array_merge($defaults, $options);
|
||||||
|
@ -221,7 +221,7 @@ class JsHelper extends AppHelper {
|
||||||
* Write a script to the buffered scripts.
|
* Write a script to the buffered scripts.
|
||||||
*
|
*
|
||||||
* @param string $script Script string to add to the buffer.
|
* @param string $script Script string to add to the buffer.
|
||||||
* @param boolean $top If true the script will be added to the top of the
|
* @param boolean $top If true the script will be added to the top of the
|
||||||
* buffered scripts array. If false the bottom.
|
* buffered scripts array. If false the bottom.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -342,7 +342,7 @@ class JsHelper extends AppHelper {
|
||||||
* and require an iframe or flash.
|
* and require an iframe or flash.
|
||||||
*
|
*
|
||||||
* ### Options
|
* ### Options
|
||||||
*
|
*
|
||||||
* - `url` The url you wish the XHR request to submit to.
|
* - `url` The url you wish the XHR request to submit to.
|
||||||
* - `confirm` A string to use for a confirm() message prior to submitting the request.
|
* - `confirm` A string to use for a confirm() message prior to submitting the request.
|
||||||
* - `method` The method you wish the form to send by, defaults to POST
|
* - `method` The method you wish the form to send by, defaults to POST
|
||||||
|
@ -403,7 +403,7 @@ class JsHelper extends AppHelper {
|
||||||
*/
|
*/
|
||||||
protected function _getHtmlOptions($options, $additional = array()) {
|
protected function _getHtmlOptions($options, $additional = array()) {
|
||||||
$htmlKeys = array_merge(
|
$htmlKeys = array_merge(
|
||||||
array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title', 'style'),
|
array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title', 'style'),
|
||||||
$additional
|
$additional
|
||||||
);
|
);
|
||||||
$htmlOptions = array();
|
$htmlOptions = array();
|
||||||
|
|
|
@ -193,13 +193,13 @@ class RssHelper extends AppHelper {
|
||||||
|
|
||||||
foreach ($elements as $key => $val) {
|
foreach ($elements as $key => $val) {
|
||||||
$attrib = array();
|
$attrib = array();
|
||||||
|
|
||||||
$escape = true;
|
$escape = true;
|
||||||
if (is_array($val) && isset($val['convertEntities'])) {
|
if (is_array($val) && isset($val['convertEntities'])) {
|
||||||
$escape = $val['convertEntities'];
|
$escape = $val['convertEntities'];
|
||||||
unset($val['convertEntities']);
|
unset($val['convertEntities']);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'pubDate' :
|
case 'pubDate' :
|
||||||
$val = $this->time($val);
|
$val = $this->time($val);
|
||||||
|
|
|
@ -82,7 +82,7 @@ class SessionHelper extends AppHelper {
|
||||||
* echo $this->Session->flash('flash', array('params' => array('class' => 'new-flash')));
|
* echo $this->Session->flash('flash', array('params' => array('class' => 'new-flash')));
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* The above would generate a flash message with a custom class name. Using $attrs['params'] you
|
* The above would generate a flash message with a custom class name. Using $attrs['params'] you
|
||||||
* can pass additional data into the element rendering that will be made available as local variables
|
* can pass additional data into the element rendering that will be made available as local variables
|
||||||
* when the element is rendered:
|
* when the element is rendered:
|
||||||
*
|
*
|
||||||
|
@ -93,7 +93,7 @@ class SessionHelper extends AppHelper {
|
||||||
* This would pass the current user's name into the flash message, so you could create peronsonalized
|
* This would pass the current user's name into the flash message, so you could create peronsonalized
|
||||||
* messages without the controller needing access to that data.
|
* messages without the controller needing access to that data.
|
||||||
*
|
*
|
||||||
* Lastly you can choose the element that is rendered when creating the flash message. Using
|
* Lastly you can choose the element that is rendered when creating the flash message. Using
|
||||||
* custom elements allows you to fully customize how flash messages are generated.
|
* custom elements allows you to fully customize how flash messages are generated.
|
||||||
*
|
*
|
||||||
* {{{
|
* {{{
|
||||||
|
@ -109,7 +109,7 @@ class SessionHelper extends AppHelper {
|
||||||
*/
|
*/
|
||||||
public function flash($key = 'flash', $attrs = array()) {
|
public function flash($key = 'flash', $attrs = array()) {
|
||||||
$out = false;
|
$out = false;
|
||||||
|
|
||||||
if (CakeSession::check('Message.' . $key)) {
|
if (CakeSession::check('Message.' . $key)) {
|
||||||
$flash = CakeSession::read('Message.' . $key);
|
$flash = CakeSession::read('Message.' . $key);
|
||||||
$message = $flash['message'];
|
$message = $flash['message'];
|
||||||
|
|
|
@ -120,7 +120,7 @@ class TextHelper extends AppHelper {
|
||||||
public function autoLinkUrls($text, $htmlOptions = array()) {
|
public function autoLinkUrls($text, $htmlOptions = array()) {
|
||||||
$this->_linkOptions = $htmlOptions;
|
$this->_linkOptions = $htmlOptions;
|
||||||
$text = preg_replace_callback(
|
$text = preg_replace_callback(
|
||||||
'#(?<!href="|">)((?:https?|ftp|nntp)://[^\s<>()]+)#i',
|
'#(?<!href="|">)((?:https?|ftp|nntp)://[^\s<>()]+)#i',
|
||||||
array(&$this, '_linkBareUrl'),
|
array(&$this, '_linkBareUrl'),
|
||||||
$text
|
$text
|
||||||
);
|
);
|
||||||
|
@ -179,7 +179,7 @@ class TextHelper extends AppHelper {
|
||||||
'/(' . $atom . '+(?:\.' . $atom . '+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)+)/i',
|
'/(' . $atom . '+(?:\.' . $atom . '+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)+)/i',
|
||||||
array(&$this, '_linkEmails'),
|
array(&$this, '_linkEmails'),
|
||||||
$text
|
$text
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* @since CakePHP(tm) v 2.0
|
* @since CakePHP(tm) v 2.0
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
App::uses('ObjectCollection', 'Utility');
|
App::uses('ObjectCollection', 'Utility');
|
||||||
|
|
||||||
class HelperCollection extends ObjectCollection {
|
class HelperCollection extends ObjectCollection {
|
||||||
|
@ -38,7 +38,7 @@ class HelperCollection extends ObjectCollection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads/constructs a helper. Will return the instance in the registry if it already exists.
|
* Loads/constructs a helper. Will return the instance in the registry if it already exists.
|
||||||
* By setting `$enable` to false you can disable callbacks for a helper. Alternatively you
|
* By setting `$enable` to false you can disable callbacks for a helper. Alternatively you
|
||||||
* can set `$settings['enabled'] = false` to disable callbacks. This alias is provided so that when
|
* can set `$settings['enabled'] = false` to disable callbacks. This alias is provided so that when
|
||||||
* declaring $helpers arrays you can disable callbacks on helpers.
|
* declaring $helpers arrays you can disable callbacks on helpers.
|
||||||
*
|
*
|
||||||
|
@ -51,7 +51,7 @@ class HelperCollection extends ObjectCollection {
|
||||||
* );
|
* );
|
||||||
* }}}
|
* }}}
|
||||||
* All calls to the `Html` helper would use `AliasedHtml` instead.
|
* All calls to the `Html` helper would use `AliasedHtml` instead.
|
||||||
*
|
*
|
||||||
* @param string $helper Helper name to load
|
* @param string $helper Helper name to load
|
||||||
* @param array $settings Settings for the helper.
|
* @param array $settings Settings for the helper.
|
||||||
* @return Helper A helper object, Either the existing loaded helper or a new one.
|
* @return Helper A helper object, Either the existing loaded helper or a new one.
|
||||||
|
@ -66,7 +66,7 @@ class HelperCollection extends ObjectCollection {
|
||||||
if (!isset($alias)) {
|
if (!isset($alias)) {
|
||||||
$alias = $name;
|
$alias = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->_loaded[$alias])) {
|
if (isset($this->_loaded[$alias])) {
|
||||||
return $this->_loaded[$alias];
|
return $this->_loaded[$alias];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue