mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch 'master' into 2.6
This commit is contained in:
commit
92eeef8ae0
82 changed files with 407 additions and 336 deletions
|
@ -113,11 +113,11 @@ class Cache {
|
|||
* - `user` Used by Xcache. Username for XCache
|
||||
* - `password` Used by Xcache/Redis. Password for XCache/Redis
|
||||
*
|
||||
* @see app/Config/core.php for configuration settings
|
||||
* @param string $name Name of the configuration
|
||||
* @param array $settings Optional associative array of settings passed to the engine
|
||||
* @return array array(engine, settings) on success, false on failure
|
||||
* @throws CacheException
|
||||
* @see app/Config/core.php for configuration settings
|
||||
*/
|
||||
public static function config($name = null, $settings = array()) {
|
||||
if (is_array($name)) {
|
||||
|
@ -561,6 +561,7 @@ class Cache {
|
|||
* the cache key is empty. Can be any callable type supported by your PHP.
|
||||
* @param string $config The cache configuration to use for this operation.
|
||||
* Defaults to default.
|
||||
* @return mixed The results of the callable or unserialized results.
|
||||
*/
|
||||
public static function remember($key, $callable, $config = 'default') {
|
||||
$existing = self::read($key, $config);
|
||||
|
|
|
@ -130,7 +130,7 @@ abstract class CacheEngine {
|
|||
* to decide whether actually delete the keys or just simulate it to achieve
|
||||
* the same result.
|
||||
*
|
||||
* @param string $groups name of the group to be cleared
|
||||
* @param string $group name of the group to be cleared
|
||||
* @return boolean
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -173,6 +173,7 @@ class ApcEngine extends CacheEngine {
|
|||
* Increments the group value to simulate deletion of all keys under a group
|
||||
* old values will remain in storage until they expire.
|
||||
*
|
||||
* @param string $group The group to clear.
|
||||
* @return boolean success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -303,8 +303,8 @@ class FileEngine extends CacheEngine {
|
|||
/**
|
||||
* Not implemented
|
||||
*
|
||||
* @param string $key
|
||||
* @param integer $offset
|
||||
* @param string $key The key to decrement
|
||||
* @param integer $offset The number to offset
|
||||
* @return void
|
||||
* @throws CacheException
|
||||
*/
|
||||
|
@ -315,8 +315,8 @@ class FileEngine extends CacheEngine {
|
|||
/**
|
||||
* Not implemented
|
||||
*
|
||||
* @param string $key
|
||||
* @param integer $offset
|
||||
* @param string $key The key to decrement
|
||||
* @param integer $offset The number to offset
|
||||
* @return void
|
||||
* @throws CacheException
|
||||
*/
|
||||
|
@ -405,6 +405,7 @@ class FileEngine extends CacheEngine {
|
|||
/**
|
||||
* Recursively deletes all files under any directory named as $group
|
||||
*
|
||||
* @param string $group The group to clear.
|
||||
* @return boolean success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -199,7 +199,8 @@ class MemcacheEngine extends CacheEngine {
|
|||
/**
|
||||
* Delete all keys from the cache
|
||||
*
|
||||
* @param boolean $check
|
||||
* @param boolean $check If true no deletes will occur and instead CakePHP will rely
|
||||
* on key TTL values.
|
||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
||||
*/
|
||||
public function clear($check) {
|
||||
|
@ -282,6 +283,7 @@ class MemcacheEngine extends CacheEngine {
|
|||
* Increments the group value to simulate deletion of all keys under a group
|
||||
* old values will remain in storage until they expire.
|
||||
*
|
||||
* @param string $group The group to clear.
|
||||
* @return boolean success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -144,6 +144,7 @@ class MemcachedEngine extends CacheEngine {
|
|||
* Settings the memcached instance
|
||||
*
|
||||
* @throws CacheException when the Memcached extension is not built with the desired serializer engine
|
||||
* @return void
|
||||
*/
|
||||
protected function _setOptions() {
|
||||
$this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
|
||||
|
@ -265,7 +266,8 @@ class MemcachedEngine extends CacheEngine {
|
|||
/**
|
||||
* Delete all keys from the cache
|
||||
*
|
||||
* @param boolean $check
|
||||
* @param boolean $check If true no deletes will occur and instead CakePHP will rely
|
||||
* on key TTL values.
|
||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
||||
*/
|
||||
public function clear($check) {
|
||||
|
@ -322,6 +324,7 @@ class MemcachedEngine extends CacheEngine {
|
|||
* Increments the group value to simulate deletion of all keys under a group
|
||||
* old values will remain in storage until they expire.
|
||||
*
|
||||
* @param string $group The group to clear.
|
||||
* @return boolean success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -175,7 +175,8 @@ class RedisEngine extends CacheEngine {
|
|||
/**
|
||||
* Delete all keys from the cache
|
||||
*
|
||||
* @param boolean $check
|
||||
* @param boolean $check Whether or not expiration keys should be checked. If
|
||||
* true, no keys will be removed as cache will rely on redis TTL's.
|
||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
||||
*/
|
||||
public function clear($check) {
|
||||
|
@ -212,6 +213,7 @@ class RedisEngine extends CacheEngine {
|
|||
* Increments the group value to simulate deletion of all keys under a group
|
||||
* old values will remain in storage until they expire.
|
||||
*
|
||||
* @param string $group The group name to clear.
|
||||
* @return boolean success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -179,6 +179,7 @@ class WincacheEngine extends CacheEngine {
|
|||
* Increments the group value to simulate deletion of all keys under a group
|
||||
* old values will remain in storage until they expire.
|
||||
*
|
||||
* @param string $group The group to clear.
|
||||
* @return boolean success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -126,7 +126,8 @@ class XcacheEngine extends CacheEngine {
|
|||
/**
|
||||
* Delete all keys from the cache
|
||||
*
|
||||
* @param boolean $check
|
||||
* @param boolean $check If true no deletes will occur and instead CakePHP will rely
|
||||
* on key TTL values.
|
||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
||||
*/
|
||||
public function clear($check) {
|
||||
|
@ -163,6 +164,7 @@ class XcacheEngine extends CacheEngine {
|
|||
* Increments the group value to simulate deletion of all keys under a group
|
||||
* old values will remain in storage until they expire.
|
||||
*
|
||||
* @param string $group The group to clear.
|
||||
* @return boolean success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
|
|
|
@ -26,7 +26,7 @@ interface ConfigReaderInterface {
|
|||
* These sources can either be static resources like files, or dynamic ones like
|
||||
* a database, or other datasource.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $key Key to read.
|
||||
* @return array An array of data to merge into the runtime configuration
|
||||
*/
|
||||
public function read($key);
|
||||
|
|
|
@ -181,7 +181,7 @@ class IniReader implements ConfigReaderInterface {
|
|||
/**
|
||||
* Converts a value into the ini equivalent
|
||||
*
|
||||
* @param mixed $value to export.
|
||||
* @param mixed $val Value to export.
|
||||
* @return string String value for ini file.
|
||||
*/
|
||||
protected function _value($val) {
|
||||
|
|
|
@ -19,12 +19,15 @@
|
|||
<div class="<?php echo $pluralVar; ?> index">
|
||||
<h2><?php echo "<?php echo __('{$pluralHumanName}'); ?>"; ?></h2>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php foreach ($fields as $field): ?>
|
||||
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}'); ?>"; ?></th>
|
||||
<?php endforeach; ?>
|
||||
<th class="actions"><?php echo "<?php echo __('Actions'); ?>"; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
echo "<?php foreach (\${$pluralVar} as \${$singularVar}): ?>\n";
|
||||
echo "\t<tr>\n";
|
||||
|
@ -53,6 +56,7 @@
|
|||
|
||||
echo "<?php endforeach; ?>\n";
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<?php echo "<?php
|
||||
|
|
|
@ -39,8 +39,8 @@ class CakeErrorController extends AppController {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param CakeRequest $request
|
||||
* @param CakeResponse $response
|
||||
* @param CakeRequest $request Request instance.
|
||||
* @param CakeResponse $response Response instance.
|
||||
*/
|
||||
public function __construct($request = null, $response = null) {
|
||||
parent::__construct($request, $response);
|
||||
|
|
|
@ -53,8 +53,8 @@ class AclComponent extends Component {
|
|||
/**
|
||||
* Constructor. Will return an instance of the correct ACL class as defined in `Configure::read('Acl.classname')`
|
||||
*
|
||||
* @param ComponentCollection $collection
|
||||
* @param array $settings
|
||||
* @param ComponentCollection $collection Collection instance.
|
||||
* @param array $settings Settings list.
|
||||
* @throws CakeException when Acl.classname could not be loaded.
|
||||
*/
|
||||
public function __construct(ComponentCollection $collection, $settings = array()) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -66,7 +64,7 @@ abstract class AbstractPasswordHasher {
|
|||
* and check against existing hash.
|
||||
*
|
||||
* @param string|array $password Plain text password to hash or data array.
|
||||
* @param string Existing hashed password.
|
||||
* @param string $hashedPassword Existing hashed password.
|
||||
* @return boolean True if hashes match else false.
|
||||
*/
|
||||
abstract public function check($password, $hashedPassword);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -79,7 +77,7 @@ abstract class BaseAuthorize {
|
|||
* Checks user authorization.
|
||||
*
|
||||
* @param array $user Active user data
|
||||
* @param CakeRequest $request
|
||||
* @param CakeRequest $request Request instance.
|
||||
* @return boolean
|
||||
*/
|
||||
abstract public function authorize($user, CakeRequest $request);
|
||||
|
@ -107,7 +105,7 @@ abstract class BaseAuthorize {
|
|||
* that need to get information about the plugin, controller, and action being invoked.
|
||||
*
|
||||
* @param CakeRequest $request The request a path is needed for.
|
||||
* @param string $path
|
||||
* @param string $path Path format.
|
||||
* @return string the action path for the given request.
|
||||
*/
|
||||
public function action(CakeRequest $request, $path = '/:plugin/:controller/:action') {
|
||||
|
|
|
@ -78,7 +78,7 @@ class BasicAuthenticate extends BaseAuthenticate {
|
|||
$username = env('PHP_AUTH_USER');
|
||||
$pass = env('PHP_AUTH_PW');
|
||||
|
||||
if (empty($username) || empty($pass)) {
|
||||
if (!is_string($username) || $username === '' || !is_string($pass) || $pass === '') {
|
||||
return false;
|
||||
}
|
||||
return $this->_findUser($username, $pass);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -40,7 +38,7 @@ class BlowfishPasswordHasher extends AbstractPasswordHasher {
|
|||
* Check hash. Generate hash for user provided password and check against existing hash.
|
||||
*
|
||||
* @param string $password Plain text password to hash.
|
||||
* @param string Existing hashed password.
|
||||
* @param string $hashedPassword Existing hashed password.
|
||||
* @return boolean True if hashes match else false.
|
||||
*/
|
||||
public function check($password, $hashedPassword) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -58,7 +56,7 @@ class ControllerAuthorize extends BaseAuthorize {
|
|||
* Checks user authorization using a controller callback.
|
||||
*
|
||||
* @param array $user Active user data
|
||||
* @param CakeRequest $request
|
||||
* @param CakeRequest $request Request instance.
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize($user, CakeRequest $request) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -51,7 +49,7 @@ class FormAuthenticate extends BaseAuthenticate {
|
|||
}
|
||||
foreach (array($fields['username'], $fields['password']) as $field) {
|
||||
$value = $request->data($model . '.' . $field);
|
||||
if (empty($value) || !is_string($value)) {
|
||||
if (empty($value) && $value !== '0' || !is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -47,7 +45,7 @@ class SimplePasswordHasher extends AbstractPasswordHasher {
|
|||
* Check hash. Generate hash for user provided password and check against existing hash.
|
||||
*
|
||||
* @param string $password Plain text password to hash.
|
||||
* @param string Existing hashed password.
|
||||
* @param string $hashedPassword Existing hashed password.
|
||||
* @return boolean True if hashes match else false.
|
||||
*/
|
||||
public function check($password, $hashedPassword) {
|
||||
|
|
|
@ -512,7 +512,7 @@ class AuthComponent extends Component {
|
|||
* `$this->Auth->allow('edit', 'add');` or
|
||||
* `$this->Auth->allow();` to allow all actions
|
||||
*
|
||||
* @param string|array $action,... Controller action name or array of actions
|
||||
* @param string|array $action Controller action name or array of actions
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#making-actions-public
|
||||
*/
|
||||
|
@ -537,7 +537,7 @@ class AuthComponent extends Component {
|
|||
* `$this->Auth->deny('edit', 'add');` or
|
||||
* `$this->Auth->deny();` to remove all items from the allowed list
|
||||
*
|
||||
* @param string|array $action,... Controller action name or array of actions
|
||||
* @param string|array $action Controller action name or array of actions
|
||||
* @return void
|
||||
* @see AuthComponent::allow()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#making-actions-require-authorization
|
||||
|
|
|
@ -185,7 +185,7 @@ class CookieComponent extends Component {
|
|||
/**
|
||||
* Start CookieComponent for use in the controller
|
||||
*
|
||||
* @param Controller $controller
|
||||
* @param Controller $controller Controller instance.
|
||||
* @return void
|
||||
*/
|
||||
public function startup(Controller $controller) {
|
||||
|
@ -293,7 +293,7 @@ class CookieComponent extends Component {
|
|||
/**
|
||||
* Returns true if given variable is set in cookie.
|
||||
*
|
||||
* @param string $var Variable name to check for
|
||||
* @param string $key Variable name to check for
|
||||
* @return boolean True if variable is there
|
||||
*/
|
||||
public function check($key = null) {
|
||||
|
|
|
@ -423,7 +423,7 @@ class EmailComponent extends Component {
|
|||
/**
|
||||
* Format addresses to be an array with email as key and alias as value
|
||||
*
|
||||
* @param array $addresses
|
||||
* @param array $addresses Address to format.
|
||||
* @return array
|
||||
*/
|
||||
protected function _formatAddresses($addresses) {
|
||||
|
|
|
@ -224,7 +224,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 XML string.
|
||||
* @return array Xml array data
|
||||
*/
|
||||
public function convertXml($xml) {
|
||||
|
@ -246,7 +246,7 @@ class RequestHandlerComponent extends Component {
|
|||
* @param Controller $controller A reference to the controller
|
||||
* @param string|array $url A string or array containing the redirect location
|
||||
* @param integer|array $status HTTP Status for redirect
|
||||
* @param boolean $exit
|
||||
* @param boolean $exit Whether to exit script, defaults to `true`.
|
||||
* @return void
|
||||
*/
|
||||
public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
|
||||
|
@ -279,7 +279,7 @@ class RequestHandlerComponent extends Component {
|
|||
* render process is skipped. And the client will get a blank response with a
|
||||
* "304 Not Modified" header.
|
||||
*
|
||||
* @params Controller $controller
|
||||
* @param Controller $controller Controller instance.
|
||||
* @return boolean false if the render process should be aborted
|
||||
*/
|
||||
public function beforeRender(Controller $controller) {
|
||||
|
@ -444,7 +444,8 @@ class RequestHandlerComponent extends Component {
|
|||
/**
|
||||
* Gets remote client IP
|
||||
*
|
||||
* @param boolean $safe
|
||||
* @param boolean $safe Use safe = false when you think the user might manipulate
|
||||
* their HTTP_CLIENT_IP header. Setting $safe = false will also look at HTTP_X_FORWARDED_FOR
|
||||
* @return string Client IP address
|
||||
* @deprecated use $this->request->clientIp() from your, controller instead.
|
||||
*/
|
||||
|
|
|
@ -346,7 +346,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
* Provides backwards compatibility to avoid problems with empty and isset to alias properties.
|
||||
* Lazy loads models using the loadModel() method if declared in $uses
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $name Property name to check.
|
||||
* @return boolean
|
||||
*/
|
||||
public function __isset($name) {
|
||||
|
@ -412,8 +412,8 @@ class Controller extends Object implements CakeEventListener {
|
|||
/**
|
||||
* Provides backwards compatibility access for setting values to the request object.
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
* @param string $name Property name to set.
|
||||
* @param mixed $value Value to set.
|
||||
* @return void
|
||||
*/
|
||||
public function __set($name, $value) {
|
||||
|
@ -448,7 +448,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
* - $this->autoRender - To false if $request->params['return'] == 1
|
||||
* - $this->passedArgs - The the combined results of params['named'] and params['pass]
|
||||
*
|
||||
* @param CakeRequest $request
|
||||
* @param CakeRequest $request Request instance.
|
||||
* @return void
|
||||
*/
|
||||
public function setRequest(CakeRequest $request) {
|
||||
|
@ -471,7 +471,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
* Dispatches the controller action. Checks that the action
|
||||
* exists and isn't private.
|
||||
*
|
||||
* @param CakeRequest $request
|
||||
* @param CakeRequest $request Request instance.
|
||||
* @return mixed The resulting response.
|
||||
* @throws PrivateActionException When actions are not public or prefixed by _
|
||||
* @throws MissingActionException When actions are not defined and scaffolding is
|
||||
|
@ -528,7 +528,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
/**
|
||||
* Returns a scaffold object to use for dynamically scaffolded controllers.
|
||||
*
|
||||
* @param CakeRequest $request
|
||||
* @param CakeRequest $request Request instance.
|
||||
* @return Scaffold
|
||||
*/
|
||||
protected function _getScaffold(CakeRequest $request) {
|
||||
|
@ -887,11 +887,11 @@ class Controller extends Object implements CakeEventListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Validates models passed by parameters. Example:
|
||||
* Validates models passed by parameters. Takes a list of models as a variable argument.
|
||||
* Example:
|
||||
*
|
||||
* `$errors = $this->validateErrors($this->Article, $this->User);`
|
||||
*
|
||||
* @param mixed A list of models as a variable argument
|
||||
* @return array Validation errors, or false if none
|
||||
* @deprecated This method will be removed in 3.0
|
||||
*/
|
||||
|
@ -1145,7 +1145,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
/**
|
||||
* Alias to beforeScaffold()
|
||||
*
|
||||
* @param string $method
|
||||
* @param string $method Method name.
|
||||
* @return boolean
|
||||
* @see Controller::beforeScaffold()
|
||||
* @deprecated Will be removed in 3.0.
|
||||
|
@ -1168,7 +1168,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
/**
|
||||
* Alias to afterScaffoldSave()
|
||||
*
|
||||
* @param string $method
|
||||
* @param string $method Method name.
|
||||
* @return boolean
|
||||
* @see Controller::afterScaffoldSave()
|
||||
* @deprecated Will be removed in 3.0.
|
||||
|
@ -1191,7 +1191,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
/**
|
||||
* Alias to afterScaffoldSaveError()
|
||||
*
|
||||
* @param string $method
|
||||
* @param string $method Method name.
|
||||
* @return boolean
|
||||
* @see Controller::afterScaffoldSaveError()
|
||||
* @deprecated Will be removed in 3.0.
|
||||
|
@ -1216,7 +1216,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
/**
|
||||
* Alias to scaffoldError()
|
||||
*
|
||||
* @param string $method
|
||||
* @param string $method Method name.
|
||||
* @return boolean
|
||||
* @see Controller::scaffoldError()
|
||||
* @deprecated Will be removed in 3.0.
|
||||
|
|
|
@ -393,7 +393,7 @@ class App {
|
|||
*
|
||||
* `App::core('Cache/Engine'); will return the full path to the cache engines package`
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $type Package type.
|
||||
* @return array full path to package
|
||||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::core
|
||||
*/
|
||||
|
@ -587,9 +587,8 @@ class App {
|
|||
* Finds classes based on $name or specific file(s) to search. Calling App::import() will
|
||||
* not construct any classes contained in the files. It will only find and require() the file.
|
||||
*
|
||||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#including-files-with-app-import
|
||||
* @param string|array $type The type of Class if passed as a string, or all params can be passed as
|
||||
* an single array to $type,
|
||||
* an single array to $type.
|
||||
* @param string $name Name of the Class or a unique name for the file
|
||||
* @param boolean|array $parent boolean true if Class Parent should be searched, accepts key => value
|
||||
* array('parent' => $parent, 'file' => $file, 'search' => $search, 'ext' => '$ext');
|
||||
|
@ -600,6 +599,7 @@ class App {
|
|||
* @param boolean $return Return the loaded file, the file must have a return
|
||||
* statement in it to work: return $variable;
|
||||
* @return boolean true if Class is already in memory or if file is found and loaded, false if not
|
||||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#including-files-with-app-import
|
||||
*/
|
||||
public static function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) {
|
||||
$ext = null;
|
||||
|
|
|
@ -115,7 +115,7 @@ class CakePlugin {
|
|||
* The above example will load the bootstrap file for all plugins, but for DebugKit it will only load
|
||||
* the routes file and will not look for any bootstrap script.
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list. See CakePlugin::load() for valid options.
|
||||
* @return void
|
||||
*/
|
||||
public static function loadAll($options = array()) {
|
||||
|
@ -206,7 +206,7 @@ class CakePlugin {
|
|||
* Returns true if the plugin $plugin is already loaded
|
||||
* If plugin is null, it will return a list of all loaded plugins
|
||||
*
|
||||
* @param string $plugin
|
||||
* @param string $plugin Plugin name to check.
|
||||
* @return mixed boolean true if $plugin is already loaded.
|
||||
* If $plugin is null, returns a list of plugins that have been loaded
|
||||
*/
|
||||
|
|
|
@ -62,7 +62,7 @@ class Configure {
|
|||
* - Include app/Config/bootstrap.php.
|
||||
* - Setup error/exception handlers.
|
||||
*
|
||||
* @param boolean $boot
|
||||
* @param boolean $boot Whether to do bootstrapping.
|
||||
* @return void
|
||||
*/
|
||||
public static function bootstrap($boot = true) {
|
||||
|
@ -113,6 +113,7 @@ class Configure {
|
|||
|
||||
/**
|
||||
* Set app's default configs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function _appDefaults() {
|
||||
|
@ -143,11 +144,11 @@ class Configure {
|
|||
* ));
|
||||
* }}}
|
||||
*
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::write
|
||||
* @param string|array $config The key to write, can be a dot notation value.
|
||||
* Alternatively can be an array containing key(s) and value(s).
|
||||
* @param mixed $value Value to set for var
|
||||
* @return boolean True if write was successful
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::write
|
||||
*/
|
||||
public static function write($config, $value = null) {
|
||||
if (!is_array($config)) {
|
||||
|
@ -178,9 +179,9 @@ class Configure {
|
|||
* Configure::read('Name.key'); will return only the value of Configure::Name[key]
|
||||
* }}}
|
||||
*
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::read
|
||||
* @param string $var Variable to obtain. Use '.' to access array elements.
|
||||
* @return mixed value stored in configure, or null.
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::read
|
||||
*/
|
||||
public static function read($var = null) {
|
||||
if ($var === null) {
|
||||
|
@ -211,9 +212,9 @@ class Configure {
|
|||
* Configure::delete('Name.key'); will delete only the Configure::Name[key]
|
||||
* }}}
|
||||
*
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::delete
|
||||
* @param string $var the var to be deleted
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::delete
|
||||
*/
|
||||
public static function delete($var = null) {
|
||||
self::$_values = Hash::remove(self::$_values, $var);
|
||||
|
@ -240,7 +241,7 @@ class Configure {
|
|||
/**
|
||||
* Gets the names of the configured reader objects.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $name Name to check. If null returns all configured reader names.
|
||||
* @return array Array of the configured reader objects.
|
||||
*/
|
||||
public static function configured($name = null) {
|
||||
|
@ -283,12 +284,12 @@ class Configure {
|
|||
* If using `default` config and no reader has been configured for it yet,
|
||||
* one will be automatically created using PhpReader
|
||||
*
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::load
|
||||
* @param string $key name of configuration resource to load.
|
||||
* @param string $config Name of the configured reader to use to read the resource identified by $key.
|
||||
* @param boolean $merge if config files should be merged instead of simply overridden
|
||||
* @return boolean False if file not found, true if load successful.
|
||||
* @throws ConfigureException Will throw any exceptions the reader raises.
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::load
|
||||
*/
|
||||
public static function load($key, $config = 'default', $merge = true) {
|
||||
$reader = self::_getReader($config);
|
||||
|
|
|
@ -102,7 +102,7 @@ class ErrorHandler {
|
|||
* This will either use custom exception renderer class if configured,
|
||||
* or use the default ExceptionRenderer.
|
||||
*
|
||||
* @param Exception $exception
|
||||
* @param Exception $exception The exception to render.
|
||||
* @return void
|
||||
* @see http://php.net/manual/en/function.set-exception-handler.php
|
||||
*/
|
||||
|
@ -132,6 +132,7 @@ class ErrorHandler {
|
|||
|
||||
/**
|
||||
* Generates a formatted error message
|
||||
*
|
||||
* @param Exception $exception Exception instance
|
||||
* @return string Formatted message
|
||||
*/
|
||||
|
@ -159,8 +160,8 @@ class ErrorHandler {
|
|||
/**
|
||||
* Handles exception logging
|
||||
*
|
||||
* @param Exception $exception
|
||||
* @param array $config
|
||||
* @param Exception $exception The exception to render.
|
||||
* @param array $config An array of configuration for logging.
|
||||
* @return boolean
|
||||
*/
|
||||
protected static function _log(Exception $exception, $config) {
|
||||
|
|
|
@ -180,7 +180,7 @@ class ExceptionRenderer {
|
|||
/**
|
||||
* Generic handler for the internal framework errors CakePHP can generate.
|
||||
*
|
||||
* @param CakeException $error
|
||||
* @param CakeException $error The exception to render.
|
||||
* @return void
|
||||
*/
|
||||
protected function _cakeError(CakeException $error) {
|
||||
|
@ -202,7 +202,7 @@ class ExceptionRenderer {
|
|||
/**
|
||||
* Convenience method to display a 400 series page.
|
||||
*
|
||||
* @param Exception $error
|
||||
* @param Exception $error The exception to render.
|
||||
* @return void
|
||||
*/
|
||||
public function error400($error) {
|
||||
|
@ -225,7 +225,7 @@ class ExceptionRenderer {
|
|||
/**
|
||||
* Convenience method to display a 500 page.
|
||||
*
|
||||
* @param Exception $error
|
||||
* @param Exception $error The exception to render.
|
||||
* @return void
|
||||
*/
|
||||
public function error500($error) {
|
||||
|
@ -249,7 +249,7 @@ class ExceptionRenderer {
|
|||
/**
|
||||
* Convenience method to display a PDOException.
|
||||
*
|
||||
* @param PDOException $error
|
||||
* @param PDOException $error The exception to render.
|
||||
* @return void
|
||||
*/
|
||||
public function pdoError(PDOException $error) {
|
||||
|
|
|
@ -34,7 +34,7 @@ class CakeBaseException extends RuntimeException {
|
|||
/**
|
||||
* Get/set the response header to be used
|
||||
*
|
||||
* @param string|array $header. An array of header strings or a single header string
|
||||
* @param string|array $header An array of header strings or a single header string
|
||||
* - an associative array of "header name" => "header value"
|
||||
* - an array of string headers is also accepted
|
||||
* @param string $value The header value.
|
||||
|
@ -378,6 +378,12 @@ class MissingConnectionException extends CakeException {
|
|||
|
||||
protected $_messageTemplate = 'Database connection "%s" is missing, or could not be created.';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string|array $message The error message.
|
||||
* @param int $code The error code.
|
||||
*/
|
||||
public function __construct($message, $code = 500) {
|
||||
if (is_array($message)) {
|
||||
$message += array('enabled' => true);
|
||||
|
@ -587,10 +593,10 @@ class FatalErrorException extends CakeException {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $message
|
||||
* @param integer $code
|
||||
* @param string $file
|
||||
* @param integer $line
|
||||
* @param string $message The error message.
|
||||
* @param integer $code The error code.
|
||||
* @param string $file The file the error occurred in.
|
||||
* @param integer $line The line the error occurred on.
|
||||
*/
|
||||
public function __construct($message, $code = 500, $file = null, $line = null) {
|
||||
parent::__construct($message, $code);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -84,7 +82,7 @@ class CakeEvent {
|
|||
/**
|
||||
* Dynamically returns the name and subject if accessed directly
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param string $attribute Attribute name.
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($attribute) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -64,7 +62,7 @@ class CakeEventManager {
|
|||
*
|
||||
* If called with the first parameter, it will be set as the globally available instance
|
||||
*
|
||||
* @param CakeEventManager $manager
|
||||
* @param CakeEventManager $manager Optional event manager instance.
|
||||
* @return CakeEventManager the global event manager
|
||||
*/
|
||||
public static function instance($manager = null) {
|
||||
|
@ -118,7 +116,7 @@ class CakeEventManager {
|
|||
* Auxiliary function to attach all implemented callbacks of a CakeEventListener class instance
|
||||
* as individual methods on this manager
|
||||
*
|
||||
* @param CakeEventListener $subscriber
|
||||
* @param CakeEventListener $subscriber Event listener.
|
||||
* @return void
|
||||
*/
|
||||
protected function _attachSubscriber(CakeEventListener $subscriber) {
|
||||
|
@ -256,7 +254,7 @@ class CakeEventManager {
|
|||
/**
|
||||
* Returns a list of all listeners for an eventKey in the order they should be called
|
||||
*
|
||||
* @param string $eventKey
|
||||
* @param string $eventKey Event key.
|
||||
* @return array
|
||||
*/
|
||||
public function listeners($eventKey) {
|
||||
|
@ -288,7 +286,7 @@ class CakeEventManager {
|
|||
/**
|
||||
* Returns the listeners for the specified event key indexed by priority
|
||||
*
|
||||
* @param string $eventKey
|
||||
* @param string $eventKey Event key.
|
||||
* @return array
|
||||
*/
|
||||
public function prioritisedListeners($eventKey) {
|
||||
|
|
|
@ -48,7 +48,7 @@ class Multibyte {
|
|||
* Converts a multibyte character string
|
||||
* to the decimal value of the character
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $string String to convert.
|
||||
* @return array
|
||||
*/
|
||||
public static function utf8($string) {
|
||||
|
@ -87,7 +87,7 @@ class Multibyte {
|
|||
* Converts the decimal value of a multibyte character string
|
||||
* to a string
|
||||
*
|
||||
* @param array $array
|
||||
* @param array $array Values array.
|
||||
* @return string
|
||||
*/
|
||||
public static function ascii($array) {
|
||||
|
@ -728,7 +728,7 @@ class Multibyte {
|
|||
*
|
||||
* @param string $string value to encode
|
||||
* @param string $charset charset to use for encoding. defaults to UTF-8
|
||||
* @param string $newline
|
||||
* @param string $newline Newline string.
|
||||
* @return string
|
||||
*/
|
||||
public static function mimeEncode($string, $charset = null, $newline = "\r\n") {
|
||||
|
@ -774,7 +774,7 @@ class Multibyte {
|
|||
/**
|
||||
* Return the Code points range for Unicode characters
|
||||
*
|
||||
* @param integer $decimal
|
||||
* @param integer $decimal Decimal value.
|
||||
* @return string
|
||||
*/
|
||||
protected static function _codepoint($decimal) {
|
||||
|
@ -823,7 +823,7 @@ class Multibyte {
|
|||
* Find the related code folding values for $char
|
||||
*
|
||||
* @param integer $char decimal value of character
|
||||
* @param string $type
|
||||
* @param string $type Type 'lower' or 'upper'. Defaults to 'lower'.
|
||||
* @return array
|
||||
*/
|
||||
protected static function _find($char, $type = 'lower') {
|
||||
|
@ -860,7 +860,8 @@ class Multibyte {
|
|||
|
||||
/**
|
||||
* Check the $string for multibyte characters
|
||||
* @param string $string value to test
|
||||
*
|
||||
* @param string $string Value to test.
|
||||
* @return boolean
|
||||
*/
|
||||
public static function checkMultibyte($string) {
|
||||
|
|
|
@ -356,9 +356,9 @@ class CakeLog {
|
|||
/**
|
||||
* Gets the logging engine from the active streams.
|
||||
*
|
||||
* @see BaseLog
|
||||
* @param string $streamName Key name of a configured stream to get.
|
||||
* @return mixed instance of BaseLog or false if not found
|
||||
* @see BaseLog
|
||||
*/
|
||||
public static function stream($streamName) {
|
||||
if (empty(self::$_Collection)) {
|
||||
|
|
|
@ -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 Message type.
|
||||
* @param string $message Message to write.
|
||||
* @return void
|
||||
*/
|
||||
public function write($type, $message);
|
||||
|
|
|
@ -83,7 +83,7 @@ class FileLog extends BaseLog {
|
|||
* - `mask` A mask is applied when log files are created. Left empty no chmod
|
||||
* is made.
|
||||
*
|
||||
* @param array $options Options for the FileLog, see above.
|
||||
* @param array $config Options for the FileLog, see above.
|
||||
*/
|
||||
public function __construct($config = array()) {
|
||||
$config = Hash::merge($this->_defaults, $config);
|
||||
|
@ -157,6 +157,7 @@ class FileLog extends BaseLog {
|
|||
|
||||
/**
|
||||
* Get filename
|
||||
*
|
||||
* @param string $type The type of log.
|
||||
* @return string File name
|
||||
*/
|
||||
|
|
|
@ -87,7 +87,7 @@ class SyslogLog extends BaseLog {
|
|||
* Make sure the configuration contains the format parameter, by default it uses
|
||||
* the error number and the type as a prefix to the message
|
||||
*
|
||||
* @param array $config
|
||||
* @param array $config Options list.
|
||||
*/
|
||||
public function __construct($config = array()) {
|
||||
$config += $this->_defaults;
|
||||
|
@ -142,8 +142,8 @@ class SyslogLog extends BaseLog {
|
|||
* Extracts the call to syslog() in order to run unit tests on it. This function
|
||||
* will perform the actual write in the system logger
|
||||
*
|
||||
* @param integer $priority
|
||||
* @param string $message
|
||||
* @param integer $priority Message priority.
|
||||
* @param string $message Message to log.
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _write($priority, $message) {
|
||||
|
|
|
@ -599,7 +599,7 @@ class CakeSchema extends Object {
|
|||
/**
|
||||
* Formats Schema columns from Model Object
|
||||
*
|
||||
* @param array $Obj model object
|
||||
* @param array &$Obj model object
|
||||
* @return array Formatted columns
|
||||
*/
|
||||
protected function _columns(&$Obj) {
|
||||
|
|
|
@ -119,7 +119,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
* If you do not want this to happen, make a copy of `$data` before passing it
|
||||
* to this method
|
||||
*
|
||||
* @param array $data Record data to validate. This should be an array indexed by association name.
|
||||
* @param array &$data Record data to validate. This should be an array indexed by association name.
|
||||
* @param array $options Options to use when validating record data (see above), See also $options of validates().
|
||||
* @return array|boolean If atomic: True on success, or false on failure.
|
||||
* Otherwise: array similar to the $data array passed, but values are set to true/false
|
||||
|
@ -196,7 +196,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
* If you do not want this to happen, make a copy of `$data` before passing it
|
||||
* to this method
|
||||
*
|
||||
* @param array $data Record data to validate. This should be a numerically-indexed array
|
||||
* @param array &$data Record data to validate. This should be a numerically-indexed array
|
||||
* @param array $options Options to use when validating record data (see above), See also $options of validates().
|
||||
* @return mixed If atomic: True on success, or false on failure.
|
||||
* Otherwise: array similar to the $data array passed, but values are set to true/false
|
||||
|
@ -442,7 +442,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
/**
|
||||
* Propagates beforeValidate event
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options to pass to callback.
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _triggerBeforeValidate($options = array()) {
|
||||
|
@ -544,7 +544,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
* ));
|
||||
* }}}
|
||||
*
|
||||
* @param string $field The name of the field from which the rule will be removed
|
||||
* @param string $field The name of the field where the rule is to be added
|
||||
* @param string|array|CakeValidationSet $name name of the rule to be added or list of rules for the field
|
||||
* @param array|CakeValidationRule $rule or list of rules to be added to the field's rule set
|
||||
* @return ModelValidator this instance
|
||||
|
|
|
@ -157,7 +157,7 @@ class CakeValidationRule {
|
|||
* Checks whether the field failed the `field should be present` validation
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param array $data Data to check rule against
|
||||
* @param array &$data Data to check rule against
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkRequired($field, &$data) {
|
||||
|
@ -174,7 +174,7 @@ class CakeValidationRule {
|
|||
* Checks if the allowEmpty key applies
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param array $data data to check rule against
|
||||
* @param array &$data data to check rule against
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkEmpty($field, &$data) {
|
||||
|
@ -259,8 +259,8 @@ class CakeValidationRule {
|
|||
* Dispatches the validation rule to the given validator method
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param array $data Data array
|
||||
* @param array $methods Methods list
|
||||
* @param array &$data Data array
|
||||
* @param array &$methods Methods list
|
||||
* @return boolean True if the rule could be dispatched, false otherwise
|
||||
*/
|
||||
public function process($field, &$data, &$methods) {
|
||||
|
@ -334,7 +334,7 @@ class CakeValidationRule {
|
|||
* Parses the rule and sets the rule and ruleParams
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param array $data Data array
|
||||
* @param array &$data Data array
|
||||
* @return void
|
||||
*/
|
||||
protected function _parseRule($field, &$data) {
|
||||
|
|
|
@ -74,8 +74,8 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $fieldName The fieldname
|
||||
* @param array $ruleset
|
||||
* @param string $fieldName The fieldname.
|
||||
* @param array $ruleSet Rules set.
|
||||
*/
|
||||
public function __construct($fieldName, $ruleSet) {
|
||||
$this->field = $fieldName;
|
||||
|
@ -93,7 +93,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
|
|||
/**
|
||||
* Sets the list of methods to use for validation
|
||||
*
|
||||
* @param array $methods Methods list
|
||||
* @param array &$methods Methods list
|
||||
* @return void
|
||||
*/
|
||||
public function setMethods(&$methods) {
|
||||
|
@ -160,7 +160,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
|
|||
/**
|
||||
* Gets a rule for a given name if exists
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $name Field name.
|
||||
* @return CakeValidationRule
|
||||
*/
|
||||
public function getRule($name) {
|
||||
|
@ -330,11 +330,10 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
|
|||
* This is a wrapper for ArrayAccess. Use setRule() directly for
|
||||
* chainable access.
|
||||
*
|
||||
* @see http://www.php.net/manual/en/arrayobject.offsetset.php
|
||||
*
|
||||
* @param string $index name of the rule
|
||||
* @param CakeValidationRule|array rule to add to $index
|
||||
* @param string $index Name of the rule.
|
||||
* @param CakeValidationRule|array $rule Rule to add to $index.
|
||||
* @return void
|
||||
* @see http://www.php.net/manual/en/arrayobject.offsetset.php
|
||||
*/
|
||||
public function offsetSet($index, $rule) {
|
||||
$this->setRule($index, $rule);
|
||||
|
|
|
@ -793,7 +793,7 @@ class CakeRequest implements ArrayAccess {
|
|||
* Only qualifiers will be extracted, any other accept extensions will be
|
||||
* discarded as they are not frequently used.
|
||||
*
|
||||
* @param string $header
|
||||
* @param string $header Header to parse.
|
||||
* @return array
|
||||
*/
|
||||
protected static function _parseAcceptWithQualifier($header) {
|
||||
|
@ -854,7 +854,7 @@ class CakeRequest implements ArrayAccess {
|
|||
* You can write to any value, even paths/keys that do not exist, and the arrays
|
||||
* will be created for you.
|
||||
*
|
||||
* @param string $name,... Dot separated name of the value to read/write
|
||||
* @param string $name Dot separated name of the value to read/write, one or more args.
|
||||
* @return mixed Either the value being read, or this so you can chain consecutive writes.
|
||||
*/
|
||||
public function data($name) {
|
||||
|
@ -950,11 +950,11 @@ class CakeRequest implements ArrayAccess {
|
|||
/**
|
||||
* Alias of CakeRequest::allowMethod() for backwards compatibility.
|
||||
*
|
||||
* @see CakeRequest::allowMethod()
|
||||
* @deprecated 2.5 Use CakeRequest::allowMethod() instead.
|
||||
* @param string|array $methods Allowed HTTP request methods.
|
||||
* @return boolean true
|
||||
* @throws MethodNotAllowedException
|
||||
* @see CakeRequest::allowMethod()
|
||||
* @deprecated 2.5 Use CakeRequest::allowMethod() instead.
|
||||
*/
|
||||
public function onlyAllow($methods) {
|
||||
if (!is_array($methods)) {
|
||||
|
|
|
@ -559,10 +559,10 @@ class CakeResponse {
|
|||
* e.g `header('WWW-Authenticate: Negotiate'); header('WWW-Authenticate: Not-Negotiate');`
|
||||
* will have the same effect as only doing `header('WWW-Authenticate: Not-Negotiate');`
|
||||
*
|
||||
* @param string|array $header. An array of header strings or a single header string
|
||||
* @param string|array $header An array of header strings or a single header string
|
||||
* - an associative array of "header name" => "header value" is also accepted
|
||||
* - an array of string headers is also accepted
|
||||
* @param string|array $value. The header value(s)
|
||||
* @param string|array $value The header value(s)
|
||||
* @return array list of headers to be sent
|
||||
*/
|
||||
public function header($header = null, $value = null) {
|
||||
|
@ -586,6 +586,7 @@ class CakeResponse {
|
|||
* Acccessor for the location header.
|
||||
*
|
||||
* Get/Set the Location header value.
|
||||
*
|
||||
* @param null|string $url Either null to get the current location, or a string to set one.
|
||||
* @return string|null When setting the location null will be returned. When reading the location
|
||||
* a string of the current location header value (if any) will be returned.
|
||||
|
@ -702,7 +703,7 @@ class CakeResponse {
|
|||
*
|
||||
* e.g `type(array('jpg' => 'text/plain'));`
|
||||
*
|
||||
* @param string $contentType
|
||||
* @param string $contentType Content type key.
|
||||
* @return mixed current content type or false if supplied an invalid content type
|
||||
*/
|
||||
public function type($contentType = null) {
|
||||
|
@ -765,7 +766,7 @@ class CakeResponse {
|
|||
* Sets the response charset
|
||||
* if $charset is null the current charset is returned
|
||||
*
|
||||
* @param string $charset
|
||||
* @param string $charset Character set string.
|
||||
* @return string current charset
|
||||
*/
|
||||
public function charset($charset = null) {
|
||||
|
@ -892,8 +893,8 @@ class CakeResponse {
|
|||
* with the origin.
|
||||
* If called with no parameters, this function will return whether must-revalidate is present.
|
||||
*
|
||||
* @param integer $seconds if null, the method will return the current
|
||||
* must-revalidate value
|
||||
* @param boolean $enable If null returns whether directive is set, if boolean
|
||||
* sets or unsets directive.
|
||||
* @return boolean
|
||||
*/
|
||||
public function mustRevalidate($enable = null) {
|
||||
|
@ -934,7 +935,7 @@ class CakeResponse {
|
|||
* `$response->expires(new DateTime('+1 day'))` Will set the expiration in next 24 hours
|
||||
* `$response->expires()` Will return the current expiration header value
|
||||
*
|
||||
* @param string|DateTime $time
|
||||
* @param string|DateTime $time Valid time string or DateTime object.
|
||||
* @return string
|
||||
*/
|
||||
public function expires($time = null) {
|
||||
|
@ -958,7 +959,7 @@ class CakeResponse {
|
|||
* `$response->modified(new DateTime('+1 day'))` Will set the modification date in the past 24 hours
|
||||
* `$response->modified()` Will return the current Last-Modified header value
|
||||
*
|
||||
* @param string|DateTime $time
|
||||
* @param string|DateTime $time Valid time string or DateTime object.
|
||||
* @return string
|
||||
*/
|
||||
public function modified($time = null) {
|
||||
|
@ -1033,7 +1034,7 @@ class CakeResponse {
|
|||
*
|
||||
* If no parameters are passed, current Etag header is returned.
|
||||
*
|
||||
* @param string $hash the unique has that identifies this response
|
||||
* @param string $tag Tag to set.
|
||||
* @param boolean $weak whether the response is semantically the same as
|
||||
* other with the same hash or not
|
||||
* @return string
|
||||
|
@ -1052,7 +1053,7 @@ class CakeResponse {
|
|||
* Returns a DateTime object initialized at the $time param and using UTC
|
||||
* as timezone
|
||||
*
|
||||
* @param string|integer|DateTime $time
|
||||
* @param string|DateTime $time Valid time string or unix timestamp or DateTime object.
|
||||
* @return DateTime
|
||||
*/
|
||||
protected function _getUTCDate($time = null) {
|
||||
|
@ -1104,7 +1105,7 @@ class CakeResponse {
|
|||
* Sets the protocol to be used when sending the response. Defaults to HTTP/1.1
|
||||
* If called with no arguments, it will return the current configured protocol
|
||||
*
|
||||
* @param string protocol to be used for sending response
|
||||
* @param string $protocol Protocol to be used for sending response.
|
||||
* @return string protocol currently set
|
||||
*/
|
||||
public function protocol($protocol = null) {
|
||||
|
@ -1287,8 +1288,8 @@ class CakeResponse {
|
|||
/**
|
||||
* Normalize the origin to regular expressions and put in an array format
|
||||
*
|
||||
* @param array $domains
|
||||
* @param boolean $requestIsSSL
|
||||
* @param array $domains Domains to normalize
|
||||
* @param boolean $requestIsSSL Whether it's a SSL request.
|
||||
* @return array
|
||||
*/
|
||||
protected function _normalizeCorsDomains($domains, $requestIsSSL = false) {
|
||||
|
|
|
@ -182,8 +182,8 @@ class CakeSocket {
|
|||
*
|
||||
* Instead we need to handle those errors manually.
|
||||
*
|
||||
* @param integer $code
|
||||
* @param string $message
|
||||
* @param integer $code Code.
|
||||
* @param string $message Message.
|
||||
* @return void
|
||||
*/
|
||||
protected function _connectionErrorHandler($code, $message) {
|
||||
|
|
|
@ -26,8 +26,8 @@ class BasicAuthentication {
|
|||
/**
|
||||
* Authentication
|
||||
*
|
||||
* @param HttpSocket $http
|
||||
* @param array $authInfo
|
||||
* @param HttpSocket $http Http socket instance.
|
||||
* @param array &$authInfo Authentication info.
|
||||
* @return void
|
||||
* @see http://www.ietf.org/rfc/rfc2617.txt
|
||||
*/
|
||||
|
@ -40,8 +40,8 @@ class BasicAuthentication {
|
|||
/**
|
||||
* Proxy Authentication
|
||||
*
|
||||
* @param HttpSocket $http
|
||||
* @param array $proxyInfo
|
||||
* @param HttpSocket $http Http socket instance.
|
||||
* @param array &$proxyInfo Proxy info.
|
||||
* @return void
|
||||
* @see http://www.ietf.org/rfc/rfc2617.txt
|
||||
*/
|
||||
|
@ -54,8 +54,8 @@ class BasicAuthentication {
|
|||
/**
|
||||
* Generate basic [proxy] authentication header
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $pass
|
||||
* @param string $user Username.
|
||||
* @param string $pass Password.
|
||||
* @return string
|
||||
*/
|
||||
protected static function _generateHeader($user, $pass) {
|
||||
|
|
|
@ -26,8 +26,8 @@ class DigestAuthentication {
|
|||
/**
|
||||
* Authentication
|
||||
*
|
||||
* @param HttpSocket $http
|
||||
* @param array $authInfo
|
||||
* @param HttpSocket $http Http socket instance.
|
||||
* @param array &$authInfo Authentication info.
|
||||
* @return void
|
||||
* @link http://www.ietf.org/rfc/rfc2617.txt
|
||||
*/
|
||||
|
@ -43,8 +43,8 @@ class DigestAuthentication {
|
|||
/**
|
||||
* Retrieve information about the authentication
|
||||
*
|
||||
* @param HttpSocket $http
|
||||
* @param array $authInfo
|
||||
* @param HttpSocket $http Http socket instance.
|
||||
* @param array &$authInfo Authentication info.
|
||||
* @return boolean
|
||||
*/
|
||||
protected static function _getServerInformation(HttpSocket $http, &$authInfo) {
|
||||
|
@ -70,8 +70,8 @@ class DigestAuthentication {
|
|||
/**
|
||||
* Generate the header Authorization
|
||||
*
|
||||
* @param HttpSocket $http
|
||||
* @param array $authInfo
|
||||
* @param HttpSocket $http Http socket instance.
|
||||
* @param array &$authInfo Authentication info.
|
||||
* @return string
|
||||
*/
|
||||
protected static function _generateHeader(HttpSocket $http, &$authInfo) {
|
||||
|
|
|
@ -543,7 +543,7 @@ class HttpSocket extends CakeSocket {
|
|||
*
|
||||
* Would return `/search?q=socket`.
|
||||
*
|
||||
* @param string|array Either a string or array of URL options to create a URL with.
|
||||
* @param string|array $url Either a string or array of URL options to create a URL with.
|
||||
* @param string $uriTemplate A template string to use for URL formatting.
|
||||
* @return mixed Either false on failure or a string containing the composed URL.
|
||||
*/
|
||||
|
@ -910,7 +910,7 @@ class HttpSocket extends CakeSocket {
|
|||
* Builds the header.
|
||||
*
|
||||
* @param array $header Header to build
|
||||
* @param string $mode
|
||||
* @param string $mode Mode
|
||||
* @return string Header built from array
|
||||
*/
|
||||
protected function _buildHeader($header, $mode = 'standard') {
|
||||
|
@ -972,7 +972,7 @@ class HttpSocket extends CakeSocket {
|
|||
* Escapes a given $token according to RFC 2616 (HTTP 1.1 specs)
|
||||
*
|
||||
* @param string $token Token to escape
|
||||
* @param array $chars
|
||||
* @param array $chars Characters to escape
|
||||
* @return string Escaped token
|
||||
*/
|
||||
protected function _escapeToken($token, $chars = null) {
|
||||
|
@ -985,7 +985,7 @@ class HttpSocket extends CakeSocket {
|
|||
* Gets escape chars according to RFC 2616 (HTTP 1.1 specs).
|
||||
*
|
||||
* @param boolean $hex true to get them as HEX values, false otherwise
|
||||
* @param array $chars
|
||||
* @param array $chars Characters to escape
|
||||
* @return array Escape chars
|
||||
*/
|
||||
protected function _tokenEscapeChars($hex = true, $chars = null) {
|
||||
|
|
|
@ -82,7 +82,7 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $message Message to parse.
|
||||
*/
|
||||
public function __construct($message = null) {
|
||||
if ($message !== null) {
|
||||
|
@ -102,8 +102,8 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* Get header in case insensitive
|
||||
*
|
||||
* @param string $name Header name
|
||||
* @param array $headers
|
||||
* @param string $name Header name.
|
||||
* @param array $headers Headers to format.
|
||||
* @return mixed String if header exists or null
|
||||
*/
|
||||
public function getHeader($name, $headers = null) {
|
||||
|
@ -331,8 +331,8 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* Unescapes a given $token according to RFC 2616 (HTTP 1.1 specs)
|
||||
*
|
||||
* @param string $token Token to unescape
|
||||
* @param array $chars
|
||||
* @param string $token Token to unescape.
|
||||
* @param array $chars Characters to unescape.
|
||||
* @return string Unescaped token
|
||||
*/
|
||||
protected function _unescapeToken($token, $chars = null) {
|
||||
|
@ -344,8 +344,8 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* Gets escape chars according to RFC 2616 (HTTP 1.1 specs).
|
||||
*
|
||||
* @param boolean $hex true to get them as HEX values, false otherwise
|
||||
* @param array $chars
|
||||
* @param boolean $hex True to get them as HEX values, false otherwise.
|
||||
* @param array $chars Characters to uescape.
|
||||
* @return array Escape chars
|
||||
*/
|
||||
protected function _tokenEscapeChars($hex = true, $chars = null) {
|
||||
|
@ -371,7 +371,7 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* ArrayAccess - Offset Exists
|
||||
*
|
||||
* @param string $offset
|
||||
* @param string $offset Offset to check.
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset) {
|
||||
|
@ -381,7 +381,7 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* ArrayAccess - Offset Get
|
||||
*
|
||||
* @param string $offset
|
||||
* @param string $offset Offset to get.
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset) {
|
||||
|
@ -418,8 +418,8 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* ArrayAccess - Offset Set
|
||||
*
|
||||
* @param string $offset
|
||||
* @param mixed $value
|
||||
* @param string $offset Offset to set.
|
||||
* @param mixed $value Value.
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value) {
|
||||
|
@ -428,7 +428,7 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
/**
|
||||
* ArrayAccess - Offset Unset
|
||||
*
|
||||
* @param string $offset
|
||||
* @param string $offset Offset to unset.
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset) {
|
||||
|
|
|
@ -85,7 +85,7 @@ class Dispatcher implements CakeEventListener {
|
|||
* Attaches all event listeners for this dispatcher instance. Loads the
|
||||
* dispatcher filters from the configured locations.
|
||||
*
|
||||
* @param CakeEventManager $manager
|
||||
* @param CakeEventManager $manager Event manager instance.
|
||||
* @return void
|
||||
* @throws MissingDispatcherFilterException
|
||||
*/
|
||||
|
@ -244,7 +244,7 @@ class Dispatcher implements CakeEventListener {
|
|||
/**
|
||||
* Load controller and return controller class name
|
||||
*
|
||||
* @param CakeRequest $request
|
||||
* @param CakeRequest $request Request instance.
|
||||
* @return string|boolean Name of controller class name
|
||||
*/
|
||||
protected function _loadController($request) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -44,7 +42,7 @@ abstract class DispatcherFilter implements CakeEventListener {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $setting Configuration settings for the filter.
|
||||
* @param array $settings Configuration settings for the filter.
|
||||
*/
|
||||
public function __construct($settings = array()) {
|
||||
$this->settings = Hash::merge($this->settings, $settings);
|
||||
|
|
|
@ -108,7 +108,7 @@ class AssetDispatcher extends DispatcherFilter {
|
|||
/**
|
||||
* Builds asset file path based off url
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $url URL
|
||||
* @return string Absolute path for asset file
|
||||
*/
|
||||
protected function _getAssetFile($url) {
|
||||
|
|
|
@ -536,7 +536,10 @@ class CakeRoute {
|
|||
$out = str_replace($search, $replace, $out);
|
||||
}
|
||||
|
||||
if (strpos($this->template, '*')) {
|
||||
if (strpos($this->template, '**') !== false) {
|
||||
$out = str_replace('**', $params['pass'], $out);
|
||||
$out = str_replace('%2F', '/', $out);
|
||||
} elseif (strpos($this->template, '*') !== false) {
|
||||
$out = str_replace('*', $params['pass'], $out);
|
||||
}
|
||||
$out = str_replace('//', '/', $out);
|
||||
|
|
|
@ -113,7 +113,7 @@ class RedirectRoute extends CakeRoute {
|
|||
* Stop execution of the current script. Wraps exit() making
|
||||
* testing easier.
|
||||
*
|
||||
* @param integer|string $status see http://php.net/exit for values
|
||||
* @param integer|string $code See http://php.net/exit for values
|
||||
* @return void
|
||||
*/
|
||||
protected function _stop($code = 0) {
|
||||
|
|
|
@ -636,7 +636,7 @@ class Router {
|
|||
/**
|
||||
* Parses a file extension out of a URL, if Router::parseExtensions() is enabled.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $url URL.
|
||||
* @return array Returns an array containing the altered URL and the parsed extension.
|
||||
*/
|
||||
protected static function _parseExtension($url) {
|
||||
|
|
|
@ -126,10 +126,35 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
$_SERVER['PHP_AUTH_PW'] = "' OR 1 = 1";
|
||||
|
||||
$this->assertFalse($this->auth->getUser($request));
|
||||
|
||||
$this->assertFalse($this->auth->authenticate($request, $this->response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that username of 0 works.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthenticateUsernameZero() {
|
||||
$User = ClassRegistry::init('User');
|
||||
$User->updateAll(array('user' => $User->getDataSource()->value('0')), array('user' => 'mariano'));
|
||||
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array('User' => array(
|
||||
'user' => '0',
|
||||
'password' => 'password'
|
||||
));
|
||||
$_SERVER['PHP_AUTH_USER'] = '0';
|
||||
$_SERVER['PHP_AUTH_PW'] = 'password';
|
||||
|
||||
$expected = array(
|
||||
'id' => 1,
|
||||
'user' => '0',
|
||||
'created' => '2007-03-17 01:16:23',
|
||||
'updated' => '2007-03-17 01:18:31'
|
||||
);
|
||||
$this->assertEquals($expected, $this->auth->authenticate($request, $this->response));
|
||||
}
|
||||
|
||||
/**
|
||||
* test that challenge headers are sent when no credentials are found.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
* FormAuthenticateTest file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -166,6 +164,13 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
));
|
||||
$this->assertFalse($this->auth->authenticate($request, $this->response));
|
||||
|
||||
$request->data = array(
|
||||
'User' => array(
|
||||
'user' => array(),
|
||||
'password' => 'my password'
|
||||
));
|
||||
$this->assertFalse($this->auth->authenticate($request, $this->response));
|
||||
|
||||
$request->data = array(
|
||||
'User' => array(
|
||||
'user' => 'mariano',
|
||||
|
@ -226,6 +231,30 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
$this->assertFalse($this->auth->authenticate($request, $this->response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that username of 0 works.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthenticateUsernameZero() {
|
||||
$User = ClassRegistry::init('User');
|
||||
$User->updateAll(array('user' => $User->getDataSource()->value('0')), array('user' => 'mariano'));
|
||||
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array('User' => array(
|
||||
'user' => '0',
|
||||
'password' => 'password'
|
||||
));
|
||||
|
||||
$expected = array(
|
||||
'id' => 1,
|
||||
'user' => '0',
|
||||
'created' => '2007-03-17 01:16:23',
|
||||
'updated' => '2007-03-17 01:18:31'
|
||||
);
|
||||
$this->assertEquals($expected, $this->auth->authenticate($request, $this->response));
|
||||
}
|
||||
|
||||
/**
|
||||
* test a model in a plugin.
|
||||
*
|
||||
|
|
|
@ -1745,7 +1745,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
|
||||
$socket = new HttpSocket();
|
||||
try {
|
||||
$socket->get('https://typography.com');
|
||||
$socket->get('https://tv.eurosport.com/');
|
||||
$this->markTestSkipped('Found valid certificate, was expecting invalid certificate.');
|
||||
} catch (SocketException $e) {
|
||||
$message = $e->getMessage();
|
||||
|
|
|
@ -873,6 +873,23 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test match() with trailing ** style routes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testMatchTrailing() {
|
||||
$route = new CakeRoute('/pages/**', array('controller' => 'pages', 'action' => 'display'));
|
||||
$id = 'test/ spaces/漢字/la†în';
|
||||
$result = $route->match(array(
|
||||
'controller' => 'pages',
|
||||
'action' => 'display',
|
||||
$id
|
||||
));
|
||||
$expected = '/pages/test/%20spaces/%E6%BC%A2%E5%AD%97/la%E2%80%A0%C3%AEn';
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* test restructuring args with pass key
|
||||
*
|
||||
|
|
|
@ -23,6 +23,11 @@ App::uses('Hash', 'Utility');
|
|||
*/
|
||||
class HashTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
* Data provider
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function articleData() {
|
||||
return array(
|
||||
array(
|
||||
|
@ -136,6 +141,11 @@ class HashTest extends CakeTestCase {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function userData() {
|
||||
return array(
|
||||
array(
|
||||
|
@ -1021,7 +1031,7 @@ class HashTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testSort() {
|
||||
$result = Hash::sort(array(), '{n}.name', 'asc');
|
||||
$result = Hash::sort(array(), '{n}.name');
|
||||
$this->assertEquals(array(), $result);
|
||||
|
||||
$a = array(
|
||||
|
@ -1044,7 +1054,7 @@ class HashTest extends CakeTestCase {
|
|||
'Friend' => array(array('name' => 'Nate'))
|
||||
)
|
||||
);
|
||||
$a = Hash::sort($a, '{n}.Friend.{n}.name', 'asc');
|
||||
$a = Hash::sort($a, '{n}.Friend.{n}.name');
|
||||
$this->assertEquals($a, $b);
|
||||
|
||||
$b = array(
|
||||
|
@ -1786,6 +1796,11 @@ class HashTest extends CakeTestCase {
|
|||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testApply
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApply() {
|
||||
$data = self::articleData();
|
||||
|
||||
|
@ -1808,8 +1823,8 @@ class HashTest extends CakeTestCase {
|
|||
/**
|
||||
* testing method for map callbacks.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return mixed.
|
||||
* @param mixed $value Value
|
||||
* @return mixed
|
||||
*/
|
||||
public function mapCallback($value) {
|
||||
return $value * 2;
|
||||
|
@ -1818,9 +1833,9 @@ class HashTest extends CakeTestCase {
|
|||
/**
|
||||
* testing method for reduce callbacks.
|
||||
*
|
||||
* @param mixed $one
|
||||
* @param mixed $two
|
||||
* @return mixed.
|
||||
* @param mixed $one First param
|
||||
* @param mixed $two Second param
|
||||
* @return mixed
|
||||
*/
|
||||
public function reduceCallback($one, $two) {
|
||||
return $one + $two;
|
||||
|
|
|
@ -800,12 +800,12 @@ class Hash {
|
|||
*
|
||||
* @param array $data An array of data to sort
|
||||
* @param string $path A Set-compatible path to the array value
|
||||
* @param string $dir See directions above.
|
||||
* @param string $dir See directions above. Defaults to 'asc'.
|
||||
* @param string $type See direction types above. Defaults to 'regular'.
|
||||
* @return array Sorted array of data
|
||||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::sort
|
||||
*/
|
||||
public static function sort(array $data, $path, $dir, $type = 'regular') {
|
||||
public static function sort(array $data, $path, $dir = 'asc', $type = 'regular') {
|
||||
if (empty($data)) {
|
||||
return array();
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ class Helper extends Object {
|
|||
* Provides backwards compatibility access for setting values to the request object.
|
||||
*
|
||||
* @param string $name Name of the property being accessed.
|
||||
* @param mixed $value
|
||||
* @param mixed $value Value to set.
|
||||
* @return void
|
||||
* @deprecated This method will be removed in 3.0
|
||||
*/
|
||||
|
@ -299,7 +299,7 @@ class Helper extends Object {
|
|||
* Generate URL for given asset file. Depending on options passed provides full URL with domain name.
|
||||
* Also calls Helper::assetTimestamp() to add timestamp to local files
|
||||
*
|
||||
* @param string|array Path string or URL array
|
||||
* @param string|array $path Path string or URL array
|
||||
* @param array $options Options array. Possible keys:
|
||||
* `fullBase` Return full URL with domain name
|
||||
* `pathPrefix` Path prefix for relative URLs
|
||||
|
@ -665,7 +665,7 @@ class Helper extends Object {
|
|||
*
|
||||
* @param array|string $options If an array, should be an array of attributes that $key needs to be added to.
|
||||
* If a string or null, will be used as the View entity.
|
||||
* @param string $field
|
||||
* @param string $field Field name.
|
||||
* @param string $key The name of the attribute to be set, defaults to 'name'
|
||||
* @return mixed If an array was given for $options, an array with $key set will be returned.
|
||||
* If a string was supplied a string will be returned.
|
||||
|
@ -706,7 +706,7 @@ class Helper extends Object {
|
|||
*
|
||||
* @param array|string $options If an array, should be an array of attributes that $key needs to be added to.
|
||||
* If a string or null, will be used as the View entity.
|
||||
* @param string $field
|
||||
* @param string $field Field name.
|
||||
* @param string $key The name of the attribute to be set, defaults to 'value'
|
||||
* @return mixed If an array was given for $options, an array with $key set will be returned.
|
||||
* If a string was supplied a string will be returned.
|
||||
|
@ -881,8 +881,8 @@ class Helper extends Object {
|
|||
* Transforms a recordset from a hasAndBelongsToMany association to a list of selected
|
||||
* options for a multiple select element
|
||||
*
|
||||
* @param string|array $data
|
||||
* @param string $key
|
||||
* @param string|array $data Data array or model name.
|
||||
* @param string $key Field name.
|
||||
* @return array
|
||||
*/
|
||||
protected function _selectedArray($data, $key = 'id') {
|
||||
|
|
|
@ -64,7 +64,7 @@ class CacheHelper extends AppHelper {
|
|||
/**
|
||||
* Parses the view file and stores content for cache file building.
|
||||
*
|
||||
* @param string $viewFile
|
||||
* @param string $viewFile View file name.
|
||||
* @param string $output The output for the file.
|
||||
* @return string Updated content.
|
||||
*/
|
||||
|
@ -77,7 +77,7 @@ class CacheHelper extends AppHelper {
|
|||
/**
|
||||
* Parses the layout file and stores content for cache file building.
|
||||
*
|
||||
* @param string $layoutFile
|
||||
* @param string $layoutFile Layout file name.
|
||||
* @return void
|
||||
*/
|
||||
public function afterLayout($layoutFile) {
|
||||
|
@ -266,7 +266,8 @@ class CacheHelper extends AppHelper {
|
|||
*
|
||||
* @param string $content view content to write to a cache file.
|
||||
* @param string $timestamp Duration to set for cache file.
|
||||
* @param boolean $useCallbacks
|
||||
* @param boolean $useCallbacks Whether to include statements in cached file which
|
||||
* run callbacks.
|
||||
* @return boolean success of caching view.
|
||||
*/
|
||||
protected function _writeFile($content, $timestamp, $useCallbacks = false) {
|
||||
|
|
|
@ -140,7 +140,7 @@ class FormHelper extends AppHelper {
|
|||
* Guess the location for a model based on its name and tries to create a new instance
|
||||
* or get an already created instance of the model
|
||||
*
|
||||
* @param string $model
|
||||
* @param string $model Model name.
|
||||
* @return Model model instance
|
||||
*/
|
||||
protected function _getModel($model) {
|
||||
|
@ -254,7 +254,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Returns if a field is required to be filled based on validation properties from the validating object.
|
||||
*
|
||||
* @param CakeValidationSet $validationRules
|
||||
* @param CakeValidationSet $validationRules Validation rules set.
|
||||
* @return boolean true if field is required to be filled, false otherwise
|
||||
*/
|
||||
protected function _isRequiredField($validationRules) {
|
||||
|
@ -1107,7 +1107,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generates input options array
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array Options
|
||||
*/
|
||||
protected function _parseOptions($options) {
|
||||
|
@ -1138,7 +1138,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generates list of options for multiple select
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _optionsOptions($options) {
|
||||
|
@ -1162,7 +1162,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Magically set option type and corresponding options
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _magicOptions($options) {
|
||||
|
@ -1235,7 +1235,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generate format options
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _getFormat($options) {
|
||||
|
@ -1254,8 +1254,8 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generate label for input
|
||||
*
|
||||
* @param string $fieldName
|
||||
* @param array $options
|
||||
* @param string $fieldName Field name.
|
||||
* @param array $options Options list.
|
||||
* @return boolean|string false or Generated label element
|
||||
*/
|
||||
protected function _getLabel($fieldName, $options) {
|
||||
|
@ -1277,7 +1277,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Calculates maxlength option
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _maxLength($options) {
|
||||
|
@ -1299,7 +1299,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generate div options for input
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _divOptions($options) {
|
||||
|
@ -1351,9 +1351,10 @@ class FormHelper extends AppHelper {
|
|||
* $options can contain a hash of id overrides. These overrides will be
|
||||
* used instead of the generated values if present.
|
||||
*
|
||||
* @param string $fieldName
|
||||
* @param string $label
|
||||
* @param array $options Options for the label element. 'NONE' option is deprecated and will be removed in 3.0
|
||||
* @param string $fieldName Field name.
|
||||
* @param string|array $label Label text or array with text and options.
|
||||
* @param array $options Options for the label element. 'NONE' option is
|
||||
* deprecated and will be removed in 3.0
|
||||
* @return string Generated label element
|
||||
*/
|
||||
protected function _inputLabel($fieldName, $label, $options) {
|
||||
|
@ -2668,9 +2669,9 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Gets the input field name for the current tag
|
||||
*
|
||||
* @param array $options
|
||||
* @param string $field
|
||||
* @param string $key
|
||||
* @param array $options Options list.
|
||||
* @param string $field Field name.
|
||||
* @param string $key Key name.
|
||||
* @return array
|
||||
*/
|
||||
protected function _name($options = array(), $field = null, $key = 'name') {
|
||||
|
@ -2710,10 +2711,10 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Returns an array of formatted OPTION/OPTGROUP elements
|
||||
*
|
||||
* @param array $elements
|
||||
* @param array $parents
|
||||
* @param boolean $showParents
|
||||
* @param array $attributes
|
||||
* @param array $elements Elements to format.
|
||||
* @param array $parents Parents for OPTGROUP.
|
||||
* @param boolean $showParents Whether to show parents.
|
||||
* @param array $attributes HTML attributes.
|
||||
* @return array
|
||||
*/
|
||||
protected function _selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {
|
||||
|
@ -2828,8 +2829,8 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generates option lists for common <select /> menus
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $options
|
||||
* @param string $name List type name.
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _generateOptions($name, $options = array()) {
|
||||
|
@ -3008,7 +3009,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Sets the last created form action.
|
||||
*
|
||||
* @var mixed
|
||||
* @param string|array $url URL.
|
||||
* @return void
|
||||
*/
|
||||
protected function _lastAction($url) {
|
||||
|
@ -3022,7 +3023,7 @@ class FormHelper extends AppHelper {
|
|||
* Set/Get inputDefaults for form elements
|
||||
*
|
||||
* @param array $defaults New default values
|
||||
* @param boolean Merge with current defaults
|
||||
* @param boolean $merge Merge with current defaults
|
||||
* @return array inputDefaults
|
||||
*/
|
||||
public function inputDefaults($defaults = null, $merge = false) {
|
||||
|
|
|
@ -243,7 +243,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* If the 'update' key is set, success callback will be overridden.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param string|array $url URL
|
||||
* @param array $options See JsHelper::request() for options.
|
||||
* @return string The completed ajax call.
|
||||
* @see JsBaseEngineHelper::request() for options list.
|
||||
|
|
|
@ -138,6 +138,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param mixed $val A PHP variable to be converted to JSON
|
||||
* @param boolean $quoteString If false, leaves string values unquoted
|
||||
* @param string $key Key name.
|
||||
* @return string a JavaScript-safe/JSON representation of $val
|
||||
*/
|
||||
public function value($val = array(), $quoteString = null, $key = 'value') {
|
||||
|
|
|
@ -158,6 +158,7 @@ class JsHelper extends AppHelper {
|
|||
*
|
||||
* @param mixed $val A PHP variable to be converted to JSON
|
||||
* @param boolean $quoteString If false, leaves string values unquoted
|
||||
* @param string $key Key name.
|
||||
* @return string a JavaScript-safe/JSON representation of $val
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::value
|
||||
*/
|
||||
|
|
|
@ -230,8 +230,8 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* Requires `Request`. If you wish to use 'update' key you must have ```Request.HTML```
|
||||
* if you wish to do Json requests you will need ```JSON``` and ```Request.JSON```.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param array $options
|
||||
* @param string|array $url URL
|
||||
* @param array $options Options list.
|
||||
* @return string The completed ajax call.
|
||||
*/
|
||||
public function request($url, $options = array()) {
|
||||
|
|
|
@ -67,6 +67,8 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Call methods from CakeNumber utility class
|
||||
*
|
||||
* @param string $method Method to call.
|
||||
* @param array $params Parameters to pass to method.
|
||||
* @return mixed Whatever is returned by called method, or false on failure
|
||||
*/
|
||||
public function __call($method, $params) {
|
||||
|
@ -76,11 +78,10 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Formats a number with a level of precision.
|
||||
*
|
||||
* @see CakeNumber::precision()
|
||||
*
|
||||
* @param float $number A floating point number.
|
||||
* @param integer $precision The precision of the returned number.
|
||||
* @return float Formatted float.
|
||||
* @see CakeNumber::precision()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::precision
|
||||
*/
|
||||
public function precision($number, $precision = 3) {
|
||||
|
@ -90,10 +91,9 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a formatted-for-humans file size.
|
||||
*
|
||||
* @see CakeNumber::toReadableSize()
|
||||
*
|
||||
* @param integer $size Size in bytes
|
||||
* @return string Human readable size
|
||||
* @see CakeNumber::toReadableSize()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toReadableSize
|
||||
*/
|
||||
public function toReadableSize($size) {
|
||||
|
@ -107,12 +107,11 @@ class NumberHelper extends AppHelper {
|
|||
*
|
||||
* - `multiply`: Multiply the input value by 100 for decimal percentages.
|
||||
*
|
||||
* @see CakeNumber::toPercentage()
|
||||
*
|
||||
* @param float $number A floating point number
|
||||
* @param integer $precision The precision of the returned number
|
||||
* @param array $options Options
|
||||
* @return string Percentage string
|
||||
* @see CakeNumber::toPercentage()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toPercentage
|
||||
*/
|
||||
public function toPercentage($number, $precision = 2, $options = array()) {
|
||||
|
@ -122,12 +121,11 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Formats a number into a currency format.
|
||||
*
|
||||
* @see CakeNumber::format()
|
||||
*
|
||||
* @param float $number A floating point number
|
||||
* @param integer $options If integer then places, if string then before, if (,.-) then use it
|
||||
* or array with places and before keys
|
||||
* @return string formatted number
|
||||
* @see CakeNumber::format()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::format
|
||||
*/
|
||||
public function format($number, $options = false) {
|
||||
|
@ -137,14 +135,13 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Formats a number into a currency format.
|
||||
*
|
||||
* @see CakeNumber::currency()
|
||||
*
|
||||
* @param float $number
|
||||
* @param float $number Number to format.
|
||||
* @param string $currency Shortcut to default options. Valid values are 'USD', 'EUR', 'GBP', otherwise
|
||||
* set at least 'before' and 'after' options.
|
||||
* 'USD' is the default currency, use CakeNumber::defaultCurrency() to change this default.
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return string Number formatted as a currency.
|
||||
* @see CakeNumber::currency()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::currency
|
||||
*/
|
||||
public function currency($number, $currency = null, $options = array()) {
|
||||
|
@ -164,11 +161,10 @@ class NumberHelper extends AppHelper {
|
|||
* Added formats are merged with the defaults defined in Cake\Utility\Number::$_currencyDefaults
|
||||
* See Cake\Utility\Number::currency() for more information on the various options and their function.
|
||||
*
|
||||
* @see CakeNumber::addFormat()
|
||||
*
|
||||
* @param string $formatName The format name to be used in the future.
|
||||
* @param array $options The array of options for this format.
|
||||
* @return void
|
||||
* @see CakeNumber::addFormat()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::addFormat
|
||||
*/
|
||||
public function addFormat($formatName, $options) {
|
||||
|
@ -178,10 +174,9 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Getter/setter for default currency
|
||||
*
|
||||
* @see CakeNumber::defaultCurrency()
|
||||
*
|
||||
* @param string $currency The currency to be used in the future.
|
||||
* @return string Currency
|
||||
* @see CakeNumber::defaultCurrency()
|
||||
*/
|
||||
public function defaultCurrency($currency) {
|
||||
return $this->_engine->defaultCurrency($currency);
|
||||
|
|
|
@ -105,7 +105,7 @@ class PaginatorHelper extends AppHelper {
|
|||
/**
|
||||
* Before render callback. Overridden to merge passed args with URL options.
|
||||
*
|
||||
* @param string $viewFile
|
||||
* @param string $viewFile View file name.
|
||||
* @return void
|
||||
*/
|
||||
public function beforeRender($viewFile) {
|
||||
|
@ -454,7 +454,7 @@ class PaginatorHelper extends AppHelper {
|
|||
* Converts the keys being used into the format set by options.paramType
|
||||
*
|
||||
* @param array $url Array of URL params to convert
|
||||
* @param string $type
|
||||
* @param string $type Keys type.
|
||||
* @return array converted URL params.
|
||||
*/
|
||||
protected function _convertUrlKeys($url, $type) {
|
||||
|
@ -476,11 +476,11 @@ class PaginatorHelper extends AppHelper {
|
|||
/**
|
||||
* Protected method for generating prev/next links
|
||||
*
|
||||
* @param string $which
|
||||
* @param string $title
|
||||
* @param array $options
|
||||
* @param string $disabledTitle
|
||||
* @param array $disabledOptions
|
||||
* @param string $which Link type: 'Prev', 'Next'.
|
||||
* @param string $title Link title.
|
||||
* @param array $options Options list.
|
||||
* @param string $disabledTitle Disabled link title.
|
||||
* @param array $disabledOptions Disabled link options.
|
||||
* @return string
|
||||
*/
|
||||
protected function _pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) {
|
||||
|
@ -621,6 +621,7 @@ class PaginatorHelper extends AppHelper {
|
|||
* - `separator` The separator string to use, default to ' of '
|
||||
*
|
||||
* The `%page%` style placeholders also work, but are deprecated and will be removed in a future version.
|
||||
*
|
||||
* @param array $options Options for the counter string. See #options for list of keys.
|
||||
* @return string Counter string.
|
||||
* @deprecated The %page% style placeholders are deprecated.
|
||||
|
|
|
@ -228,8 +228,8 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
/**
|
||||
* Create an Ajax or Ajax.Updater call.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param array $options
|
||||
* @param string|array $url URL.
|
||||
* @param array $options Options list.
|
||||
* @return string The completed ajax call.
|
||||
*/
|
||||
public function request($url, $options = array()) {
|
||||
|
|
|
@ -97,7 +97,7 @@ class RssHelper extends AppHelper {
|
|||
* Returns an RSS document wrapped in `<rss />` tags
|
||||
*
|
||||
* @param array $attrib `<rss />` tag attributes
|
||||
* @param string $content
|
||||
* @param string $content Tag content.
|
||||
* @return string An RSS document
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::document
|
||||
*/
|
||||
|
@ -274,7 +274,7 @@ class RssHelper extends AppHelper {
|
|||
/**
|
||||
* Converts a time in any format to an RSS time
|
||||
*
|
||||
* @param integer|string|DateTime $time
|
||||
* @param integer|string|DateTime $time UNIX timestamp or valid time string or DateTime object.
|
||||
* @return string An RSS-formatted timestamp
|
||||
* @see TimeHelper::toRSS
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::time
|
||||
|
|
|
@ -48,7 +48,7 @@ class SessionHelper extends AppHelper {
|
|||
*
|
||||
* In your view: `$this->Session->check('Controller.sessKey');`
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $name Session key to check.
|
||||
* @return boolean
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/session.html#SessionHelper::check
|
||||
*/
|
||||
|
|
|
@ -81,6 +81,9 @@ class TextHelper extends AppHelper {
|
|||
|
||||
/**
|
||||
* Call methods from String utility class
|
||||
*
|
||||
* @param string $method Method to call.
|
||||
* @param array $params Parameters to pass to method.
|
||||
* @return mixed Whatever is returned by called method, or false on failure
|
||||
*/
|
||||
public function __call($method, $params) {
|
||||
|
@ -218,12 +221,11 @@ class TextHelper extends AppHelper {
|
|||
* Highlights a given phrase in a text. You can specify any expression in highlighter that
|
||||
* may include the \1 expression to include the $phrase found.
|
||||
*
|
||||
* @see String::highlight()
|
||||
*
|
||||
* @param string $text Text to search the phrase in
|
||||
* @param string $phrase The phrase that will be searched
|
||||
* @param array $options An array of html attributes and options.
|
||||
* @return string The highlighted text
|
||||
* @see String::highlight()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::highlight
|
||||
*/
|
||||
public function highlight($text, $phrase, $options = array()) {
|
||||
|
@ -256,10 +258,9 @@ class TextHelper extends AppHelper {
|
|||
/**
|
||||
* Strips given text of all links (<a href=....)
|
||||
*
|
||||
* @see String::stripLinks()
|
||||
*
|
||||
* @param string $text Text
|
||||
* @return string The text without links
|
||||
* @see String::stripLinks()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::stripLinks
|
||||
*/
|
||||
public function stripLinks($text) {
|
||||
|
@ -278,12 +279,11 @@ class TextHelper extends AppHelper {
|
|||
* - `exact` If false, $text will not be cut mid-word
|
||||
* - `html` If true, HTML tags would be handled correctly
|
||||
*
|
||||
* @see String::truncate()
|
||||
*
|
||||
* @param string $text String to truncate.
|
||||
* @param integer $length Length of returned string, including ellipsis.
|
||||
* @param array $options An array of html attributes and options.
|
||||
* @return string Trimmed string.
|
||||
* @see String::truncate()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::truncate
|
||||
*/
|
||||
public function truncate($text, $length = 100, $options = array()) {
|
||||
|
@ -301,12 +301,11 @@ class TextHelper extends AppHelper {
|
|||
* - `ellipsis` Will be used as Beginning and prepended to the trimmed string
|
||||
* - `exact` If false, $text will not be cut mid-word
|
||||
*
|
||||
* @see String::tail()
|
||||
*
|
||||
* @param string $text String to truncate.
|
||||
* @param integer $length Length of returned string, including ellipsis.
|
||||
* @param array $options An array of html attributes and options.
|
||||
* @return string Trimmed string.
|
||||
* @see String::tail()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::tail
|
||||
*/
|
||||
public function tail($text, $length = 100, $options = array()) {
|
||||
|
@ -317,13 +316,12 @@ class TextHelper extends AppHelper {
|
|||
* Extracts an excerpt from the text surrounding the phrase with a number of characters on each side
|
||||
* determined by radius.
|
||||
*
|
||||
* @see String::excerpt()
|
||||
*
|
||||
* @param string $text String to search the phrase in
|
||||
* @param string $phrase Phrase that will be searched for
|
||||
* @param integer $radius The amount of characters that will be returned on each side of the founded phrase
|
||||
* @param string $ending Ending that will be appended
|
||||
* @return string Modified string
|
||||
* @see String::excerpt()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::excerpt
|
||||
*/
|
||||
public function excerpt($text, $phrase, $radius = 100, $ending = '...') {
|
||||
|
@ -333,12 +331,11 @@ class TextHelper extends AppHelper {
|
|||
/**
|
||||
* Creates a comma separated list where the last two items are joined with 'and', forming natural English
|
||||
*
|
||||
* @see String::toList()
|
||||
*
|
||||
* @param array $list The list to be joined
|
||||
* @param string $and The word used to join the last and second last items together with. Defaults to 'and'
|
||||
* @param string $separator The separator used to join all the other items together. Defaults to ', '
|
||||
* @return string The glued together string.
|
||||
* @see String::toList()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::toList
|
||||
*/
|
||||
public function toList($list, $and = 'and', $separator = ', ') {
|
||||
|
|
|
@ -115,6 +115,9 @@ class TimeHelper extends AppHelper {
|
|||
|
||||
/**
|
||||
* Call methods from CakeTime utility class
|
||||
*
|
||||
* @param string $method Method to call.
|
||||
* @param array $params Parameters to pass to method.
|
||||
* @return mixed Whatever is returned by called method, or false on failure
|
||||
*/
|
||||
public function __call($method, $params) {
|
||||
|
@ -125,12 +128,11 @@ class TimeHelper extends AppHelper {
|
|||
* Converts a string representing the format for the function strftime and returns a
|
||||
* windows safe and i18n aware format.
|
||||
*
|
||||
* @see CakeTime::convertSpecifiers()
|
||||
*
|
||||
* @param string $format Format with specifiers for strftime function.
|
||||
* Accepts the special specifier %S which mimics the modifier S for date()
|
||||
* @param string $time UNIX timestamp
|
||||
* @return string windows safe and date() function compatible format for strftime
|
||||
* @see CakeTime::convertSpecifiers()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function convertSpecifiers($format, $time = null) {
|
||||
|
@ -140,11 +142,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Converts given time (in server's time zone) to user's local time, given his/her timezone.
|
||||
*
|
||||
* @see CakeTime::convert()
|
||||
*
|
||||
* @param string $serverTime UNIX timestamp
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return integer UNIX timestamp
|
||||
* @see CakeTime::convert()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function convert($serverTime, $timezone) {
|
||||
|
@ -154,9 +155,8 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns server's offset
|
||||
*
|
||||
* @see CakeTime::serverOffset()
|
||||
*
|
||||
* @return integer Offset
|
||||
* @see CakeTime::serverOffset()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function serverOffset() {
|
||||
|
@ -166,11 +166,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a UNIX timestamp, given either a UNIX timestamp or a valid strtotime() date string.
|
||||
*
|
||||
* @see CakeTime::fromString()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Parsed timestamp
|
||||
* @see CakeTime::fromString()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function fromString($dateString, $timezone = null) {
|
||||
|
@ -180,12 +179,11 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a nicely formatted date string for given Datetime string.
|
||||
*
|
||||
* @see CakeTime::nice()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @param string $format The format to use. If null, `CakeTime::$niceFormat` is used
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::nice()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function nice($dateString = null, $timezone = null, $format = null) {
|
||||
|
@ -195,11 +193,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a formatted descriptive date string for given datetime string.
|
||||
*
|
||||
* @see CakeTime::niceShort()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime objectp
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Described, relative date string
|
||||
* @see CakeTime::niceShort()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function niceShort($dateString = null, $timezone = null) {
|
||||
|
@ -209,13 +206,12 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a partial SQL string to search for all records between two dates.
|
||||
*
|
||||
* @see CakeTime::daysAsSql()
|
||||
*
|
||||
* @param integer|string|DateTime $begin UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param integer|string|DateTime $end UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string $fieldName Name of database field to compare with
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Partial SQL string.
|
||||
* @see CakeTime::daysAsSql()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function daysAsSql($begin, $end, $fieldName, $timezone = null) {
|
||||
|
@ -226,12 +222,11 @@ class TimeHelper extends AppHelper {
|
|||
* Returns a partial SQL string to search for all records between two times
|
||||
* occurring on the same day.
|
||||
*
|
||||
* @see CakeTime::dayAsSql()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string $fieldName Name of database field to compare with
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Partial SQL string.
|
||||
* @see CakeTime::dayAsSql()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function dayAsSql($dateString, $fieldName, $timezone = null) {
|
||||
|
@ -241,11 +236,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is today.
|
||||
*
|
||||
* @see CakeTime::isToday()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is today
|
||||
* @see CakeTime::isToday()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isToday($dateString, $timezone = null) {
|
||||
|
@ -255,11 +249,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is within this week.
|
||||
*
|
||||
* @see CakeTime::isThisWeek()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is within current week
|
||||
* @see CakeTime::isThisWeek()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isThisWeek($dateString, $timezone = null) {
|
||||
|
@ -269,11 +262,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is within this month
|
||||
*
|
||||
* @see CakeTime::isThisMonth()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is within current month
|
||||
* @see CakeTime::isThisMonth()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isThisMonth($dateString, $timezone = null) {
|
||||
|
@ -283,11 +275,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is within current year.
|
||||
*
|
||||
* @see CakeTime::isThisYear()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is within current year
|
||||
* @see CakeTime::isThisYear()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isThisYear($dateString, $timezone = null) {
|
||||
|
@ -297,13 +288,11 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string was yesterday.
|
||||
*
|
||||
* @see CakeTime::wasYesterday()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string was yesterday
|
||||
* @see CakeTime::wasYesterday()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*
|
||||
*/
|
||||
public function wasYesterday($dateString, $timezone = null) {
|
||||
return $this->_engine->wasYesterday($dateString, $timezone);
|
||||
|
@ -312,11 +301,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is tomorrow.
|
||||
*
|
||||
* @see CakeTime::isTomorrow()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string was yesterday
|
||||
* @see CakeTime::isTomorrow()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isTomorrow($dateString, $timezone = null) {
|
||||
|
@ -326,11 +314,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns the quarter
|
||||
*
|
||||
* @see CakeTime::toQuarter()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param boolean $range if true returns a range in Y-m-d format
|
||||
* @return mixed 1, 2, 3, or 4 quarter of year or array if $range true
|
||||
* @see CakeTime::toQuarter()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toQuarter($dateString, $range = false) {
|
||||
|
@ -340,11 +327,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a UNIX timestamp from a textual datetime description. Wrapper for PHP function strtotime().
|
||||
*
|
||||
* @see CakeTime::toUnix()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return integer Unix timestamp
|
||||
* @see CakeTime::toUnix()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toUnix($dateString, $timezone = null) {
|
||||
|
@ -354,11 +340,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a date formatted for Atom RSS feeds.
|
||||
*
|
||||
* @see CakeTime::toAtom()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::toAtom()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toAtom($dateString, $timezone = null) {
|
||||
|
@ -368,11 +353,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Formats date for RSS feeds
|
||||
*
|
||||
* @see CakeTime::toRSS()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::toRSS()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toRSS($dateString, $timezone = null) {
|
||||
|
@ -382,8 +366,6 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Formats date for RSS feeds
|
||||
*
|
||||
* @see CakeTime::timeAgoInWords()
|
||||
*
|
||||
* ## Addition options
|
||||
*
|
||||
* - `element` - The element to wrap the formatted time in.
|
||||
|
@ -395,6 +377,7 @@ class TimeHelper extends AppHelper {
|
|||
* @param integer|string|DateTime $dateTime UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param array $options Default format if timestamp is used in $dateString
|
||||
* @return string Relative time string.
|
||||
* @see CakeTime::timeAgoInWords()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function timeAgoInWords($dateTime, $options = array()) {
|
||||
|
@ -431,13 +414,12 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if specified datetime was within the interval specified, else false.
|
||||
*
|
||||
* @see CakeTime::wasWithinLast()
|
||||
*
|
||||
* @param string|integer $timeInterval the numeric value with space then time type.
|
||||
* Example of valid types: 6 hours, 2 days, 1 minute.
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean
|
||||
* @see CakeTime::wasWithinLast()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function wasWithinLast($timeInterval, $dateString, $timezone = null) {
|
||||
|
@ -447,13 +429,12 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if specified datetime is within the interval specified, else false.
|
||||
*
|
||||
* @see CakeTime::isWithinLast()
|
||||
*
|
||||
* @param string|integer $timeInterval the numeric value with space then time type.
|
||||
* Example of valid types: 6 hours, 2 days, 1 minute.
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean
|
||||
* @see CakeTime::isWithinLast()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isWithinNext($timeInterval, $dateString, $timezone = null) {
|
||||
|
@ -463,10 +444,9 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns gmt as a UNIX timestamp.
|
||||
*
|
||||
* @see CakeTime::gmt()
|
||||
*
|
||||
* @param integer|string|DateTime $string UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @return integer UNIX timestamp
|
||||
* @see CakeTime::gmt()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function gmt($string = null) {
|
||||
|
@ -489,13 +469,12 @@ class TimeHelper extends AppHelper {
|
|||
* $this->Time->format('2012-02-15 23:01:01', '%c', 'N/A', 'America/New_York'); // converts passed date to timezone
|
||||
* }}}
|
||||
*
|
||||
* @see CakeTime::format()
|
||||
*
|
||||
* @param integer|string|DateTime $format date format string (or a UNIX timestamp, strtotime() valid string or DateTime object)
|
||||
* @param integer|string|DateTime $date UNIX timestamp, strtotime() valid string or DateTime object (or a date format string)
|
||||
* @param boolean $invalid flag to ignore results of fromString == false
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::format()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function format($format, $date = null, $invalid = false, $timezone = null) {
|
||||
|
@ -506,13 +485,12 @@ class TimeHelper extends AppHelper {
|
|||
* Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string.
|
||||
* It takes into account the default date format for the current language if a LC_TIME file is used.
|
||||
*
|
||||
* @see CakeTime::i18nFormat()
|
||||
*
|
||||
* @param integer|string|DateTime $date UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string $format strftime format string.
|
||||
* @param boolean $invalid flag to ignore results of fromString == false
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted and translated date string
|
||||
* @see CakeTime::i18nFormat()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function i18nFormat($date, $format = null, $invalid = false, $timezone = null) {
|
||||
|
|
|
@ -38,7 +38,7 @@ class HelperCollection extends ObjectCollection implements CakeEventListener {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param View $view
|
||||
* @param View $view View instance.
|
||||
*/
|
||||
public function __construct(View $view) {
|
||||
$this->_View = $view;
|
||||
|
@ -184,8 +184,7 @@ class HelperCollection extends ObjectCollection implements CakeEventListener {
|
|||
* Any non-null value will modify the parameter index indicated.
|
||||
* Defaults to false.
|
||||
*
|
||||
*
|
||||
* @param string $callback|CakeEvent Method to fire on all the objects. Its assumed all the objects implement
|
||||
* @param string|CakeEvent $callback Method to fire on all the objects. Its assumed all the objects implement
|
||||
* the method you are calling. If an instance of CakeEvent is provided, then then Event name will parsed to
|
||||
* get the callback name. This is done by getting the last word after any dot in the event name
|
||||
* (eg. `Model.afterSave` event will trigger the `afterSave` callback)
|
||||
|
|
|
@ -63,7 +63,7 @@ class JsonView extends View {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Controller $controller
|
||||
* @param Controller $controller Controller instance.
|
||||
*/
|
||||
public function __construct(Controller $controller = null) {
|
||||
parent::__construct($controller);
|
||||
|
|
|
@ -935,7 +935,7 @@ class View extends Object {
|
|||
/**
|
||||
* Sandbox method to evaluate a template / view script in.
|
||||
*
|
||||
* @param string $viewFn Filename of the view
|
||||
* @param string $viewFile Filename of the view
|
||||
* @param array $dataForView Data to include in rendered view.
|
||||
* If empty the current View::$viewVars will be used.
|
||||
* @return string Rendered output
|
||||
|
|
|
@ -63,7 +63,7 @@ class XmlView extends View {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Controller $controller
|
||||
* @param Controller $controller Controller instance.
|
||||
*/
|
||||
public function __construct(Controller $controller = null) {
|
||||
parent::__construct($controller);
|
||||
|
|
|
@ -125,7 +125,7 @@ if (!function_exists('sortByKey')) {
|
|||
/**
|
||||
* Sorts given $array by key $sortBy.
|
||||
*
|
||||
* @param array $array Array to sort
|
||||
* @param array &$array Array to sort
|
||||
* @param string $sortBy Sort by this key
|
||||
* @param string $order Sort order asc/desc (ascending or descending).
|
||||
* @param integer $type Type of sorting to perform
|
||||
|
@ -235,10 +235,10 @@ if (!function_exists('pr')) {
|
|||
* In terminals this will act the same as using print_r() directly, when not run on cli
|
||||
* print_r() will wrap <PRE> tags around the output of given array. Similar to debug().
|
||||
*
|
||||
* @see debug()
|
||||
* @param mixed $var Variable to print out
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr
|
||||
* @see debug()
|
||||
*/
|
||||
function pr($var) {
|
||||
if (Configure::read('debug') > 0) {
|
||||
|
@ -254,10 +254,8 @@ if (!function_exists('am')) {
|
|||
/**
|
||||
* Merge a group of arrays
|
||||
*
|
||||
* @param array First array
|
||||
* @param array Second array
|
||||
* @param array Third array
|
||||
* @param array Etc...
|
||||
* Accepts variable arguments. Each argument will be converted into an array and then merged.
|
||||
*
|
||||
* @return array All array parameters merged into one
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#am
|
||||
*/
|
||||
|
@ -840,7 +838,7 @@ if (!function_exists('convertSlash')) {
|
|||
/**
|
||||
* Convert forward slashes to underscores and removes first and last underscores in a string
|
||||
*
|
||||
* @param string String to convert
|
||||
* @param string $string String to convert
|
||||
* @return string with underscore remove from start and end of string
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#convertSlash
|
||||
*/
|
||||
|
|
|
@ -424,7 +424,7 @@ if (!function_exists('mb_encode_mimeheader')) {
|
|||
* @param string $str The string being encoded
|
||||
* @param string $charset specifies the name of the character set in which str is represented in.
|
||||
* The default value is determined by the current NLS setting (mbstring.language).
|
||||
* @param string $transfer_encoding specifies the scheme of MIME encoding.
|
||||
* @param string $transferEncoding specifies the scheme of MIME encoding.
|
||||
* It should be either "B" (Base64) or "Q" (Quoted-Printable). Falls back to "B" if not given.
|
||||
* @param string $linefeed specifies the EOL (end-of-line) marker with which
|
||||
* mb_encode_mimeheader() performs line-folding
|
||||
|
|
Loading…
Reference in a new issue