Removing trailing spaces.

This commit is contained in:
Juan Basso 2011-08-15 23:55:08 -04:00
parent 7581db2cf2
commit 16ef234180
58 changed files with 150 additions and 151 deletions

View file

@ -1,6 +1,6 @@
<?php
/**
* Wincache storage engine for cache.
* Wincache storage engine for cache.
*
* Supports wincache 1.1.0 and higher.
*
@ -67,7 +67,7 @@ class WincacheEngine extends CacheEngine {
* Read a key from the cache
*
* @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
*/
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.
*
* @param boolean $check

View file

@ -43,8 +43,8 @@
* You can combine `.` separated values with sections to create more deeply
* nested structures.
*
* IniReader also manipulates how the special ini values of
* 'yes', 'no', 'on', 'off', 'null' are handled. These values will be
* IniReader also manipulates how the special ini values of
* 'yes', 'no', 'on', 'off', 'null' are handled. These values will be
* converted to their boolean equivalents.
*
* @package Cake.Configure

View file

@ -76,7 +76,7 @@ class CommandListShell extends Shell {
/**
* Gets the shell command listing.
*
* @return array
* @return array
*/
protected function _getShellList() {
$shellList = array();

View file

@ -52,7 +52,7 @@ class ProjectTask extends Shell {
$prompt = __d('cake_console', "What is the path to the project you want to bake?");
$project = $this->in($prompt, null, APP . 'myapp');
}
if ($project && !Folder::isAbsolute($project) && isset($_SERVER['PWD'])) {
$project = $_SERVER['PWD'] . DS . $project;

View file

@ -20,7 +20,7 @@ App::uses('ConsoleOutput', 'Console');
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.
*
* @package Cake.Console
@ -55,7 +55,7 @@ class ConsoleErrorHandler extends ErrorHandler {
public static function handleException(Exception $exception) {
$stderr = self::getStderr();
$stderr->write(__d('cake_console', "<error>Error:</error> %s\n%s",
$exception->getMessage(),
$exception->getMessage(),
$exception->getTraceAsString()
));
}

View file

@ -17,7 +17,7 @@
* @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
*/

View file

@ -85,7 +85,7 @@ class ConsoleInputArgument {
* Generate the help for this argument.
*
* @param integer $width The width to make the name of the option.
* @return string
* @return string
*/
public function help($width = 0) {
$name = $this->_name;
@ -141,7 +141,7 @@ class ConsoleInputArgument {
}
if (!in_array($value, $this->_choices)) {
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)
));
}

View file

@ -118,7 +118,7 @@ class ConsoleInputOption {
* Generate the help for this this option.
*
* @param integer $width The width to make the name of the option.
* @return string
* @return string
*/
public function help($width = 0) {
$default = $short = '';

View file

@ -37,7 +37,7 @@ class ConsoleInputSubcommand {
*
* @var string
*/
protected $_help;
protected $_help;
/**
* 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 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()
*/
public function __construct($name, $help = '', $parser = null) {
@ -83,7 +83,7 @@ class ConsoleInputSubcommand {
* Generate the help for this this subcommand.
*
* @param integer $width The width to make the name of the subcommand.
* @return string
* @return string
*/
public function help($width = 0) {
$name = $this->_name;

View file

@ -232,7 +232,7 @@ class ConsoleOptionParser {
/**
* 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"
* @return mixed If reading, the value of the description. If setting $this will be returned
*/

View file

@ -18,8 +18,8 @@
/**
* Object wrapper for outputting information from a shell application.
* 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
*
* - `error` Error messages.
@ -141,7 +141,7 @@ class ConsoleOutput {
*
* Checks for a pretty console environment. Ansicon allows pretty consoles
* on windows, and is supported.
*
*
* @param string $stream The identifier of the stream to write output to.
*/
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.
*
*
* @param integer $type The output type to use. Should be one of the class constants.
* @return mixed Either null or the value if getting.
*/

View file

@ -180,7 +180,7 @@ class HelpFormatter {
$xml = new SimpleXmlElement('<shell></shell>');
$xml->addChild('command', $parser->command());
$xml->addChild('description', $parser->description());
$xml->addChild('epilog', $parser->epilog());
$subcommands = $xml->addChild('subcommands');
foreach ($parser->subcommands() as $command) {

View file

@ -353,7 +353,7 @@ class Shell extends Object {
} catch (ConsoleException $e) {
return $this->out($this->OptionParser->help($command));
}
$this->command = $command;
if (!empty($this->params['help'])) {
return $this->_displayHelp($command);

View file

@ -50,7 +50,7 @@ class TaskCollection extends ObjectCollection {
/**
* Loads/constructs a task. Will return the instance in the collection
* if it already exists.
*
*
* @param string $task Task name to load
* @param array $settings Settings for the task.
* @return Task A task object, Either the existing loaded task or a new one.

View file

@ -12,7 +12,7 @@
* @link http://cakephp.org CakePHP(tm) Project
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('BaseAuthorize', 'Controller/Component/Auth');
/**

View file

@ -99,10 +99,10 @@ abstract class BaseAuthenticate {
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.
*
* All attached authentication objects will have this method
*
* All attached authentication objects will have this method
* called when a user logs out.
*
* @param array $user The user about to be logged out.

View file

@ -34,7 +34,7 @@ abstract class BaseAuthorize {
* @var ComponentCollection
*/
protected $_Collection;
/**
* Settings for authorize objects.
*
@ -75,7 +75,7 @@ abstract class BaseAuthorize {
* Checks user authorization.
*
* @param array $user Active user data
* @param CakeRequest $request
* @param CakeRequest $request
* @return boolean
*/
abstract public function authorize($user, CakeRequest $request);

View file

@ -24,7 +24,7 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth');
* Auth must support cookies.
*
* ### Using Basic auth
*
*
* In your controller's components array, add auth + the required settings.
* {{{
* 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.
*
* @param CakeRequest $request The request to authenticate with.
@ -104,7 +104,7 @@ class BasicAuthenticate extends BaseAuthenticate {
public function getUser($request) {
$username = env('PHP_AUTH_USER');
$pass = env('PHP_AUTH_PW');
if (empty($username) || empty($pass)) {
return false;
}

View file

@ -57,7 +57,7 @@ class ControllerAuthorize extends BaseAuthorize {
* Checks user authorization using a controller callback.
*
* @param array $user Active user data
* @param CakeRequest $request
* @param CakeRequest $request
* @return boolean
*/
public function authorize($user, CakeRequest $request) {

View file

@ -81,9 +81,9 @@ class CrudAuthorize extends BaseAuthorize {
*/
public function authorize($user, CakeRequest $request) {
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"',
$request->action,
$request->action,
$request->controller
),
E_USER_WARNING

View file

@ -20,14 +20,14 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth');
*
* 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
* 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.
*
* Clients using Digest Authentication must support cookies. Since AuthComponent identifies users based
* on Session contents, clients without support for cookies will not function properly.
*
* ### Using Digest auth
*
*
* In your controller's components array, add auth + the required settings.
* {{{
* var $components = array(
@ -47,7 +47,7 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth');
*
* `$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
* 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.
*
* @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 $password The unhashed password to make a digest hash for.

View file

@ -38,7 +38,7 @@ class FormAuthenticate extends BaseAuthenticate {
/**
* 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.
*
* @param CakeRequest $request The request that contains login information.

View file

@ -109,7 +109,7 @@ class CookieComponent extends Component {
/**
* 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.
*
* @var boolean
@ -205,7 +205,7 @@ class CookieComponent extends Component {
}
$this->_encrypted = $encrypt;
$this->_expire($expires);
if (!is_array($key)) {
$key = array($key => $value);
}
@ -366,7 +366,7 @@ class CookieComponent extends Component {
*/
protected function _write($name, $value) {
$this->_setcookie(
$this->name . $name, $this->_encrypt($value),
$this->name . $name, $this->_encrypt($value),
$this->_expires, $this->path, $this->domain, $this->secure, $this->httpOnly
);
@ -384,7 +384,7 @@ class CookieComponent extends Component {
*/
protected function _delete($name) {
$this->_setcookie(
$this->name . $name, '',
$this->name . $name, '',
time() - 42000, $this->path, $this->domain, $this->secure, $this->httpOnly
);
}

View file

@ -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 $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.
* @return array Model query results
* @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
* 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);
}
if (!empty($whitelist)) {
$field = key($options['order']);
if (!in_array($field, $whitelist)) {
$options['order'] = null;
}
}
if (!empty($options['order']) && is_array($options['order'])) {
$alias = $object->alias ;
$key = $field = key($options['order']);
@ -357,7 +357,7 @@ class PaginatorComponent extends Component {
$options['order'][$alias . '.' . $field] = $value;
}
}
return $options;
}

View file

@ -97,7 +97,7 @@ class RequestHandlerComponent extends Component {
/**
* 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.
* 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
* this lives here.
*
* @param string $xml
* @param string $xml
* @return array Xml array data
*/
public function _convertXml($xml) {
@ -437,7 +437,7 @@ class RequestHandlerComponent extends Component {
if (!$this->request->is('post') && !$this->request->is('put')) {
return null;
}
list($contentType) = explode(';', env('CONTENT_TYPE'));
if ($type == null) {
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.
*
*
* ### Usage:
*
* 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.
*
* @param string $type The type alias being converted, ie. json

View file

@ -140,7 +140,7 @@ class SecurityComponent extends Component {
/**
* 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()
*
* @var string
@ -498,7 +498,7 @@ class SecurityComponent extends Component {
if (!empty($tokenData['csrfTokens']) && is_array($tokenData['csrfTokens'])) {
$token['csrfTokens'] = $this->_expireTokens($tokenData['csrfTokens']);
}
}
}
if ($this->csrfCheck && ($this->csrfUseOnce || empty($token['csrfTokens'])) ) {
$token['csrfTokens'][$authKey] = strtotime($this->csrfExpires);
}

View file

@ -32,7 +32,7 @@ App::uses('CakeSession', 'Model/Datasource');
class SessionComponent extends Component {
/**
* Get / Set the userAgent
* Get / Set the userAgent
*
* @param string $userAgent Set the userAgent
* @return void

View file

@ -69,7 +69,7 @@ class ComponentCollection extends ObjectCollection {
* );
* }}}
* All calls to the `Email` component would use `AliasedEmail` instead.
*
*
* @param string $component Component name to load
* @param array $settings Settings for the component.
* @return Component A component object, Either the existing loaded component or a new one.

View file

@ -301,7 +301,7 @@ class Controller extends Object {
*
* @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.
* @param CakeResponse $response Response object for this controller.
* @param CakeResponse $response Response object for this controller.
*/
public function __construct($request = null, $response = 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.
*
* @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.
*
* @param ReflectionMethod $method The method to be invoked.
@ -496,7 +496,7 @@ class Controller extends Object {
*/
protected function _isPrivateAction(ReflectionMethod $method, CakeRequest $request) {
$privateAction = (
$method->name[0] === '_' ||
$method->name[0] === '_' ||
!$method->isPublic() ||
!in_array($method->name, $this->methods)
);
@ -882,7 +882,7 @@ class Controller extends Object {
$this->request->params['models'][$className] = compact('plugin', 'className');
}
} 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();

View file

@ -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.
*
* ### 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
* 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.
*
* #### Using `AppController::appError();`
@ -67,8 +67,8 @@ App::uses('AppController', 'Controller');
*
* #### Logging 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.
* 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.
* Enabling this will log every exception to CakeLog and the configured loggers.
*
* ### 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
* 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.
*
* You can use Configure::write('Error.level', $value); to set what type of errors will be handled here.

View file

@ -171,7 +171,7 @@ class CakeLog {
* ### Usage:
*
* Write a message to the 'warning' log:
*
*
* `CakeLog::write('warning', 'Stuff is broken here');`
*
* @param string $type Type of message being written

View file

@ -27,8 +27,8 @@ interface CakeLogInterface {
/**
* Write method to handle writes being made to the Logger
*
* @param string $type
* @param string $message
* @param string $type
* @param string $message
* @return void
*/
public function write($type, $message);

View file

@ -19,7 +19,6 @@
App::uses('CakeLogInterface', 'Log');
/**
* File Storage stream for Logging. Writes logs to different files
* based on the type of log it is.
@ -37,7 +36,7 @@ class FileLog implements CakeLogInterface {
/**
* Constructs a new File Logger.
*
*
* Options
*
* - `path` the path to save logs on.

View file

@ -106,7 +106,7 @@ class ContainableBehavior extends ModelBehavior {
$contain = array_merge($contain, (array)$query['contain']);
}
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)
) {
if ($noContain) {

View file

@ -277,7 +277,7 @@ class CakeSchema extends Object {
if (in_array($withTable, $currentTables)) {
$key = array_search($withTable, $currentTables);
$noPrefixWith = $this->_noPrefixTable($prefix, $withTable);
$tables[$noPrefixWith] = $this->__columns($Object->$class);
$tables[$noPrefixWith]['indexes'] = $db->index($Object->$class);
$tables[$noPrefixWith]['tableParameters'] = $db->readTableParameters($withTable);

View file

@ -325,7 +325,7 @@ class CakeSession {
/**
* 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
* 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.
*
* @return boolean

View file

@ -211,15 +211,15 @@ class Sqlserver extends DboSource {
$fields = array();
$table = $this->fullTableName($model, false);
$cols = $this->_execute(
"SELECT
"SELECT
COLUMN_NAME as Field,
DATA_TYPE as Type,
COL_LENGTH('" . $table . "', COLUMN_NAME) as Length,
IS_NULLABLE As [Null],
COLUMN_DEFAULT as [Default],
DATA_TYPE as Type,
COL_LENGTH('" . $table . "', COLUMN_NAME) as Length,
IS_NULLABLE As [Null],
COLUMN_DEFAULT as [Default],
COLUMNPROPERTY(OBJECT_ID('" . $table . "'), COLUMN_NAME, 'IsIdentity') as [Key],
NUMERIC_SCALE as Size
FROM INFORMATION_SCHEMA.COLUMNS
NUMERIC_SCALE as Size
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = '" . $table . "'"
);
if (!$cols) {

View file

@ -30,7 +30,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
*/
public function __construct() {
$modelName = Configure::read('Session.handler.model');
if (empty($modelName)) {
$settings = array(
'class' =>'Session',

View file

@ -1,6 +1,6 @@
<?php
/**
* CakeRequest
* CakeRequest
*
* PHP 5
*
@ -21,7 +21,7 @@ App::uses('Set', 'Utility');
/**
* 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.
*
*
* Has both an Array and Object interface. You can access framework parameters using indexes:
*
* `$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()`.
*
* 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.
*
* @var array
@ -116,7 +116,7 @@ class CakeRequest implements ArrayAccess {
private $__input = '';
/**
* Constructor
* Constructor
*
* @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.
@ -410,7 +410,7 @@ class CakeRequest implements ArrayAccess {
/**
* 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()`.
*
* @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 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'));`
*
* ### Option based comparison
@ -543,10 +543,10 @@ class CakeRequest implements ArrayAccess {
/**
* 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.
* - 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`
*
* 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.
*
* @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.
* @return string Domain name without subdomains.
*/
@ -583,7 +583,7 @@ class CakeRequest implements ArrayAccess {
/**
* 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.
* @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.
*
* #### Get all types:
@ -683,7 +683,7 @@ class CakeRequest implements ArrayAccess {
/**
* Read data from `php://stdin`. Useful when interacting with XML or JSON
* request body content.
*
*
* Getting input with a decoding function:
*
* `$this->request->input('json_decode');`

View file

@ -1,6 +1,6 @@
<?php
/**
* CakeResponse
* CakeResponse
*
* PHP 5
*
@ -18,8 +18,8 @@
*/
/**
* 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.
*
* @package Cake.Network

View file

@ -108,7 +108,7 @@ class Dispatcher {
$render = false;
$response = $result;
}
if ($render && $controller->autoRender) {
$response = $controller->render();
} elseif ($response->body() === null) {

View file

@ -218,7 +218,7 @@ class CakeRoute {
}
$route[$key] = $value;
}
if (isset($route['_args_'])) {
list($pass, $named) = $this->_parseArgs($route['_args_'], $route);
$route['pass'] = array_merge($route['pass'], $pass);
@ -323,7 +323,7 @@ class CakeRoute {
}
$controllerMatches = (
!isset($rule['controller'], $context['controller']) ||
!isset($rule['controller'], $context['controller']) ||
in_array($context['controller'], (array)$rule['controller'])
);
if (!$controllerMatches) {
@ -340,8 +340,8 @@ class CakeRoute {
}
/**
* 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
* 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
* a url array.
*
* @param array $url The array to apply persistent parameters to.
@ -401,7 +401,7 @@ class CakeRoute {
} elseif ($defaultExists) {
continue;
}
// If the key is a routed key, its not different yet.
if (array_key_exists($key, $keyNames)) {
continue;

View file

@ -21,7 +21,7 @@ App::uses('CakeRoute', 'Routing/Route');
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
*
* @param string $url The url to parse

View file

@ -4,7 +4,7 @@ App::uses('CakeRoute', 'Routing/Route');
/**
* 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.
*
* PHP5

View file

@ -203,7 +203,7 @@ class Router {
* 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.
*
* $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.
*
* `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,
* 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()
*
* @param string $route A string describing the template of the route
@ -243,7 +243,7 @@ class Router {
}
$defaults += array('plugin' => null);
if (empty($options['action'])) {
$defaults += array('action' => 'index');
$defaults += array('action' => 'index');
}
$routeClass = 'CakeRoute';
if (isset($options['routeClass'])) {
@ -271,7 +271,7 @@ class Router {
*
* `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.
*
* `Router::redirect('/posts/*', 'http://google.com', array('status' => 302));`
@ -337,18 +337,18 @@ class Router {
* Router::connectNamed(
* array('page' => array('action' => 'index', 'controller' => 'pages')),
* array('default' => false, 'greedy' => false)
* );
* );
* }}}
*
* ### 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.
* - `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.
* - `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.
* @param array $options Allows to control all settings: separator, greedy, reset, default
* @return array
@ -510,7 +510,7 @@ class Router {
/**
* 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.
*
* 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.
*
* @return void
@ -656,7 +656,7 @@ class Router {
* - 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
*
*
* - `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'.
* cake relative urls are required when using requestAction.
@ -692,7 +692,7 @@ class Router {
$base = $path['base'];
$extension = $output = $q = $frag = null;
if (empty($url)) {
$output = isset($path['here']) ? $path['here'] : '/';
if ($full && defined('FULL_BASE_URL')) {
@ -762,8 +762,8 @@ class Router {
}
} else {
if (
(strpos($url, '://') ||
(strpos($url, 'javascript:') === 0) ||
(strpos($url, '://') ||
(strpos($url, 'javascript:') === 0) ||
(strpos($url, 'mailto:') === 0)) ||
(!strncmp($url, '#', 1))
) {

View file

@ -86,7 +86,7 @@ class ClassRegistry {
* }}}
* @param mixed $class as a string or a single key => value array instance will be created,
* 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
* @return object instance of ClassName
*/
@ -111,7 +111,7 @@ class ClassRegistry {
$pluginPath = null;
$settings = array_merge($defaults, $settings);
$class = $settings['class'];
list($plugin, $class) = pluginSplit($class);
if ($plugin) {
$pluginPath = $plugin . '.';

View file

@ -442,7 +442,7 @@ class Debugger {
/**
* 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

View file

@ -53,7 +53,7 @@ abstract class ObjectCollection {
/**
* 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.
*
* ### Options
@ -75,8 +75,8 @@ abstract class ObjectCollection {
* 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.
* Defaults to false.
*
*
*
*
* @param string $callback Method to fire on all the objects. Its assumed all the objects implement
* the method you are calling.
* @param array $params Array of parameters for the triggered callback.

View file

@ -318,7 +318,7 @@ class Validation {
/**
* Validates a datetime value
* All values matching the "date" core validation rule, and the "time" one will be valid
*
*
* @param array $check Value to check
* @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)

View file

@ -61,7 +61,7 @@ class Xml {
* );
* $xml = Xml::build($value);
* }}}
*
*
* When building XML from an array ensure that there is only one top level element.
*
* ### Options
@ -116,7 +116,7 @@ class Xml {
* - `return` If return object of SimpleXMLElement ('simplexml') or DOMDocument ('domdocument'). Default is SimpleXMLElement.
*
* Using the following data:
*
*
* {{{
* $value = array(
* 'root' => array(

View file

@ -457,7 +457,7 @@ class Helper extends Object {
// habtm models are special
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'
) {
$entity = $parts[0] . '.' . $parts[0];

View file

@ -65,7 +65,7 @@ class FormHelper extends AppHelper {
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.
*
* @var string
@ -240,7 +240,7 @@ class FormHelper extends AppHelper {
if (empty($field)) {
return $this->fieldset[$model]['validates'];
} else {
return isset($this->fieldset[$model]['validates'][$field]) ?
return isset($this->fieldset[$model]['validates'][$field]) ?
$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.
*
* This method creates a `<form>` element. So do not use this method inside an existing form.

View file

@ -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)`
* Works in an entirely different fashion than `$(document).ready()`
* The first will not run the function when eval()'d as part of a response

View file

@ -186,7 +186,7 @@ class JsHelper extends AppHelper {
public function writeBuffer($options = array()) {
$domReady = $this->request->is('ajax');
$defaults = array(
'onDomReady' => $domReady, 'inline' => true,
'onDomReady' => $domReady, 'inline' => true,
'cache' => false, 'clear' => true, 'safe' => true
);
$options = array_merge($defaults, $options);
@ -221,7 +221,7 @@ class JsHelper extends AppHelper {
* Write a script to the buffered scripts.
*
* @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.
* @return void
*/
@ -342,7 +342,7 @@ class JsHelper extends AppHelper {
* and require an iframe or flash.
*
* ### Options
*
*
* - `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.
* - `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()) {
$htmlKeys = array_merge(
array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title', 'style'),
array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title', 'style'),
$additional
);
$htmlOptions = array();

View file

@ -193,13 +193,13 @@ class RssHelper extends AppHelper {
foreach ($elements as $key => $val) {
$attrib = array();
$escape = true;
if (is_array($val) && isset($val['convertEntities'])) {
$escape = $val['convertEntities'];
unset($val['convertEntities']);
}
switch ($key) {
case 'pubDate' :
$val = $this->time($val);

View file

@ -82,7 +82,7 @@ class SessionHelper extends AppHelper {
* 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
* 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
* 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.
*
* {{{
@ -109,7 +109,7 @@ class SessionHelper extends AppHelper {
*/
public function flash($key = 'flash', $attrs = array()) {
$out = false;
if (CakeSession::check('Message.' . $key)) {
$flash = CakeSession::read('Message.' . $key);
$message = $flash['message'];

View file

@ -120,7 +120,7 @@ class TextHelper extends AppHelper {
public function autoLinkUrls($text, $htmlOptions = array()) {
$this->_linkOptions = $htmlOptions;
$text = preg_replace_callback(
'#(?<!href="|">)((?:https?|ftp|nntp)://[^\s<>()]+)#i',
'#(?<!href="|">)((?:https?|ftp|nntp)://[^\s<>()]+)#i',
array(&$this, '_linkBareUrl'),
$text
);
@ -179,7 +179,7 @@ class TextHelper extends AppHelper {
'/(' . $atom . '+(?:\.' . $atom . '+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)+)/i',
array(&$this, '_linkEmails'),
$text
);
);
}
/**

View file

@ -15,7 +15,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('ObjectCollection', 'Utility');
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.
* 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
* 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.
*
*
* @param string $helper Helper name to load
* @param array $settings Settings for the helper.
* @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)) {
$alias = $name;
}
if (isset($this->_loaded[$alias])) {
return $this->_loaded[$alias];
}