mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Correct doc blocks according to cs guidelines.
Remove superfluous empty lines.
This commit is contained in:
parent
65d14c7e97
commit
974ca851c2
271 changed files with 1383 additions and 1528 deletions
|
@ -19,7 +19,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Using the Schema command line utility
|
* Using the Schema command line utility
|
||||||
* cake schema run create DbAcl
|
* cake schema run create DbAcl
|
||||||
*
|
*
|
||||||
|
@ -30,7 +29,7 @@ class DbAclSchema extends CakeSchema {
|
||||||
* Before event.
|
* Before event.
|
||||||
*
|
*
|
||||||
* @param array $event The event data.
|
* @param array $event The event data.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function before($event = array()) {
|
public function before($event = array()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Using the Schema command line utility
|
* Using the Schema command line utility
|
||||||
*
|
*
|
||||||
* Use it to configure database for i18n
|
* Use it to configure database for i18n
|
||||||
|
|
|
@ -278,7 +278,6 @@
|
||||||
//Configure::write('Config.timezone', 'Europe/Paris');
|
//Configure::write('Config.timezone', 'Europe/Paris');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Cache Engine Configuration
|
* Cache Engine Configuration
|
||||||
* Default settings provided below
|
* Default settings provided below
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Pages
|
* @package app.View.Pages
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -160,7 +160,7 @@ class Cache {
|
||||||
* Finds and builds the instance of the required engine class.
|
* Finds and builds the instance of the required engine class.
|
||||||
*
|
*
|
||||||
* @param string $name Name of the config array that needs an engine instance built
|
* @param string $name Name of the config array that needs an engine instance built
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @throws CacheException
|
* @throws CacheException
|
||||||
*/
|
*/
|
||||||
protected static function _buildEngine($name) {
|
protected static function _buildEngine($name) {
|
||||||
|
@ -201,7 +201,7 @@ class Cache {
|
||||||
* the Engine instance is also unset.
|
* the Engine instance is also unset.
|
||||||
*
|
*
|
||||||
* @param string $name A currently configured cache config you wish to remove.
|
* @param string $name A currently configured cache config you wish to remove.
|
||||||
* @return boolean success of the removal, returns false when the config does not exist.
|
* @return bool success of the removal, returns false when the config does not exist.
|
||||||
*/
|
*/
|
||||||
public static function drop($name) {
|
public static function drop($name) {
|
||||||
if (!isset(self::$_config[$name])) {
|
if (!isset(self::$_config[$name])) {
|
||||||
|
@ -269,7 +269,7 @@ class Cache {
|
||||||
* Permanently remove all expired and deleted data
|
* Permanently remove all expired and deleted data
|
||||||
*
|
*
|
||||||
* @param string $config [optional] The config name you wish to have garbage collected. Defaults to 'default'
|
* @param string $config [optional] The config name you wish to have garbage collected. Defaults to 'default'
|
||||||
* @param integer $expires [optional] An expires timestamp. Defaults to NULL
|
* @param int $expires [optional] An expires timestamp. Defaults to NULL
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function gc($config = 'default', $expires = null) {
|
public static function gc($config = 'default', $expires = null) {
|
||||||
|
@ -292,7 +292,7 @@ class Cache {
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached - anything except a resource
|
* @param mixed $value Data to be cached - anything except a resource
|
||||||
* @param string $config Optional string configuration name to write to. Defaults to 'default'
|
* @param string $config Optional string configuration name to write to. Defaults to 'default'
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
public static function write($key, $value, $config = 'default') {
|
public static function write($key, $value, $config = 'default') {
|
||||||
$settings = self::settings($config);
|
$settings = self::settings($config);
|
||||||
|
@ -362,7 +362,7 @@ class Cache {
|
||||||
* Increment a number under the key and return incremented value.
|
* Increment a number under the key and return incremented value.
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to add
|
* @param int $offset How much to add
|
||||||
* @param string $config Optional string configuration name. Defaults to 'default'
|
* @param string $config Optional string configuration name. Defaults to 'default'
|
||||||
* @return mixed new value, or false if the data doesn't exist, is not integer,
|
* @return mixed new value, or false if the data doesn't exist, is not integer,
|
||||||
* or if there was an error fetching it.
|
* or if there was an error fetching it.
|
||||||
|
@ -390,7 +390,7 @@ class Cache {
|
||||||
* Decrement a number under the key and return decremented value.
|
* Decrement a number under the key and return decremented value.
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @param string $config Optional string configuration name. Defaults to 'default'
|
* @param string $config Optional string configuration name. Defaults to 'default'
|
||||||
* @return mixed new value, or false if the data doesn't exist, is not integer,
|
* @return mixed new value, or false if the data doesn't exist, is not integer,
|
||||||
* or if there was an error fetching it
|
* or if there was an error fetching it
|
||||||
|
@ -429,7 +429,7 @@ class Cache {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param string $config name of the configuration to use. Defaults to 'default'
|
* @param string $config name of the configuration to use. Defaults to 'default'
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public static function delete($key, $config = 'default') {
|
public static function delete($key, $config = 'default') {
|
||||||
$settings = self::settings($config);
|
$settings = self::settings($config);
|
||||||
|
@ -453,9 +453,9 @@ class Cache {
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache.
|
* Delete all keys from the cache.
|
||||||
*
|
*
|
||||||
* @param boolean $check if true will check expiration, otherwise delete all
|
* @param bool $check if true will check expiration, otherwise delete all
|
||||||
* @param string $config name of the configuration to use. Defaults to 'default'
|
* @param string $config name of the configuration to use. Defaults to 'default'
|
||||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
* @return bool True if the cache was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function clear($check = false, $config = 'default') {
|
public static function clear($check = false, $config = 'default') {
|
||||||
if (!self::isInitialized($config)) {
|
if (!self::isInitialized($config)) {
|
||||||
|
@ -471,7 +471,7 @@ class Cache {
|
||||||
*
|
*
|
||||||
* @param string $group name of the group to be cleared
|
* @param string $group name of the group to be cleared
|
||||||
* @param string $config name of the configuration to use. Defaults to 'default'
|
* @param string $config name of the configuration to use. Defaults to 'default'
|
||||||
* @return boolean True if the cache group was successfully cleared, false otherwise
|
* @return bool True if the cache group was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function clearGroup($group, $config = 'default') {
|
public static function clearGroup($group, $config = 'default') {
|
||||||
if (!self::isInitialized($config)) {
|
if (!self::isInitialized($config)) {
|
||||||
|
@ -486,7 +486,7 @@ class Cache {
|
||||||
* Check if Cache has initialized a working config for the given name.
|
* Check if Cache has initialized a working config for the given name.
|
||||||
*
|
*
|
||||||
* @param string $config name of the configuration to use. Defaults to 'default'
|
* @param string $config name of the configuration to use. Defaults to 'default'
|
||||||
* @return boolean Whether or not the config name has been initialized.
|
* @return bool Whether or not the config name has been initialized.
|
||||||
*/
|
*/
|
||||||
public static function isInitialized($config = 'default') {
|
public static function isInitialized($config = 'default') {
|
||||||
if (Configure::read('Cache.disable')) {
|
if (Configure::read('Cache.disable')) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ abstract class CacheEngine {
|
||||||
* Called automatically by the cache frontend
|
* Called automatically by the cache frontend
|
||||||
*
|
*
|
||||||
* @param array $settings Associative array of parameters for the engine
|
* @param array $settings Associative array of parameters for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
$settings += $this->settings + array(
|
$settings += $this->settings + array(
|
||||||
|
@ -67,7 +67,7 @@ abstract class CacheEngine {
|
||||||
*
|
*
|
||||||
* Permanently remove all expired and deleted data
|
* Permanently remove all expired and deleted data
|
||||||
*
|
*
|
||||||
* @param integer $expires [optional] An expires timestamp, invalidating all data before.
|
* @param int $expires [optional] An expires timestamp, invalidating all data before.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function gc($expires = null) {
|
public function gc($expires = null) {
|
||||||
|
@ -78,8 +78,8 @@ abstract class CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached
|
* @param mixed $value Data to be cached
|
||||||
* @param integer $duration How long to cache for.
|
* @param int $duration How long to cache for.
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
abstract public function write($key, $value, $duration);
|
abstract public function write($key, $value, $duration);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ abstract class CacheEngine {
|
||||||
* Increment a number under the key and return incremented value
|
* Increment a number under the key and return incremented value
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to add
|
* @param int $offset How much to add
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
abstract public function increment($key, $offset = 1);
|
abstract public function increment($key, $offset = 1);
|
||||||
|
@ -104,7 +104,7 @@ abstract class CacheEngine {
|
||||||
* Decrement a number under the key and return decremented value
|
* Decrement a number under the key and return decremented value
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
abstract public function decrement($key, $offset = 1);
|
abstract public function decrement($key, $offset = 1);
|
||||||
|
@ -113,15 +113,15 @@ abstract class CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
abstract public function delete($key);
|
abstract public function delete($key);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache
|
* Delete all keys from the cache
|
||||||
*
|
*
|
||||||
* @param boolean $check if true will check expiration, otherwise delete all
|
* @param bool $check if true will check expiration, otherwise delete all
|
||||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
* @return bool True if the cache was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
abstract public function clear($check);
|
abstract public function clear($check);
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ abstract class CacheEngine {
|
||||||
* the same result.
|
* the same result.
|
||||||
*
|
*
|
||||||
* @param string $group name of the group to be cleared
|
* @param string $group name of the group to be cleared
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -38,7 +38,7 @@ class ApcEngine extends CacheEngine {
|
||||||
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
||||||
*
|
*
|
||||||
* @param array $settings array of setting for the engine
|
* @param array $settings array of setting for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
* @see CacheEngine::__defaults
|
* @see CacheEngine::__defaults
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
|
@ -55,8 +55,8 @@ class ApcEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached
|
* @param mixed $value Data to be cached
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param int $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
public function write($key, $value, $duration) {
|
public function write($key, $value, $duration) {
|
||||||
$expires = 0;
|
$expires = 0;
|
||||||
|
@ -86,7 +86,7 @@ class ApcEngine extends CacheEngine {
|
||||||
* Increments the value of an integer cached key
|
* Increments the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to increment
|
* @param int $offset How much to increment
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
public function increment($key, $offset = 1) {
|
public function increment($key, $offset = 1) {
|
||||||
|
@ -97,7 +97,7 @@ class ApcEngine extends CacheEngine {
|
||||||
* Decrements the value of an integer cached key
|
* Decrements the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @return New decremented value, false otherwise
|
* @return New decremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
public function decrement($key, $offset = 1) {
|
public function decrement($key, $offset = 1) {
|
||||||
|
@ -108,7 +108,7 @@ class ApcEngine extends CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
return apc_delete($key);
|
return apc_delete($key);
|
||||||
|
@ -117,9 +117,9 @@ class ApcEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache. This will clear every cache config using APC.
|
* Delete all keys from the cache. This will clear every cache config using APC.
|
||||||
*
|
*
|
||||||
* @param boolean $check If true, nothing will be cleared, as entries are removed
|
* @param bool $check If true, nothing will be cleared, as entries are removed
|
||||||
* from APC as they expired. This flag is really only used by FileEngine.
|
* from APC as they expired. This flag is really only used by FileEngine.
|
||||||
* @return boolean True Returns true.
|
* @return bool True Returns true.
|
||||||
*/
|
*/
|
||||||
public function clear($check) {
|
public function clear($check) {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
|
@ -181,7 +181,7 @@ class ApcEngine extends CacheEngine {
|
||||||
* old values will remain in storage until they expire.
|
* old values will remain in storage until they expire.
|
||||||
*
|
*
|
||||||
* @param string $group The group to clear.
|
* @param string $group The group to clear.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
apc_inc($this->settings['prefix'] . $group, 1, $success);
|
apc_inc($this->settings['prefix'] . $group, 1, $success);
|
||||||
|
|
|
@ -53,7 +53,7 @@ class FileEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* True unless FileEngine::__active(); fails
|
* True unless FileEngine::__active(); fails
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_init = true;
|
protected $_init = true;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class FileEngine extends CacheEngine {
|
||||||
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
||||||
*
|
*
|
||||||
* @param array $settings array of setting for the engine
|
* @param array $settings array of setting for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
$settings += array(
|
$settings += array(
|
||||||
|
@ -93,8 +93,8 @@ class FileEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Garbage collection. Permanently remove all expired and deleted data
|
* Garbage collection. Permanently remove all expired and deleted data
|
||||||
*
|
*
|
||||||
* @param integer $expires [optional] An expires timestamp, invalidating all data before.
|
* @param int $expires [optional] An expires timestamp, invalidating all data before.
|
||||||
* @return boolean True if garbage collection was successful, false on failure
|
* @return bool True if garbage collection was successful, false on failure
|
||||||
*/
|
*/
|
||||||
public function gc($expires = null) {
|
public function gc($expires = null) {
|
||||||
return $this->clear(true);
|
return $this->clear(true);
|
||||||
|
@ -105,8 +105,8 @@ class FileEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $data Data to be cached
|
* @param mixed $data Data to be cached
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param int $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
public function write($key, $data, $duration) {
|
public function write($key, $data, $duration) {
|
||||||
if ($data === '' || !$this->_init) {
|
if ($data === '' || !$this->_init) {
|
||||||
|
@ -200,7 +200,7 @@ class FileEngine extends CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
if ($this->_setKey($key) === false || !$this->_init) {
|
if ($this->_setKey($key) === false || !$this->_init) {
|
||||||
|
@ -217,8 +217,8 @@ class FileEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Delete all values from the cache
|
* Delete all values from the cache
|
||||||
*
|
*
|
||||||
* @param boolean $check Optional - only delete expired cache items
|
* @param bool $check Optional - only delete expired cache items
|
||||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
* @return bool True if the cache was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
public function clear($check) {
|
public function clear($check) {
|
||||||
if (!$this->_init) {
|
if (!$this->_init) {
|
||||||
|
@ -255,8 +255,8 @@ class FileEngine extends CacheEngine {
|
||||||
* Used to clear a directory of matching files.
|
* Used to clear a directory of matching files.
|
||||||
*
|
*
|
||||||
* @param string $path The path to search.
|
* @param string $path The path to search.
|
||||||
* @param integer $now The current timestamp
|
* @param int $now The current timestamp
|
||||||
* @param integer $threshold Any file not modified after this value will be deleted.
|
* @param int $threshold Any file not modified after this value will be deleted.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _clearDirectory($path, $now, $threshold) {
|
protected function _clearDirectory($path, $now, $threshold) {
|
||||||
|
@ -304,7 +304,7 @@ class FileEngine extends CacheEngine {
|
||||||
* Not implemented
|
* Not implemented
|
||||||
*
|
*
|
||||||
* @param string $key The key to decrement
|
* @param string $key The key to decrement
|
||||||
* @param integer $offset The number to offset
|
* @param int $offset The number to offset
|
||||||
* @return void
|
* @return void
|
||||||
* @throws CacheException
|
* @throws CacheException
|
||||||
*/
|
*/
|
||||||
|
@ -316,7 +316,7 @@ class FileEngine extends CacheEngine {
|
||||||
* Not implemented
|
* Not implemented
|
||||||
*
|
*
|
||||||
* @param string $key The key to decrement
|
* @param string $key The key to decrement
|
||||||
* @param integer $offset The number to offset
|
* @param int $offset The number to offset
|
||||||
* @return void
|
* @return void
|
||||||
* @throws CacheException
|
* @throws CacheException
|
||||||
*/
|
*/
|
||||||
|
@ -329,8 +329,8 @@ class FileEngine extends CacheEngine {
|
||||||
* for the cache file the key is referring to.
|
* for the cache file the key is referring to.
|
||||||
*
|
*
|
||||||
* @param string $key The key
|
* @param string $key The key
|
||||||
* @param boolean $createKey Whether the key should be created if it doesn't exists, or not
|
* @param bool $createKey Whether the key should be created if it doesn't exists, or not
|
||||||
* @return boolean true if the cache key could be set, false otherwise
|
* @return bool true if the cache key could be set, false otherwise
|
||||||
*/
|
*/
|
||||||
protected function _setKey($key, $createKey = false) {
|
protected function _setKey($key, $createKey = false) {
|
||||||
$groups = null;
|
$groups = null;
|
||||||
|
@ -369,7 +369,7 @@ class FileEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Determine is cache directory is writable
|
* Determine is cache directory is writable
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function _active() {
|
protected function _active() {
|
||||||
$dir = new SplFileInfo($this->settings['path']);
|
$dir = new SplFileInfo($this->settings['path']);
|
||||||
|
@ -406,7 +406,7 @@ class FileEngine extends CacheEngine {
|
||||||
* Recursively deletes all files under any directory named as $group
|
* Recursively deletes all files under any directory named as $group
|
||||||
*
|
*
|
||||||
* @param string $group The group to clear.
|
* @param string $group The group to clear.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
$this->_File = null;
|
$this->_File = null;
|
||||||
|
|
|
@ -59,7 +59,7 @@ class MemcacheEngine extends CacheEngine {
|
||||||
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
||||||
*
|
*
|
||||||
* @param array $settings array of setting for the engine
|
* @param array $settings array of setting for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
if (!class_exists('Memcache')) {
|
if (!class_exists('Memcache')) {
|
||||||
|
@ -131,8 +131,8 @@ class MemcacheEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached
|
* @param mixed $value Data to be cached
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param int $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
* @see http://php.net/manual/en/memcache.set.php
|
* @see http://php.net/manual/en/memcache.set.php
|
||||||
*/
|
*/
|
||||||
public function write($key, $value, $duration) {
|
public function write($key, $value, $duration) {
|
||||||
|
@ -156,7 +156,7 @@ class MemcacheEngine extends CacheEngine {
|
||||||
* Increments the value of an integer cached key
|
* Increments the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to increment
|
* @param int $offset How much to increment
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
* @throws CacheException when you try to increment with compress = true
|
* @throws CacheException when you try to increment with compress = true
|
||||||
*/
|
*/
|
||||||
|
@ -173,7 +173,7 @@ class MemcacheEngine extends CacheEngine {
|
||||||
* Decrements the value of an integer cached key
|
* Decrements the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @return New decremented value, false otherwise
|
* @return New decremented value, false otherwise
|
||||||
* @throws CacheException when you try to decrement with compress = true
|
* @throws CacheException when you try to decrement with compress = true
|
||||||
*/
|
*/
|
||||||
|
@ -190,7 +190,7 @@ class MemcacheEngine extends CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
return $this->_Memcache->delete($key);
|
return $this->_Memcache->delete($key);
|
||||||
|
@ -199,9 +199,9 @@ class MemcacheEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache
|
* Delete all keys from the cache
|
||||||
*
|
*
|
||||||
* @param boolean $check If true no deletes will occur and instead CakePHP will rely
|
* @param bool $check If true no deletes will occur and instead CakePHP will rely
|
||||||
* on key TTL values.
|
* on key TTL values.
|
||||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
* @return bool True if the cache was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
public function clear($check) {
|
public function clear($check) {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
|
@ -232,8 +232,8 @@ class MemcacheEngine extends CacheEngine {
|
||||||
* Connects to a server in connection pool
|
* Connects to a server in connection pool
|
||||||
*
|
*
|
||||||
* @param string $host host ip address or name
|
* @param string $host host ip address or name
|
||||||
* @param integer $port Server port
|
* @param int $port Server port
|
||||||
* @return boolean True if memcache server was connected
|
* @return bool True if memcache server was connected
|
||||||
*/
|
*/
|
||||||
public function connect($host, $port = 11211) {
|
public function connect($host, $port = 11211) {
|
||||||
if ($this->_Memcache->getServerStatus($host, $port) === 0) {
|
if ($this->_Memcache->getServerStatus($host, $port) === 0) {
|
||||||
|
@ -284,7 +284,7 @@ class MemcacheEngine extends CacheEngine {
|
||||||
* old values will remain in storage until they expire.
|
* old values will remain in storage until they expire.
|
||||||
*
|
*
|
||||||
* @param string $group The group to clear.
|
* @param string $group The group to clear.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
return (bool)$this->_Memcache->increment($this->settings['prefix'] . $group);
|
return (bool)$this->_Memcache->increment($this->settings['prefix'] . $group);
|
||||||
|
|
|
@ -70,7 +70,7 @@ class MemcachedEngine extends CacheEngine {
|
||||||
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
||||||
*
|
*
|
||||||
* @param array $settings array of setting for the engine
|
* @param array $settings array of setting for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
* @throws CacheException when you try use authentication without Memcached compiled with SASL support
|
* @throws CacheException when you try use authentication without Memcached compiled with SASL support
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
|
@ -199,8 +199,8 @@ class MemcachedEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached
|
* @param mixed $value Data to be cached
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param int $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
* @see http://php.net/manual/en/memcache.set.php
|
* @see http://php.net/manual/en/memcache.set.php
|
||||||
*/
|
*/
|
||||||
public function write($key, $value, $duration) {
|
public function write($key, $value, $duration) {
|
||||||
|
@ -225,7 +225,7 @@ class MemcachedEngine extends CacheEngine {
|
||||||
* Increments the value of an integer cached key
|
* Increments the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to increment
|
* @param int $offset How much to increment
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
* @throws CacheException when you try to increment with compress = true
|
* @throws CacheException when you try to increment with compress = true
|
||||||
*/
|
*/
|
||||||
|
@ -237,7 +237,7 @@ class MemcachedEngine extends CacheEngine {
|
||||||
* Decrements the value of an integer cached key
|
* Decrements the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @return New decremented value, false otherwise
|
* @return New decremented value, false otherwise
|
||||||
* @throws CacheException when you try to decrement with compress = true
|
* @throws CacheException when you try to decrement with compress = true
|
||||||
*/
|
*/
|
||||||
|
@ -249,7 +249,7 @@ class MemcachedEngine extends CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
return $this->_Memcached->delete($key);
|
return $this->_Memcached->delete($key);
|
||||||
|
@ -258,9 +258,9 @@ class MemcachedEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache
|
* Delete all keys from the cache
|
||||||
*
|
*
|
||||||
* @param boolean $check If true no deletes will occur and instead CakePHP will rely
|
* @param bool $check If true no deletes will occur and instead CakePHP will rely
|
||||||
* on key TTL values.
|
* on key TTL values.
|
||||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
* @return bool True if the cache was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
public function clear($check) {
|
public function clear($check) {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
|
@ -317,7 +317,7 @@ class MemcachedEngine extends CacheEngine {
|
||||||
* old values will remain in storage until they expire.
|
* old values will remain in storage until they expire.
|
||||||
*
|
*
|
||||||
* @param string $group The group to clear.
|
* @param string $group The group to clear.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
return (bool)$this->_Memcached->increment($this->settings['prefix'] . $group);
|
return (bool)$this->_Memcached->increment($this->settings['prefix'] . $group);
|
||||||
|
|
|
@ -51,7 +51,7 @@ class RedisEngine extends CacheEngine {
|
||||||
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
||||||
*
|
*
|
||||||
* @param array $settings array of setting for the engine
|
* @param array $settings array of setting for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
if (!class_exists('Redis')) {
|
if (!class_exists('Redis')) {
|
||||||
|
@ -76,7 +76,7 @@ class RedisEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Connects to a Redis server
|
* Connects to a Redis server
|
||||||
*
|
*
|
||||||
* @return boolean True if Redis server was connected
|
* @return bool True if Redis server was connected
|
||||||
*/
|
*/
|
||||||
protected function _connect() {
|
protected function _connect() {
|
||||||
$return = false;
|
$return = false;
|
||||||
|
@ -107,8 +107,8 @@ class RedisEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached
|
* @param mixed $value Data to be cached
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param int $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
public function write($key, $value, $duration) {
|
public function write($key, $value, $duration) {
|
||||||
if (!is_int($value)) {
|
if (!is_int($value)) {
|
||||||
|
@ -142,7 +142,7 @@ class RedisEngine extends CacheEngine {
|
||||||
* Increments the value of an integer cached key
|
* Increments the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to increment
|
* @param int $offset How much to increment
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
* @throws CacheException when you try to increment with compress = true
|
* @throws CacheException when you try to increment with compress = true
|
||||||
*/
|
*/
|
||||||
|
@ -154,7 +154,7 @@ class RedisEngine extends CacheEngine {
|
||||||
* Decrements the value of an integer cached key
|
* Decrements the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @return New decremented value, false otherwise
|
* @return New decremented value, false otherwise
|
||||||
* @throws CacheException when you try to decrement with compress = true
|
* @throws CacheException when you try to decrement with compress = true
|
||||||
*/
|
*/
|
||||||
|
@ -166,7 +166,7 @@ class RedisEngine extends CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
return $this->_Redis->delete($key) > 0;
|
return $this->_Redis->delete($key) > 0;
|
||||||
|
@ -175,9 +175,9 @@ class RedisEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache
|
* Delete all keys from the cache
|
||||||
*
|
*
|
||||||
* @param boolean $check Whether or not expiration keys should be checked. If
|
* @param bool $check Whether or not expiration keys should be checked. If
|
||||||
* true, no keys will be removed as cache will rely on redis TTL's.
|
* 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
|
* @return bool True if the cache was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
public function clear($check) {
|
public function clear($check) {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
|
@ -214,7 +214,7 @@ class RedisEngine extends CacheEngine {
|
||||||
* old values will remain in storage until they expire.
|
* old values will remain in storage until they expire.
|
||||||
*
|
*
|
||||||
* @param string $group The group name to clear.
|
* @param string $group The group name to clear.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
return (bool)$this->_Redis->incr($this->settings['prefix'] . $group);
|
return (bool)$this->_Redis->incr($this->settings['prefix'] . $group);
|
||||||
|
|
|
@ -40,7 +40,7 @@ class WincacheEngine extends CacheEngine {
|
||||||
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
||||||
*
|
*
|
||||||
* @param array $settings array of setting for the engine
|
* @param array $settings array of setting for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
* @see CacheEngine::__defaults
|
* @see CacheEngine::__defaults
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
|
@ -57,8 +57,8 @@ class WincacheEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached
|
* @param mixed $value Data to be cached
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param int $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
public function write($key, $value, $duration) {
|
public function write($key, $value, $duration) {
|
||||||
$expires = time() + $duration;
|
$expires = time() + $duration;
|
||||||
|
@ -91,7 +91,7 @@ class WincacheEngine extends CacheEngine {
|
||||||
* Increments the value of an integer cached key
|
* Increments the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to increment
|
* @param int $offset How much to increment
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
public function increment($key, $offset = 1) {
|
public function increment($key, $offset = 1) {
|
||||||
|
@ -102,7 +102,7 @@ class WincacheEngine extends CacheEngine {
|
||||||
* Decrements the value of an integer cached key
|
* Decrements the value of an integer cached key
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @return New decremented value, false otherwise
|
* @return New decremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
public function decrement($key, $offset = 1) {
|
public function decrement($key, $offset = 1) {
|
||||||
|
@ -113,7 +113,7 @@ class WincacheEngine extends CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
return wincache_ucache_delete($key);
|
return wincache_ucache_delete($key);
|
||||||
|
@ -123,9 +123,9 @@ class WincacheEngine extends CacheEngine {
|
||||||
* Delete all keys from the cache. This will clear every
|
* Delete all keys from the cache. This will clear every
|
||||||
* item in the cache matching the cache config prefix.
|
* item in the cache matching the cache config prefix.
|
||||||
*
|
*
|
||||||
* @param boolean $check If true, nothing will be cleared, as entries will
|
* @param bool $check If true, nothing will be cleared, as entries will
|
||||||
* naturally expire in wincache..
|
* naturally expire in wincache..
|
||||||
* @return boolean True Returns true.
|
* @return bool True Returns true.
|
||||||
*/
|
*/
|
||||||
public function clear($check) {
|
public function clear($check) {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
|
@ -180,7 +180,7 @@ class WincacheEngine extends CacheEngine {
|
||||||
* old values will remain in storage until they expire.
|
* old values will remain in storage until they expire.
|
||||||
*
|
*
|
||||||
* @param string $group The group to clear.
|
* @param string $group The group to clear.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
$success = null;
|
$success = null;
|
||||||
|
|
|
@ -41,7 +41,7 @@ class XcacheEngine extends CacheEngine {
|
||||||
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
|
||||||
*
|
*
|
||||||
* @param array $settings array of setting for the engine
|
* @param array $settings array of setting for the engine
|
||||||
* @return boolean True if the engine has been successfully initialized, false if not
|
* @return bool True if the engine has been successfully initialized, false if not
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
if (php_sapi_name() !== 'cli') {
|
if (php_sapi_name() !== 'cli') {
|
||||||
|
@ -62,8 +62,8 @@ class XcacheEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param mixed $value Data to be cached
|
* @param mixed $value Data to be cached
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param int $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return bool True if the data was successfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
public function write($key, $value, $duration) {
|
public function write($key, $value, $duration) {
|
||||||
$expires = time() + $duration;
|
$expires = time() + $duration;
|
||||||
|
@ -94,7 +94,7 @@ class XcacheEngine extends CacheEngine {
|
||||||
* If the cache key is not an integer it will be treated as 0
|
* If the cache key is not an integer it will be treated as 0
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to increment
|
* @param int $offset How much to increment
|
||||||
* @return New incremented value, false otherwise
|
* @return New incremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
public function increment($key, $offset = 1) {
|
public function increment($key, $offset = 1) {
|
||||||
|
@ -106,7 +106,7 @@ class XcacheEngine extends CacheEngine {
|
||||||
* If the cache key is not an integer it will be treated as 0
|
* If the cache key is not an integer it will be treated as 0
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @param integer $offset How much to subtract
|
* @param int $offset How much to subtract
|
||||||
* @return New decremented value, false otherwise
|
* @return New decremented value, false otherwise
|
||||||
*/
|
*/
|
||||||
public function decrement($key, $offset = 1) {
|
public function decrement($key, $offset = 1) {
|
||||||
|
@ -117,7 +117,7 @@ class XcacheEngine extends CacheEngine {
|
||||||
* Delete a key from the cache
|
* Delete a key from the cache
|
||||||
*
|
*
|
||||||
* @param string $key Identifier for the data
|
* @param string $key Identifier for the data
|
||||||
* @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
return xcache_unset($key);
|
return xcache_unset($key);
|
||||||
|
@ -126,9 +126,9 @@ class XcacheEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Delete all keys from the cache
|
* Delete all keys from the cache
|
||||||
*
|
*
|
||||||
* @param boolean $check If true no deletes will occur and instead CakePHP will rely
|
* @param bool $check If true no deletes will occur and instead CakePHP will rely
|
||||||
* on key TTL values.
|
* on key TTL values.
|
||||||
* @return boolean True if the cache was successfully cleared, false otherwise
|
* @return bool True if the cache was successfully cleared, false otherwise
|
||||||
*/
|
*/
|
||||||
public function clear($check) {
|
public function clear($check) {
|
||||||
$this->_auth();
|
$this->_auth();
|
||||||
|
@ -165,7 +165,7 @@ class XcacheEngine extends CacheEngine {
|
||||||
* old values will remain in storage until they expire.
|
* old values will remain in storage until they expire.
|
||||||
*
|
*
|
||||||
* @param string $group The group to clear.
|
* @param string $group The group to clear.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function clearGroup($group) {
|
public function clearGroup($group) {
|
||||||
return (bool)xcache_inc($this->settings['prefix'] . $group, 1);
|
return (bool)xcache_inc($this->settings['prefix'] . $group, 1);
|
||||||
|
@ -178,7 +178,7 @@ class XcacheEngine extends CacheEngine {
|
||||||
* This has to be done because xcache_clear_cache() needs to pass Basic Http Auth
|
* This has to be done because xcache_clear_cache() needs to pass Basic Http Auth
|
||||||
* (see xcache.admin configuration settings)
|
* (see xcache.admin configuration settings)
|
||||||
*
|
*
|
||||||
* @param boolean $reverse Revert changes
|
* @param bool $reverse Revert changes
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _auth($reverse = false) {
|
protected function _auth($reverse = false) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ interface ConfigReaderInterface {
|
||||||
*
|
*
|
||||||
* @param string $key The identifier to write to.
|
* @param string $key The identifier to write to.
|
||||||
* @param array $data The data to dump.
|
* @param array $data The data to dump.
|
||||||
* @return boolean True on success or false on failure.
|
* @return bool True on success or false on failure.
|
||||||
*/
|
*/
|
||||||
public function dump($key, $data);
|
public function dump($key, $data);
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ class IniReader implements ConfigReaderInterface {
|
||||||
* @param string $key The identifier to write to. If the key has a . it will be treated
|
* @param string $key The identifier to write to. If the key has a . it will be treated
|
||||||
* as a plugin prefix.
|
* as a plugin prefix.
|
||||||
* @param array $data The data to convert to ini file.
|
* @param array $data The data to convert to ini file.
|
||||||
* @return integer Bytes saved.
|
* @return int Bytes saved.
|
||||||
*/
|
*/
|
||||||
public function dump($key, $data) {
|
public function dump($key, $data) {
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
|
@ -83,7 +83,7 @@ class PhpReader implements ConfigReaderInterface {
|
||||||
* @param string $key The identifier to write to. If the key has a . it will be treated
|
* @param string $key The identifier to write to. If the key has a . it will be treated
|
||||||
* as a plugin prefix.
|
* as a plugin prefix.
|
||||||
* @param array $data Data to dump.
|
* @param array $data Data to dump.
|
||||||
* @return integer Bytes saved.
|
* @return int Bytes saved.
|
||||||
*/
|
*/
|
||||||
public function dump($key, $data) {
|
public function dump($key, $data) {
|
||||||
$contents = '<?php' . "\n" . '$config = ' . var_export($data, true) . ';';
|
$contents = '<?php' . "\n" . '$config = ' . var_export($data, true) . ';';
|
||||||
|
|
|
@ -220,7 +220,7 @@ class AclShell extends AppShell {
|
||||||
*
|
*
|
||||||
* @param string $class Class name that is being used.
|
* @param string $class Class name that is being used.
|
||||||
* @param array $node Array of node information.
|
* @param array $node Array of node information.
|
||||||
* @param integer $indent indent level.
|
* @param int $indent indent level.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _outputNode($class, $node, $indent) {
|
protected function _outputNode($class, $node, $indent) {
|
||||||
|
@ -519,7 +519,7 @@ class AclShell extends AppShell {
|
||||||
/**
|
/**
|
||||||
* Checks that given node exists
|
* Checks that given node exists
|
||||||
*
|
*
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function nodeExists() {
|
public function nodeExists() {
|
||||||
if (!isset($this->args[0]) || !isset($this->args[1])) {
|
if (!isset($this->args[0]) || !isset($this->args[1])) {
|
||||||
|
@ -559,7 +559,7 @@ class AclShell extends AppShell {
|
||||||
*
|
*
|
||||||
* @param string $class Class type you want (Aro/Aco)
|
* @param string $class Class type you want (Aro/Aco)
|
||||||
* @param string|array $identifier A mixed identifier for finding the node.
|
* @param string|array $identifier A mixed identifier for finding the node.
|
||||||
* @return integer Integer of NodeId. Will trigger an error if nothing is found.
|
* @return int Integer of NodeId. Will trigger an error if nothing is found.
|
||||||
*/
|
*/
|
||||||
protected function _getNodeId($class, $identifier) {
|
protected function _getNodeId($class, $identifier) {
|
||||||
$node = $this->Acl->{$class}->node($identifier);
|
$node = $this->Acl->{$class}->node($identifier);
|
||||||
|
|
|
@ -484,7 +484,7 @@ class ConsoleShell extends AppShell {
|
||||||
* Tells if the specified model is included in the list of available models
|
* Tells if the specified model is included in the list of available models
|
||||||
*
|
*
|
||||||
* @param string $modelToCheck The model to check.
|
* @param string $modelToCheck The model to check.
|
||||||
* @return boolean true if is an available model, false otherwise
|
* @return bool true if is an available model, false otherwise
|
||||||
*/
|
*/
|
||||||
protected function _isValidModel($modelToCheck) {
|
protected function _isValidModel($modelToCheck) {
|
||||||
return in_array($modelToCheck, $this->models);
|
return in_array($modelToCheck, $this->models);
|
||||||
|
@ -494,7 +494,7 @@ class ConsoleShell extends AppShell {
|
||||||
* Reloads the routes configuration from app/Config/routes.php, and compiles
|
* Reloads the routes configuration from app/Config/routes.php, and compiles
|
||||||
* all routes found
|
* all routes found
|
||||||
*
|
*
|
||||||
* @return boolean True if config reload was a success, otherwise false
|
* @return bool True if config reload was a success, otherwise false
|
||||||
*/
|
*/
|
||||||
protected function _loadRoutes() {
|
protected function _loadRoutes() {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
|
|
@ -39,7 +39,7 @@ class SchemaShell extends AppShell {
|
||||||
/**
|
/**
|
||||||
* is this a dry run?
|
* is this a dry run?
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_dry = null;
|
protected $_dry = null;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class ServerShell extends AppShell {
|
||||||
/**
|
/**
|
||||||
* Default ListenPort
|
* Default ListenPort
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
const DEFAULT_PORT = 80;
|
const DEFAULT_PORT = 80;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ class BakeTask extends AppShell {
|
||||||
/**
|
/**
|
||||||
* Flag for interactive mode
|
* Flag for interactive mode
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $interactive = false;
|
public $interactive = false;
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ class ControllerTask extends BakeTask {
|
||||||
*
|
*
|
||||||
* @param string $controllerName Controller name
|
* @param string $controllerName Controller name
|
||||||
* @param string $admin Admin route to use
|
* @param string $admin Admin route to use
|
||||||
* @param boolean $wannaUseSession Set to true to use sessions, false otherwise
|
* @param bool $wannaUseSession Set to true to use sessions, false otherwise
|
||||||
* @return string Baked actions
|
* @return string Baked actions
|
||||||
*/
|
*/
|
||||||
public function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
|
public function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
|
||||||
|
|
|
@ -200,7 +200,7 @@ class DbConfigTask extends AppShell {
|
||||||
* Output verification message and bake if it looks good
|
* Output verification message and bake if it looks good
|
||||||
*
|
*
|
||||||
* @param array $config The config data.
|
* @param array $config The config data.
|
||||||
* @return boolean True if user says it looks good, false otherwise
|
* @return bool True if user says it looks good, false otherwise
|
||||||
*/
|
*/
|
||||||
protected function _verify($config) {
|
protected function _verify($config) {
|
||||||
$config += $this->_defaultConfig;
|
$config += $this->_defaultConfig;
|
||||||
|
@ -247,7 +247,7 @@ class DbConfigTask extends AppShell {
|
||||||
* Assembles and writes database.php
|
* Assembles and writes database.php
|
||||||
*
|
*
|
||||||
* @param array $configs Configuration settings to use
|
* @param array $configs Configuration settings to use
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function bake($configs) {
|
public function bake($configs) {
|
||||||
if (!is_dir($this->path)) {
|
if (!is_dir($this->path)) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ class ExtractTask extends AppShell {
|
||||||
/**
|
/**
|
||||||
* Merge all domain and category strings into the default.pot file
|
* Merge all domain and category strings into the default.pot file
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_merge = false;
|
protected $_merge = false;
|
||||||
|
|
||||||
|
@ -93,21 +93,21 @@ class ExtractTask extends AppShell {
|
||||||
/**
|
/**
|
||||||
* Holds whether this call should extract model validation messages
|
* Holds whether this call should extract model validation messages
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_extractValidation = true;
|
protected $_extractValidation = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the validation string domain to use for validation messages when extracting
|
* Holds the validation string domain to use for validation messages when extracting
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_validationDomain = 'default';
|
protected $_validationDomain = 'default';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds whether this call should extract the CakePHP Lib messages
|
* Holds whether this call should extract the CakePHP Lib messages
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_extractCore = false;
|
protected $_extractCore = false;
|
||||||
|
|
||||||
|
@ -678,8 +678,8 @@ class ExtractTask extends AppShell {
|
||||||
/**
|
/**
|
||||||
* Get the strings from the position forward
|
* Get the strings from the position forward
|
||||||
*
|
*
|
||||||
* @param integer &$position Actual position on tokens array
|
* @param int &$position Actual position on tokens array
|
||||||
* @param integer $target Number of strings to extract
|
* @param int $target Number of strings to extract
|
||||||
* @return array Strings extracted
|
* @return array Strings extracted
|
||||||
*/
|
*/
|
||||||
protected function _getStrings(&$position, $target) {
|
protected function _getStrings(&$position, $target) {
|
||||||
|
@ -728,9 +728,9 @@ class ExtractTask extends AppShell {
|
||||||
* Indicate an invalid marker on a processed file
|
* Indicate an invalid marker on a processed file
|
||||||
*
|
*
|
||||||
* @param string $file File where invalid marker resides
|
* @param string $file File where invalid marker resides
|
||||||
* @param integer $line Line number
|
* @param int $line Line number
|
||||||
* @param string $marker Marker found
|
* @param string $marker Marker found
|
||||||
* @param integer $count Count
|
* @param int $count Count
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _markerError($file, $line, $marker, $count) {
|
protected function _markerError($file, $line, $marker, $count) {
|
||||||
|
@ -793,7 +793,7 @@ class ExtractTask extends AppShell {
|
||||||
* Returns whether this execution is meant to extract string only from directories in folder represented by the
|
* Returns whether this execution is meant to extract string only from directories in folder represented by the
|
||||||
* APP constant, i.e. this task is extracting strings from same application.
|
* APP constant, i.e. this task is extracting strings from same application.
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function _isExtractingApp() {
|
protected function _isExtractingApp() {
|
||||||
return $this->_paths === array(APP);
|
return $this->_paths === array(APP);
|
||||||
|
@ -803,7 +803,7 @@ class ExtractTask extends AppShell {
|
||||||
* Checks whether or not a given path is usable for writing.
|
* Checks whether or not a given path is usable for writing.
|
||||||
*
|
*
|
||||||
* @param string $path Path to folder
|
* @param string $path Path to folder
|
||||||
* @return boolean true if it exists and is writable, false otherwise
|
* @return bool true if it exists and is writable, false otherwise
|
||||||
*/
|
*/
|
||||||
protected function _isPathUsable($path) {
|
protected function _isPathUsable($path) {
|
||||||
return is_dir($path) && is_writable($path);
|
return is_dir($path) && is_writable($path);
|
||||||
|
|
|
@ -316,7 +316,7 @@ class FixtureTask extends BakeTask {
|
||||||
* Generate String representation of Records
|
* Generate String representation of Records
|
||||||
*
|
*
|
||||||
* @param array $tableInfo Table schema array
|
* @param array $tableInfo Table schema array
|
||||||
* @param integer $recordCount The number of records to generate.
|
* @param int $recordCount The number of records to generate.
|
||||||
* @return array Array of records to use in the fixture.
|
* @return array Array of records to use in the fixture.
|
||||||
*/
|
*/
|
||||||
protected function _generateRecords($tableInfo, $recordCount = 1) {
|
protected function _generateRecords($tableInfo, $recordCount = 1) {
|
||||||
|
|
|
@ -161,8 +161,8 @@ class ModelTask extends BakeTask {
|
||||||
*
|
*
|
||||||
* @param array $options Array of options to use for the selections. indexes must start at 0
|
* @param array $options Array of options to use for the selections. indexes must start at 0
|
||||||
* @param string $prompt Prompt to use for options list.
|
* @param string $prompt Prompt to use for options list.
|
||||||
* @param integer $default The default option for the given prompt.
|
* @param int $default The default option for the given prompt.
|
||||||
* @return integer Result of user choice.
|
* @return int Result of user choice.
|
||||||
*/
|
*/
|
||||||
public function inOptions($options, $prompt = null, $default = null) {
|
public function inOptions($options, $prompt = null, $default = null) {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
|
@ -186,7 +186,7 @@ class ModelTask extends BakeTask {
|
||||||
/**
|
/**
|
||||||
* Handles interactive baking
|
* Handles interactive baking
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function _interactive() {
|
protected function _interactive() {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
@ -342,7 +342,7 @@ class ModelTask extends BakeTask {
|
||||||
* Handles Generation and user interaction for creating validation.
|
* Handles Generation and user interaction for creating validation.
|
||||||
*
|
*
|
||||||
* @param Model $model Model to have validations generated for.
|
* @param Model $model Model to have validations generated for.
|
||||||
* @return array $validate Array of user selected validations.
|
* @return array validate Array of user selected validations.
|
||||||
*/
|
*/
|
||||||
public function doValidation($model) {
|
public function doValidation($model) {
|
||||||
if (!$model instanceof Model) {
|
if (!$model instanceof Model) {
|
||||||
|
@ -812,7 +812,7 @@ class ModelTask extends BakeTask {
|
||||||
* Assembles and writes a Model file.
|
* Assembles and writes a Model file.
|
||||||
*
|
*
|
||||||
* @param string|object $name Model name or object
|
* @param string|object $name Model name or object
|
||||||
* @param array|boolean $data if array and $name is not an object assume bake data, otherwise boolean.
|
* @param array|bool $data if array and $name is not an object assume bake data, otherwise boolean.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function bake($name, $data = array()) {
|
public function bake($name, $data = array()) {
|
||||||
|
|
|
@ -90,7 +90,7 @@ class PluginTask extends AppShell {
|
||||||
* Bake the plugin, create directories and files
|
* Bake the plugin, create directories and files
|
||||||
*
|
*
|
||||||
* @param string $plugin Name of the plugin in CamelCased format
|
* @param string $plugin Name of the plugin in CamelCased format
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function bake($plugin) {
|
public function bake($plugin) {
|
||||||
$pathOptions = App::path('plugins');
|
$pathOptions = App::path('plugins');
|
||||||
|
|
|
@ -142,7 +142,7 @@ class ProjectTask extends AppShell {
|
||||||
/**
|
/**
|
||||||
* Checks PHP's include_path for CakePHP.
|
* Checks PHP's include_path for CakePHP.
|
||||||
*
|
*
|
||||||
* @return boolean Indicates whether or not CakePHP exists on include_path
|
* @return bool Indicates whether or not CakePHP exists on include_path
|
||||||
*/
|
*/
|
||||||
public function cakeOnIncludePath() {
|
public function cakeOnIncludePath() {
|
||||||
$paths = explode(PATH_SEPARATOR, ini_get('include_path'));
|
$paths = explode(PATH_SEPARATOR, ini_get('include_path'));
|
||||||
|
@ -231,7 +231,7 @@ class ProjectTask extends AppShell {
|
||||||
* and points app/console/cake.php to the right place
|
* and points app/console/cake.php to the right place
|
||||||
*
|
*
|
||||||
* @param string $path Project path.
|
* @param string $path Project path.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function consolePath($path) {
|
public function consolePath($path) {
|
||||||
$File = new File($path . 'Console' . DS . 'cake.php');
|
$File = new File($path . 'Console' . DS . 'cake.php');
|
||||||
|
@ -252,7 +252,7 @@ class ProjectTask extends AppShell {
|
||||||
* Generates and writes 'Security.salt'
|
* Generates and writes 'Security.salt'
|
||||||
*
|
*
|
||||||
* @param string $path Project path
|
* @param string $path Project path
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function securitySalt($path) {
|
public function securitySalt($path) {
|
||||||
$File = new File($path . 'Config' . DS . 'core.php');
|
$File = new File($path . 'Config' . DS . 'core.php');
|
||||||
|
@ -272,7 +272,7 @@ class ProjectTask extends AppShell {
|
||||||
* Generates and writes 'Security.cipherSeed'
|
* Generates and writes 'Security.cipherSeed'
|
||||||
*
|
*
|
||||||
* @param string $path Project path
|
* @param string $path Project path
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function securityCipherSeed($path) {
|
public function securityCipherSeed($path) {
|
||||||
$File = new File($path . 'Config' . DS . 'core.php');
|
$File = new File($path . 'Config' . DS . 'core.php');
|
||||||
|
@ -293,7 +293,7 @@ class ProjectTask extends AppShell {
|
||||||
* Writes cache prefix using app's name
|
* Writes cache prefix using app's name
|
||||||
*
|
*
|
||||||
* @param string $dir Path to project
|
* @param string $dir Path to project
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function cachePrefix($dir) {
|
public function cachePrefix($dir) {
|
||||||
$app = basename($dir);
|
$app = basename($dir);
|
||||||
|
@ -310,8 +310,8 @@ class ProjectTask extends AppShell {
|
||||||
* Generates and writes CAKE_CORE_INCLUDE_PATH
|
* Generates and writes CAKE_CORE_INCLUDE_PATH
|
||||||
*
|
*
|
||||||
* @param string $path Project path
|
* @param string $path Project path
|
||||||
* @param boolean $hardCode Whether or not define calls should be hardcoded.
|
* @param bool $hardCode Whether or not define calls should be hardcoded.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function corePath($path, $hardCode = true) {
|
public function corePath($path, $hardCode = true) {
|
||||||
if (dirname($path) !== CAKE_CORE_INCLUDE_PATH) {
|
if (dirname($path) !== CAKE_CORE_INCLUDE_PATH) {
|
||||||
|
@ -331,8 +331,8 @@ class ProjectTask extends AppShell {
|
||||||
* Replaces the __CAKE_PATH__ placeholder in the template files.
|
* Replaces the __CAKE_PATH__ placeholder in the template files.
|
||||||
*
|
*
|
||||||
* @param string $filename The filename to operate on.
|
* @param string $filename The filename to operate on.
|
||||||
* @param boolean $hardCode Whether or not the define should be uncommented.
|
* @param bool $hardCode Whether or not the define should be uncommented.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
protected function _replaceCorePath($filename, $hardCode) {
|
protected function _replaceCorePath($filename, $hardCode) {
|
||||||
$contents = file_get_contents($filename);
|
$contents = file_get_contents($filename);
|
||||||
|
@ -354,7 +354,7 @@ class ProjectTask extends AppShell {
|
||||||
* Enables Configure::read('Routing.prefixes') in /app/Config/core.php
|
* Enables Configure::read('Routing.prefixes') in /app/Config/core.php
|
||||||
*
|
*
|
||||||
* @param string $name Name to use as admin routing
|
* @param string $name Name to use as admin routing
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function cakeAdmin($name) {
|
public function cakeAdmin($name) {
|
||||||
$path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath;
|
$path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath;
|
||||||
|
|
|
@ -103,7 +103,7 @@ class TestTask extends BakeTask {
|
||||||
* Handles interactive baking
|
* Handles interactive baking
|
||||||
*
|
*
|
||||||
* @param string $type The type of object to bake a test for.
|
* @param string $type The type of object to bake a test for.
|
||||||
* @return string|boolean
|
* @return string|bool
|
||||||
*/
|
*/
|
||||||
protected function _interactive($type = null) {
|
protected function _interactive($type = null) {
|
||||||
$this->interactive = true;
|
$this->interactive = true;
|
||||||
|
@ -129,7 +129,7 @@ class TestTask extends BakeTask {
|
||||||
*
|
*
|
||||||
* @param string $type Type of object to bake test case for ie. Model, Controller
|
* @param string $type Type of object to bake test case for ie. Model, Controller
|
||||||
* @param string $className the 'cake name' for the class ie. Posts for the PostsController
|
* @param string $className the 'cake name' for the class ie. Posts for the PostsController
|
||||||
* @return string|boolean
|
* @return string|bool
|
||||||
*/
|
*/
|
||||||
public function bake($type, $className) {
|
public function bake($type, $className) {
|
||||||
$plugin = null;
|
$plugin = null;
|
||||||
|
@ -242,7 +242,7 @@ class TestTask extends BakeTask {
|
||||||
* Currently only model, and controller are supported
|
* Currently only model, and controller are supported
|
||||||
*
|
*
|
||||||
* @param string $type The Type of object you are generating tests for eg. controller
|
* @param string $type The Type of object you are generating tests for eg. controller
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function typeCanDetectFixtures($type) {
|
public function typeCanDetectFixtures($type) {
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
|
@ -254,7 +254,7 @@ class TestTask extends BakeTask {
|
||||||
*
|
*
|
||||||
* @param string $package The package of object you are generating tests for eg. controller
|
* @param string $package The package of object you are generating tests for eg. controller
|
||||||
* @param string $class the Classname of the class the test is being generated for.
|
* @param string $class the Classname of the class the test is being generated for.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isLoadableClass($package, $class) {
|
public function isLoadableClass($package, $class) {
|
||||||
App::uses($class, $package);
|
App::uses($class, $package);
|
||||||
|
@ -466,7 +466,7 @@ class TestTask extends BakeTask {
|
||||||
* Controllers require a mock class.
|
* Controllers require a mock class.
|
||||||
*
|
*
|
||||||
* @param string $type The type of object tests are being generated for eg. controller.
|
* @param string $type The type of object tests are being generated for eg. controller.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasMockClass($type) {
|
public function hasMockClass($type) {
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
|
|
|
@ -342,7 +342,7 @@ class ViewTask extends BakeTask {
|
||||||
*
|
*
|
||||||
* @param string $action Action to bake
|
* @param string $action Action to bake
|
||||||
* @param string $content Content to write
|
* @param string $content Content to write
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function bake($action, $content = '') {
|
public function bake($action, $content = '') {
|
||||||
if ($content === true) {
|
if ($content === true) {
|
||||||
|
@ -455,7 +455,7 @@ class ViewTask extends BakeTask {
|
||||||
* Returns associations for controllers models.
|
* Returns associations for controllers models.
|
||||||
*
|
*
|
||||||
* @param Model $model The Model instance.
|
* @param Model $model The Model instance.
|
||||||
* @return array $associations
|
* @return array associations
|
||||||
*/
|
*/
|
||||||
protected function _associations(Model $model) {
|
protected function _associations(Model $model) {
|
||||||
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
||||||
|
|
|
@ -336,7 +336,7 @@ class TestShell extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $file The file to map.
|
* @param string $file The file to map.
|
||||||
* @param string $category The test file category.
|
* @param string $category The test file category.
|
||||||
* @param boolean $throwOnMissingFile Whether or not to throw an exception.
|
* @param bool $throwOnMissingFile Whether or not to throw an exception.
|
||||||
* @return array array(type, case)
|
* @return array array(type, case)
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -67,10 +67,10 @@ class ConsoleErrorHandler {
|
||||||
* Handle errors in the console environment. Writes errors to stderr,
|
* Handle errors in the console environment. Writes errors to stderr,
|
||||||
* and logs messages if Configure::read('debug') is 0.
|
* and logs messages if Configure::read('debug') is 0.
|
||||||
*
|
*
|
||||||
* @param integer $code Error code
|
* @param int $code Error code
|
||||||
* @param string $description Description of the error.
|
* @param string $description Description of the error.
|
||||||
* @param string $file The file the error occurred in.
|
* @param string $file The file the error occurred in.
|
||||||
* @param integer $line The line the error occurred on.
|
* @param int $line The line the error occurred on.
|
||||||
* @param array $context The backtrace of the error.
|
* @param array $context The backtrace of the error.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -95,7 +95,7 @@ class ConsoleErrorHandler {
|
||||||
/**
|
/**
|
||||||
* Wrapper for exit(), used for testing.
|
* Wrapper for exit(), used for testing.
|
||||||
*
|
*
|
||||||
* @param integer $code The exit code.
|
* @param int $code The exit code.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _stop($code = 0) {
|
protected function _stop($code = 0) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ class ConsoleInput {
|
||||||
* 2. Handle we are attached to must be stdin.
|
* 2. Handle we are attached to must be stdin.
|
||||||
* Allows rich editing with arrow keys and history when inputting a string.
|
* Allows rich editing with arrow keys and history when inputting a string.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_canReadline;
|
protected $_canReadline;
|
||||||
|
|
||||||
|
@ -70,8 +70,8 @@ class ConsoleInput {
|
||||||
/**
|
/**
|
||||||
* Checks if data is available on the stream
|
* Checks if data is available on the stream
|
||||||
*
|
*
|
||||||
* @param integer $timeout An optional time to wait for data
|
* @param int $timeout An optional time to wait for data
|
||||||
* @return boolean True for data available, false otherwise
|
* @return bool True for data available, false otherwise
|
||||||
*/
|
*/
|
||||||
public function dataAvailable($timeout = 0) {
|
public function dataAvailable($timeout = 0) {
|
||||||
$readFds = array($this->_input);
|
$readFds = array($this->_input);
|
||||||
|
|
|
@ -41,7 +41,7 @@ class ConsoleInputArgument {
|
||||||
/**
|
/**
|
||||||
* Is this option required?
|
* Is this option required?
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_required;
|
protected $_required;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class ConsoleInputArgument {
|
||||||
*
|
*
|
||||||
* @param string|array $name The long name of the option, or an array with all the properties.
|
* @param string|array $name The long name of the option, or an array with all the properties.
|
||||||
* @param string $help The help text for this option
|
* @param string $help The help text for this option
|
||||||
* @param boolean $required Whether this argument is required. Missing required args will trigger exceptions
|
* @param bool $required Whether this argument is required. Missing required args will trigger exceptions
|
||||||
* @param array $choices Valid choices for this option.
|
* @param array $choices Valid choices for this option.
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $help = '', $required = false, $choices = array()) {
|
public function __construct($name, $help = '', $required = false, $choices = array()) {
|
||||||
|
@ -85,7 +85,7 @@ class ConsoleInputArgument {
|
||||||
/**
|
/**
|
||||||
* Generate the help for this argument.
|
* Generate the help for this argument.
|
||||||
*
|
*
|
||||||
* @param integer $width The width to make the name of the option.
|
* @param int $width The width to make the name of the option.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function help($width = 0) {
|
public function help($width = 0) {
|
||||||
|
@ -123,7 +123,7 @@ class ConsoleInputArgument {
|
||||||
/**
|
/**
|
||||||
* Check if this argument is a required argument
|
* Check if this argument is a required argument
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isRequired() {
|
public function isRequired() {
|
||||||
return (bool)$this->_required;
|
return (bool)$this->_required;
|
||||||
|
@ -133,7 +133,7 @@ class ConsoleInputArgument {
|
||||||
* Check that $value is a valid choice for this argument.
|
* Check that $value is a valid choice for this argument.
|
||||||
*
|
*
|
||||||
* @param string $value The choice to validate.
|
* @param string $value The choice to validate.
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @throws ConsoleException
|
* @throws ConsoleException
|
||||||
*/
|
*/
|
||||||
public function validChoice($value) {
|
public function validChoice($value) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ class ConsoleInputOption {
|
||||||
/**
|
/**
|
||||||
* Is the option a boolean option. Boolean options do not consume a parameter.
|
* Is the option a boolean option. Boolean options do not consume a parameter.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_boolean;
|
protected $_boolean;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ class ConsoleInputOption {
|
||||||
* @param string|array $name The long name of the option, or an array with all the properties.
|
* @param string|array $name The long name of the option, or an array with all the properties.
|
||||||
* @param string $short The short alias for this option
|
* @param string $short The short alias for this option
|
||||||
* @param string $help The help text for this option
|
* @param string $help The help text for this option
|
||||||
* @param boolean $boolean Whether this option is a boolean option. Boolean options don't consume extra tokens
|
* @param bool $boolean Whether this option is a boolean option. Boolean options don't consume extra tokens
|
||||||
* @param string $default The default value for this option.
|
* @param string $default The default value for this option.
|
||||||
* @param array $choices Valid choices for this option.
|
* @param array $choices Valid choices for this option.
|
||||||
* @throws ConsoleException
|
* @throws ConsoleException
|
||||||
|
@ -118,7 +118,7 @@ class ConsoleInputOption {
|
||||||
/**
|
/**
|
||||||
* Generate the help for this this option.
|
* Generate the help for this this option.
|
||||||
*
|
*
|
||||||
* @param integer $width The width to make the name of the option.
|
* @param int $width The width to make the name of the option.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function help($width = 0) {
|
public function help($width = 0) {
|
||||||
|
@ -168,7 +168,7 @@ class ConsoleInputOption {
|
||||||
/**
|
/**
|
||||||
* Check if this option is a boolean option
|
* Check if this option is a boolean option
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isBoolean() {
|
public function isBoolean() {
|
||||||
return (bool)$this->_boolean;
|
return (bool)$this->_boolean;
|
||||||
|
@ -178,7 +178,7 @@ class ConsoleInputOption {
|
||||||
* Check that a value is a valid choice for this option.
|
* Check that a value is a valid choice for this option.
|
||||||
*
|
*
|
||||||
* @param string $value The choice to validate.
|
* @param string $value The choice to validate.
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @throws ConsoleException
|
* @throws ConsoleException
|
||||||
*/
|
*/
|
||||||
public function validChoice($value) {
|
public function validChoice($value) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ class ConsoleInputSubcommand {
|
||||||
/**
|
/**
|
||||||
* Generate the help for this this subcommand.
|
* Generate the help for this this subcommand.
|
||||||
*
|
*
|
||||||
* @param integer $width The width to make the name of the subcommand.
|
* @param int $width The width to make the name of the subcommand.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function help($width = 0) {
|
public function help($width = 0) {
|
||||||
|
|
|
@ -136,7 +136,7 @@ class ConsoleOptionParser {
|
||||||
* Construct an OptionParser so you can define its behavior
|
* Construct an OptionParser so you can define its behavior
|
||||||
*
|
*
|
||||||
* @param string $command The command name this parser is for. The command name is used for generating help.
|
* @param string $command The command name this parser is for. The command name is used for generating help.
|
||||||
* @param boolean $defaultOptions Whether you want the verbose and quiet options set. Setting
|
* @param bool $defaultOptions Whether you want the verbose and quiet options set. Setting
|
||||||
* this to false will prevent the addition of `--verbose` & `--quiet` options.
|
* this to false will prevent the addition of `--verbose` & `--quiet` options.
|
||||||
*/
|
*/
|
||||||
public function __construct($command = null, $defaultOptions = true) {
|
public function __construct($command = null, $defaultOptions = true) {
|
||||||
|
@ -165,7 +165,7 @@ class ConsoleOptionParser {
|
||||||
* Static factory method for creating new OptionParsers so you can chain methods off of them.
|
* Static factory method for creating new OptionParsers so you can chain methods off of them.
|
||||||
*
|
*
|
||||||
* @param string $command The command name this parser is for. The command name is used for generating help.
|
* @param string $command The command name this parser is for. The command name is used for generating help.
|
||||||
* @param boolean $defaultOptions Whether you want the verbose and quiet options set.
|
* @param bool $defaultOptions Whether you want the verbose and quiet options set.
|
||||||
* @return ConsoleOptionParser
|
* @return ConsoleOptionParser
|
||||||
*/
|
*/
|
||||||
public static function create($command, $defaultOptions = true) {
|
public static function create($command, $defaultOptions = true) {
|
||||||
|
@ -506,7 +506,7 @@ class ConsoleOptionParser {
|
||||||
* @param string $subcommand If present and a valid subcommand that has a linked parser.
|
* @param string $subcommand If present and a valid subcommand that has a linked parser.
|
||||||
* That subcommands help will be shown instead.
|
* That subcommands help will be shown instead.
|
||||||
* @param string $format Define the output format, can be text or xml
|
* @param string $format Define the output format, can be text or xml
|
||||||
* @param integer $width The width to format user content to. Defaults to 72
|
* @param int $width The width to format user content to. Defaults to 72
|
||||||
* @return string Generated help.
|
* @return string Generated help.
|
||||||
*/
|
*/
|
||||||
public function help($subcommand = null, $format = 'text', $width = 72) {
|
public function help($subcommand = null, $format = 'text', $width = 72) {
|
||||||
|
@ -604,7 +604,7 @@ class ConsoleOptionParser {
|
||||||
* Check to see if $name has an option (short/long) defined for it.
|
* Check to see if $name has an option (short/long) defined for it.
|
||||||
*
|
*
|
||||||
* @param string $name The name of the option.
|
* @param string $name The name of the option.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function _optionExists($name) {
|
protected function _optionExists($name) {
|
||||||
if (substr($name, 0, 2) === '--') {
|
if (substr($name, 0, 2) === '--') {
|
||||||
|
|
|
@ -47,21 +47,21 @@ class ConsoleOutput {
|
||||||
/**
|
/**
|
||||||
* Raw output constant - no modification of output text.
|
* Raw output constant - no modification of output text.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
const RAW = 0;
|
const RAW = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plain output - tags will be stripped.
|
* Plain output - tags will be stripped.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
const PLAIN = 1;
|
const PLAIN = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Color output - Convert known tags in to ANSI color escape codes.
|
* Color output - Convert known tags in to ANSI color escape codes.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
const COLOR = 2;
|
const COLOR = 2;
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class ConsoleOutput {
|
||||||
/**
|
/**
|
||||||
* The current output type. Manipulated with ConsoleOutput::outputAs();
|
* The current output type. Manipulated with ConsoleOutput::outputAs();
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $_outputAs = self::COLOR;
|
protected $_outputAs = self::COLOR;
|
||||||
|
|
||||||
|
@ -171,8 +171,8 @@ class ConsoleOutput {
|
||||||
* are passed, outputs just a newline.
|
* are passed, outputs just a newline.
|
||||||
*
|
*
|
||||||
* @param string|array $message A string or a an array of strings to output
|
* @param string|array $message A string or a an array of strings to output
|
||||||
* @param integer $newlines Number of newlines to append
|
* @param int $newlines Number of newlines to append
|
||||||
* @return integer Returns the number of bytes returned from writing to stdout.
|
* @return int Returns the number of bytes returned from writing to stdout.
|
||||||
*/
|
*/
|
||||||
public function write($message, $newlines = 1) {
|
public function write($message, $newlines = 1) {
|
||||||
if (is_array($message)) {
|
if (is_array($message)) {
|
||||||
|
@ -232,7 +232,7 @@ class ConsoleOutput {
|
||||||
* Writes a message to the output stream.
|
* Writes a message to the output stream.
|
||||||
*
|
*
|
||||||
* @param string $message Message to write.
|
* @param string $message Message to write.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
protected function _write($message) {
|
protected function _write($message) {
|
||||||
return fwrite($this->_output, $message);
|
return fwrite($this->_output, $message);
|
||||||
|
@ -281,7 +281,7 @@ class ConsoleOutput {
|
||||||
/**
|
/**
|
||||||
* Get/Set the output type to use. The output type how formatting tags are treated.
|
* Get/Set the output type to use. The output type how formatting tags are treated.
|
||||||
*
|
*
|
||||||
* @param integer $type The output type to use. Should be one of the class constants.
|
* @param int $type The output type to use. Should be one of the class constants.
|
||||||
* @return mixed Either null or the value if getting.
|
* @return mixed Either null or the value if getting.
|
||||||
*/
|
*/
|
||||||
public function outputAs($type = null) {
|
public function outputAs($type = null) {
|
||||||
|
|
|
@ -33,14 +33,14 @@ class HelpFormatter {
|
||||||
/**
|
/**
|
||||||
* The maximum number of arguments shown when generating usage.
|
* The maximum number of arguments shown when generating usage.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $_maxArgs = 6;
|
protected $_maxArgs = 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum number of options shown when generating usage.
|
* The maximum number of options shown when generating usage.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $_maxOptions = 6;
|
protected $_maxOptions = 6;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class HelpFormatter {
|
||||||
/**
|
/**
|
||||||
* Get the help as formatted text suitable for output on the command line.
|
* Get the help as formatted text suitable for output on the command line.
|
||||||
*
|
*
|
||||||
* @param integer $width The width of the help output.
|
* @param int $width The width of the help output.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function text($width = 72) {
|
public function text($width = 72) {
|
||||||
|
@ -160,7 +160,7 @@ class HelpFormatter {
|
||||||
* Iterate over a collection and find the longest named thing.
|
* Iterate over a collection and find the longest named thing.
|
||||||
*
|
*
|
||||||
* @param array $collection The collection to find a max length of.
|
* @param array $collection The collection to find a max length of.
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function _getMaxLength($collection) {
|
protected function _getMaxLength($collection) {
|
||||||
$max = 0;
|
$max = 0;
|
||||||
|
@ -173,7 +173,7 @@ class HelpFormatter {
|
||||||
/**
|
/**
|
||||||
* Get the help as an xml string.
|
* Get the help as an xml string.
|
||||||
*
|
*
|
||||||
* @param boolean $string Return the SimpleXml object or a string. Defaults to true.
|
* @param bool $string Return the SimpleXml object or a string. Defaults to true.
|
||||||
* @return string|SimpleXmlElement See $string
|
* @return string|SimpleXmlElement See $string
|
||||||
*/
|
*/
|
||||||
public function xml($string = true) {
|
public function xml($string = true) {
|
||||||
|
|
|
@ -34,21 +34,21 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* Output constant making verbose shells.
|
* Output constant making verbose shells.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
const VERBOSE = 2;
|
const VERBOSE = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output constant for making normal shells.
|
* Output constant for making normal shells.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
const NORMAL = 1;
|
const NORMAL = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output constants for making quiet shells.
|
* Output constants for making quiet shells.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
const QUIET = 0;
|
const QUIET = 0;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* If true, the script will ask for permission to perform actions.
|
* If true, the script will ask for permission to perform actions.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $interactive = true;
|
public $interactive = true;
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* If $uses is an array load each of the models in the array
|
* If $uses is an array load each of the models in the array
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function _loadModels() {
|
protected function _loadModels() {
|
||||||
if (is_array($this->uses)) {
|
if (is_array($this->uses)) {
|
||||||
|
@ -303,7 +303,7 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* Loads tasks defined in public $tasks
|
* Loads tasks defined in public $tasks
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function loadTasks() {
|
public function loadTasks() {
|
||||||
if ($this->tasks === true || empty($this->tasks) || empty($this->Tasks)) {
|
if ($this->tasks === true || empty($this->tasks) || empty($this->Tasks)) {
|
||||||
|
@ -318,7 +318,7 @@ class Shell extends Object {
|
||||||
* Check to see if this shell has a task with the provided name.
|
* Check to see if this shell has a task with the provided name.
|
||||||
*
|
*
|
||||||
* @param string $task The task name to check.
|
* @param string $task The task name to check.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask
|
||||||
*/
|
*/
|
||||||
public function hasTask($task) {
|
public function hasTask($task) {
|
||||||
|
@ -329,7 +329,7 @@ class Shell extends Object {
|
||||||
* Check to see if this shell has a callable method by the given name.
|
* Check to see if this shell has a callable method by the given name.
|
||||||
*
|
*
|
||||||
* @param string $name The method name to check.
|
* @param string $name The method name to check.
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod
|
||||||
*/
|
*/
|
||||||
public function hasMethod($name) {
|
public function hasMethod($name) {
|
||||||
|
@ -574,7 +574,7 @@ class Shell extends Object {
|
||||||
* - `indent` Indent the text with the string provided. Defaults to null.
|
* - `indent` Indent the text with the string provided. Defaults to null.
|
||||||
*
|
*
|
||||||
* @param string $text Text the text to format.
|
* @param string $text Text the text to format.
|
||||||
* @param string|integer|array $options Array of options to use, or an integer to wrap the text to.
|
* @param string|int|array $options Array of options to use, or an integer to wrap the text to.
|
||||||
* @return string Wrapped / indented text
|
* @return string Wrapped / indented text
|
||||||
* @see String::wrap()
|
* @see String::wrap()
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText
|
||||||
|
@ -595,9 +595,9 @@ class Shell extends Object {
|
||||||
* While using Shell::VERBOSE means it will only display when verbose output is toggled.
|
* While using Shell::VERBOSE means it will only display when verbose output is toggled.
|
||||||
*
|
*
|
||||||
* @param string|array $message A string or a an array of strings to output
|
* @param string|array $message A string or a an array of strings to output
|
||||||
* @param integer $newlines Number of newlines to append
|
* @param int $newlines Number of newlines to append
|
||||||
* @param integer $level The message's output level, see above.
|
* @param int $level The message's output level, see above.
|
||||||
* @return integer|boolean Returns the number of bytes returned from writing to stdout.
|
* @return int|bool Returns the number of bytes returned from writing to stdout.
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out
|
||||||
*/
|
*/
|
||||||
public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
|
public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
|
||||||
|
@ -619,7 +619,7 @@ class Shell extends Object {
|
||||||
* are passed outputs just a newline.
|
* are passed outputs just a newline.
|
||||||
*
|
*
|
||||||
* @param string|array $message A string or a an array of strings to output
|
* @param string|array $message A string or a an array of strings to output
|
||||||
* @param integer $newlines Number of newlines to append
|
* @param int $newlines Number of newlines to append
|
||||||
* @return void
|
* @return void
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err
|
||||||
*/
|
*/
|
||||||
|
@ -630,7 +630,7 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* Returns a single or multiple linefeeds sequences.
|
* Returns a single or multiple linefeeds sequences.
|
||||||
*
|
*
|
||||||
* @param integer $multiplier Number of times the linefeed sequence should be repeated
|
* @param int $multiplier Number of times the linefeed sequence should be repeated
|
||||||
* @return string
|
* @return string
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl
|
||||||
*/
|
*/
|
||||||
|
@ -641,8 +641,8 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* Outputs a series of minus characters to the standard output, acts as a visual separator.
|
* Outputs a series of minus characters to the standard output, acts as a visual separator.
|
||||||
*
|
*
|
||||||
* @param integer $newlines Number of newlines to pre- and append
|
* @param int $newlines Number of newlines to pre- and append
|
||||||
* @param integer $width Width of the line, defaults to 63
|
* @param int $width Width of the line, defaults to 63
|
||||||
* @return void
|
* @return void
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr
|
||||||
*/
|
*/
|
||||||
|
@ -691,7 +691,7 @@ class Shell extends Object {
|
||||||
*
|
*
|
||||||
* @param string $path Where to put the file.
|
* @param string $path Where to put the file.
|
||||||
* @param string $contents Content to put in the file.
|
* @param string $contents Content to put in the file.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile
|
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile
|
||||||
*/
|
*/
|
||||||
public function createFile($path, $contents) {
|
public function createFile($path, $contents) {
|
||||||
|
@ -729,7 +729,7 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* Action to create a Unit Test
|
* Action to create a Unit Test
|
||||||
*
|
*
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
protected function _checkUnitTest() {
|
protected function _checkUnitTest() {
|
||||||
if (class_exists('PHPUnit_Framework_TestCase')) {
|
if (class_exists('PHPUnit_Framework_TestCase')) {
|
||||||
|
@ -820,7 +820,7 @@ class Shell extends Object {
|
||||||
* creates the singular name for use in views.
|
* creates the singular name for use in views.
|
||||||
*
|
*
|
||||||
* @param string $name The plural underscored value.
|
* @param string $name The plural underscored value.
|
||||||
* @return string $name
|
* @return string name
|
||||||
*/
|
*/
|
||||||
protected function _singularName($name) {
|
protected function _singularName($name) {
|
||||||
return Inflector::variable(Inflector::singularize($name));
|
return Inflector::variable(Inflector::singularize($name));
|
||||||
|
@ -860,7 +860,7 @@ class Shell extends Object {
|
||||||
* Find the correct path for a plugin. Scans $pluginPaths for the plugin you want.
|
* Find the correct path for a plugin. Scans $pluginPaths for the plugin you want.
|
||||||
*
|
*
|
||||||
* @param string $pluginName Name of the plugin you want ie. DebugKit
|
* @param string $pluginName Name of the plugin you want ie. DebugKit
|
||||||
* @return string $path path to the correct plugin.
|
* @return string path path to the correct plugin.
|
||||||
*/
|
*/
|
||||||
protected function _pluginPath($pluginName) {
|
protected function _pluginPath($pluginName) {
|
||||||
if (CakePlugin::loaded($pluginName)) {
|
if (CakePlugin::loaded($pluginName)) {
|
||||||
|
@ -874,7 +874,7 @@ class Shell extends Object {
|
||||||
* If you don't wish to see in your stdout or stderr everything that is logged
|
* If you don't wish to see in your stdout or stderr everything that is logged
|
||||||
* through CakeLog, call this function with first param as false
|
* through CakeLog, call this function with first param as false
|
||||||
*
|
*
|
||||||
* @param boolean $enable whether to enable CakeLog output or not
|
* @param bool $enable whether to enable CakeLog output or not
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _useLogger($enable = true) {
|
protected function _useLogger($enable = true) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ShellDispatcher {
|
||||||
* a status code of either 0 or 1 according to the result of the dispatch.
|
* a status code of either 0 or 1 according to the result of the dispatch.
|
||||||
*
|
*
|
||||||
* @param array $args the argv from PHP
|
* @param array $args the argv from PHP
|
||||||
* @param boolean $bootstrap Should the environment be bootstrapped.
|
* @param bool $bootstrap Should the environment be bootstrapped.
|
||||||
*/
|
*/
|
||||||
public function __construct($args = array(), $bootstrap = true) {
|
public function __construct($args = array(), $bootstrap = true) {
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
@ -116,7 +116,7 @@ class ShellDispatcher {
|
||||||
/**
|
/**
|
||||||
* Initializes the environment and loads the CakePHP core.
|
* Initializes the environment and loads the CakePHP core.
|
||||||
*
|
*
|
||||||
* @return boolean Success.
|
* @return bool Success.
|
||||||
*/
|
*/
|
||||||
protected function _bootstrap() {
|
protected function _bootstrap() {
|
||||||
if (!defined('ROOT')) {
|
if (!defined('ROOT')) {
|
||||||
|
@ -182,7 +182,7 @@ class ShellDispatcher {
|
||||||
/**
|
/**
|
||||||
* Dispatches a CLI request
|
* Dispatches a CLI request
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @throws MissingShellMethodException
|
* @throws MissingShellMethodException
|
||||||
*/
|
*/
|
||||||
public function dispatch() {
|
public function dispatch() {
|
||||||
|
@ -360,7 +360,7 @@ class ShellDispatcher {
|
||||||
/**
|
/**
|
||||||
* Stop execution of the current script
|
* Stop execution of the current script
|
||||||
*
|
*
|
||||||
* @param integer|string $status see http://php.net/exit for values
|
* @param int|string $status see http://php.net/exit for values
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _stop($status = 0) {
|
protected function _stop($status = 0) {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -21,7 +21,7 @@ class DbAclSchema extends CakeSchema {
|
||||||
* Before event.
|
* Before event.
|
||||||
*
|
*
|
||||||
* @param array $event The event data.
|
* @param array $event The event data.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function before($event = array()) {
|
public function before($event = array()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Using the Schema command line utility
|
* Using the Schema command line utility
|
||||||
*
|
*
|
||||||
* Use it to configure database for i18n
|
* Use it to configure database for i18n
|
||||||
|
@ -30,7 +29,7 @@ class I18nSchema extends CakeSchema {
|
||||||
* Before event.
|
* Before event.
|
||||||
*
|
*
|
||||||
* @param array $event The event data.
|
* @param array $event The event data.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
public function before($event = array()) {
|
public function before($event = array()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Using the Schema command line utility
|
* Using the Schema command line utility
|
||||||
* cake schema run create Sessions
|
* cake schema run create Sessions
|
||||||
*
|
*
|
||||||
|
|
|
@ -261,7 +261,6 @@
|
||||||
//date_default_timezone_set('UTC');
|
//date_default_timezone_set('UTC');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Cache Engine Configuration
|
* Cache Engine Configuration
|
||||||
* Default settings provided below
|
* Default settings provided below
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Errors
|
* @package app.View.Errors
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Errors
|
* @package app.View.Errors
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Layouts.Email.html
|
* @package app.View.Layouts.Email.html
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Layouts
|
* @package app.View.Layouts
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Layouts
|
* @package app.View.Layouts
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Layouts
|
* @package app.View.Layouts
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Layouts
|
* @package app.View.Layouts
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app.View.Pages
|
* @package app.View.Pages
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package app
|
* @package app
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
@ -155,8 +153,8 @@ class Component extends Object {
|
||||||
*
|
*
|
||||||
* @param Controller $controller Controller with components to beforeRedirect
|
* @param Controller $controller Controller with components to beforeRedirect
|
||||||
* @param string|array $url Either the string or URL array that is being redirected to.
|
* @param string|array $url Either the string or URL array that is being redirected to.
|
||||||
* @param integer $status The status code of the redirect
|
* @param int $status The status code of the redirect
|
||||||
* @param boolean $exit Will the script exit.
|
* @param bool $exit Will the script exit.
|
||||||
* @return array|void Either an array or null.
|
* @return array|void Either an array or null.
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers/components.html#Component::beforeRedirect
|
* @link http://book.cakephp.org/2.0/en/controllers/components.html#Component::beforeRedirect
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -28,7 +28,7 @@ interface AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function check($aro, $aco, $action = "*");
|
public function check($aro, $aco, $action = "*");
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ interface AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function allow($aro, $aco, $action = "*");
|
public function allow($aro, $aco, $action = "*");
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ interface AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function deny($aro, $aco, $action = "*");
|
public function deny($aro, $aco, $action = "*");
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ interface AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function inherit($aro, $aco, $action = "*");
|
public function inherit($aro, $aco, $action = "*");
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class DbAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success (true if ARO has access to action in ACO, false otherwise)
|
* @return bool Success (true if ARO has access to action in ACO, false otherwise)
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html#checking-permissions-the-acl-component
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html#checking-permissions-the-acl-component
|
||||||
*/
|
*/
|
||||||
public function check($aro, $aco, $action = "*") {
|
public function check($aro, $aco, $action = "*") {
|
||||||
|
@ -80,8 +80,8 @@ class DbAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $actions Action (defaults to *)
|
* @param string $actions Action (defaults to *)
|
||||||
* @param integer $value Value to indicate access type (1 to give access, -1 to deny, 0 to inherit)
|
* @param int $value Value to indicate access type (1 to give access, -1 to deny, 0 to inherit)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html#assigning-permissions
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html#assigning-permissions
|
||||||
*/
|
*/
|
||||||
public function allow($aro, $aco, $actions = "*", $value = 1) {
|
public function allow($aro, $aco, $actions = "*", $value = 1) {
|
||||||
|
@ -94,7 +94,7 @@ class DbAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html#assigning-permissions
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html#assigning-permissions
|
||||||
*/
|
*/
|
||||||
public function deny($aro, $aco, $action = "*") {
|
public function deny($aro, $aco, $action = "*") {
|
||||||
|
@ -107,7 +107,7 @@ class DbAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function inherit($aro, $aco, $action = "*") {
|
public function inherit($aro, $aco, $action = "*") {
|
||||||
return $this->allow($aro, $aco, $action, 0);
|
return $this->allow($aro, $aco, $action, 0);
|
||||||
|
@ -119,7 +119,7 @@ class DbAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @see allow()
|
* @see allow()
|
||||||
*/
|
*/
|
||||||
public function grant($aro, $aco, $action = "*") {
|
public function grant($aro, $aco, $action = "*") {
|
||||||
|
@ -132,7 +132,7 @@ class DbAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @see deny()
|
* @see deny()
|
||||||
*/
|
*/
|
||||||
public function revoke($aro, $aco, $action = "*") {
|
public function revoke($aro, $aco, $action = "*") {
|
||||||
|
|
|
@ -55,7 +55,7 @@ class IniAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function allow($aro, $aco, $action = "*") {
|
public function allow($aro, $aco, $action = "*") {
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class IniAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function deny($aro, $aco, $action = "*") {
|
public function deny($aro, $aco, $action = "*") {
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class IniAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function inherit($aro, $aco, $action = "*") {
|
public function inherit($aro, $aco, $action = "*") {
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ class IniAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO
|
* @param string $aro ARO
|
||||||
* @param string $aco ACO
|
* @param string $aco ACO
|
||||||
* @param string $action Action
|
* @param string $action Action
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function check($aro, $aco, $action = null) {
|
public function check($aro, $aco, $action = null) {
|
||||||
if (!$this->config) {
|
if (!$this->config) {
|
||||||
|
|
|
@ -27,14 +27,14 @@ class PhpAcl extends Object implements AclInterface {
|
||||||
/**
|
/**
|
||||||
* Constant for deny
|
* Constant for deny
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
const DENY = false;
|
const DENY = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant for allow
|
* Constant for allow
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
const ALLOW = true;
|
const ALLOW = true;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ class PhpAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function allow($aro, $aco, $action = "*") {
|
public function allow($aro, $aco, $action = "*") {
|
||||||
return $this->Aco->access($this->Aro->resolve($aro), $aco, $action, 'allow');
|
return $this->Aco->access($this->Aro->resolve($aro), $aco, $action, 'allow');
|
||||||
|
@ -136,7 +136,7 @@ class PhpAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function deny($aro, $aco, $action = "*") {
|
public function deny($aro, $aco, $action = "*") {
|
||||||
return $this->Aco->access($this->Aro->resolve($aro), $aco, $action, 'deny');
|
return $this->Aco->access($this->Aro->resolve($aro), $aco, $action, 'deny');
|
||||||
|
@ -148,7 +148,7 @@ class PhpAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO The requesting object identifier.
|
* @param string $aro ARO The requesting object identifier.
|
||||||
* @param string $aco ACO The controlled object identifier.
|
* @param string $aco ACO The controlled object identifier.
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function inherit($aro, $aco, $action = "*") {
|
public function inherit($aro, $aco, $action = "*") {
|
||||||
return false;
|
return false;
|
||||||
|
@ -161,7 +161,7 @@ class PhpAcl extends Object implements AclInterface {
|
||||||
* @param string $aro ARO
|
* @param string $aro ARO
|
||||||
* @param string $aco ACO
|
* @param string $aco ACO
|
||||||
* @param string $action Action
|
* @param string $action Action
|
||||||
* @return boolean true if access is granted, false otherwise
|
* @return bool true if access is granted, false otherwise
|
||||||
*/
|
*/
|
||||||
public function check($aro, $aco, $action = "*") {
|
public function check($aro, $aco, $action = "*") {
|
||||||
$allow = $this->options['policy'];
|
$allow = $this->options['policy'];
|
||||||
|
|
|
@ -104,7 +104,7 @@ class AclComponent extends Component {
|
||||||
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function check($aro, $aco, $action = "*") {
|
public function check($aro, $aco, $action = "*") {
|
||||||
return $this->_Instance->check($aro, $aco, $action);
|
return $this->_Instance->check($aro, $aco, $action);
|
||||||
|
@ -117,7 +117,7 @@ class AclComponent extends Component {
|
||||||
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function allow($aro, $aco, $action = "*") {
|
public function allow($aro, $aco, $action = "*") {
|
||||||
return $this->_Instance->allow($aro, $aco, $action);
|
return $this->_Instance->allow($aro, $aco, $action);
|
||||||
|
@ -130,7 +130,7 @@ class AclComponent extends Component {
|
||||||
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function deny($aro, $aco, $action = "*") {
|
public function deny($aro, $aco, $action = "*") {
|
||||||
return $this->_Instance->deny($aro, $aco, $action);
|
return $this->_Instance->deny($aro, $aco, $action);
|
||||||
|
@ -143,7 +143,7 @@ class AclComponent extends Component {
|
||||||
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function inherit($aro, $aco, $action = "*") {
|
public function inherit($aro, $aco, $action = "*") {
|
||||||
return $this->_Instance->inherit($aro, $aco, $action);
|
return $this->_Instance->inherit($aro, $aco, $action);
|
||||||
|
@ -155,7 +155,7 @@ class AclComponent extends Component {
|
||||||
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @deprecated Will be removed in 3.0.
|
* @deprecated Will be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function grant($aro, $aco, $action = "*") {
|
public function grant($aro, $aco, $action = "*") {
|
||||||
|
@ -169,7 +169,7 @@ class AclComponent extends Component {
|
||||||
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aro ARO The requesting object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
* @param array|string|Model $aco ACO The controlled object identifier. See `AclNode::node()` for possible formats
|
||||||
* @param string $action Action (defaults to *)
|
* @param string $action Action (defaults to *)
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @deprecated Will be removed in 3.0.
|
* @deprecated Will be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function revoke($aro, $aco, $action = "*") {
|
public function revoke($aro, $aco, $action = "*") {
|
||||||
|
|
|
@ -65,7 +65,7 @@ abstract class AbstractPasswordHasher {
|
||||||
*
|
*
|
||||||
* @param string|array $password Plain text password to hash or data array.
|
* @param string|array $password Plain text password to hash or data array.
|
||||||
* @param string $hashedPassword Existing hashed password.
|
* @param string $hashedPassword Existing hashed password.
|
||||||
* @return boolean True if hashes match else false.
|
* @return bool True if hashes match else false.
|
||||||
*/
|
*/
|
||||||
abstract public function check($password, $hashedPassword);
|
abstract public function check($password, $hashedPassword);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
@ -32,7 +30,7 @@ class ActionsAuthorize extends BaseAuthorize {
|
||||||
*
|
*
|
||||||
* @param array $user The user to authorize
|
* @param array $user The user to authorize
|
||||||
* @param CakeRequest $request The request needing authorization.
|
* @param CakeRequest $request The request needing authorization.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function authorize($user, CakeRequest $request) {
|
public function authorize($user, CakeRequest $request) {
|
||||||
$Acl = $this->_Collection->load('Acl');
|
$Acl = $this->_Collection->load('Acl');
|
||||||
|
|
|
@ -86,7 +86,7 @@ abstract class BaseAuthenticate {
|
||||||
*
|
*
|
||||||
* @param string|array $username The username/identifier, or an array of find conditions.
|
* @param string|array $username The username/identifier, or an array of find conditions.
|
||||||
* @param string $password The password, only used if $username param is string.
|
* @param string $password The password, only used if $username param is string.
|
||||||
* @return boolean|array Either false on failure, or an array of user data.
|
* @return bool|array Either false on failure, or an array of user data.
|
||||||
*/
|
*/
|
||||||
protected function _findUser($username, $password = null) {
|
protected function _findUser($username, $password = null) {
|
||||||
$userModel = $this->settings['userModel'];
|
$userModel = $this->settings['userModel'];
|
||||||
|
|
|
@ -78,7 +78,7 @@ abstract class BaseAuthorize {
|
||||||
*
|
*
|
||||||
* @param array $user Active user data
|
* @param array $user Active user data
|
||||||
* @param CakeRequest $request Request instance.
|
* @param CakeRequest $request Request instance.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
abstract public function authorize($user, CakeRequest $request);
|
abstract public function authorize($user, CakeRequest $request);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
|
|
@ -39,7 +39,7 @@ class BlowfishPasswordHasher extends AbstractPasswordHasher {
|
||||||
*
|
*
|
||||||
* @param string $password Plain text password to hash.
|
* @param string $password Plain text password to hash.
|
||||||
* @param string $hashedPassword Existing hashed password.
|
* @param string $hashedPassword Existing hashed password.
|
||||||
* @return boolean True if hashes match else false.
|
* @return bool True if hashes match else false.
|
||||||
*/
|
*/
|
||||||
public function check($password, $hashedPassword) {
|
public function check($password, $hashedPassword) {
|
||||||
return $hashedPassword === Security::hash($password, 'blowfish', $hashedPassword);
|
return $hashedPassword === Security::hash($password, 'blowfish', $hashedPassword);
|
||||||
|
|
|
@ -57,7 +57,7 @@ class ControllerAuthorize extends BaseAuthorize {
|
||||||
*
|
*
|
||||||
* @param array $user Active user data
|
* @param array $user Active user data
|
||||||
* @param CakeRequest $request Request instance.
|
* @param CakeRequest $request Request instance.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function authorize($user, CakeRequest $request) {
|
public function authorize($user, CakeRequest $request) {
|
||||||
return (bool)$this->_Controller->isAuthorized($user);
|
return (bool)$this->_Controller->isAuthorized($user);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
|
@ -78,7 +76,7 @@ class CrudAuthorize extends BaseAuthorize {
|
||||||
*
|
*
|
||||||
* @param array $user The user to authorize
|
* @param array $user The user to authorize
|
||||||
* @param CakeRequest $request The request needing authorization.
|
* @param CakeRequest $request The request needing authorization.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function authorize($user, CakeRequest $request) {
|
public function authorize($user, CakeRequest $request) {
|
||||||
if (!isset($this->settings['actionMap'][$request->params['action']])) {
|
if (!isset($this->settings['actionMap'][$request->params['action']])) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ class FormAuthenticate extends BaseAuthenticate {
|
||||||
* @param CakeRequest $request The request that contains login information.
|
* @param CakeRequest $request The request that contains login information.
|
||||||
* @param string $model The model used for login verification.
|
* @param string $model The model used for login verification.
|
||||||
* @param array $fields The fields to be checked.
|
* @param array $fields The fields to be checked.
|
||||||
* @return boolean False if the fields have not been supplied. True if they exist.
|
* @return bool False if the fields have not been supplied. True if they exist.
|
||||||
*/
|
*/
|
||||||
protected function _checkFields(CakeRequest $request, $model, $fields) {
|
protected function _checkFields(CakeRequest $request, $model, $fields) {
|
||||||
if (empty($request->data[$model])) {
|
if (empty($request->data[$model])) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class SimplePasswordHasher extends AbstractPasswordHasher {
|
||||||
*
|
*
|
||||||
* @param string $password Plain text password to hash.
|
* @param string $password Plain text password to hash.
|
||||||
* @param string $hashedPassword Existing hashed password.
|
* @param string $hashedPassword Existing hashed password.
|
||||||
* @return boolean True if hashes match else false.
|
* @return bool True if hashes match else false.
|
||||||
*/
|
*/
|
||||||
public function check($password, $hashedPassword) {
|
public function check($password, $hashedPassword) {
|
||||||
return $hashedPassword === $this->hash($password);
|
return $hashedPassword === $this->hash($password);
|
||||||
|
|
|
@ -211,7 +211,7 @@ class AuthComponent extends Component {
|
||||||
* Error to display when user attempts to access an object or action to which they do not have
|
* Error to display when user attempts to access an object or action to which they do not have
|
||||||
* access.
|
* access.
|
||||||
*
|
*
|
||||||
* @var string|boolean Error message or boolean false to suppress flash message
|
* @var string|bool
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#AuthComponent::$authError
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#AuthComponent::$authError
|
||||||
*/
|
*/
|
||||||
public $authError = null;
|
public $authError = null;
|
||||||
|
@ -277,7 +277,7 @@ class AuthComponent extends Component {
|
||||||
* of login form data.
|
* of login form data.
|
||||||
*
|
*
|
||||||
* @param Controller $controller A reference to the instantiating controller object
|
* @param Controller $controller A reference to the instantiating controller object
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function startup(Controller $controller) {
|
public function startup(Controller $controller) {
|
||||||
$methods = array_flip(array_map('strtolower', $controller->methods));
|
$methods = array_flip(array_map('strtolower', $controller->methods));
|
||||||
|
@ -318,7 +318,7 @@ class AuthComponent extends Component {
|
||||||
* Checks whether current action is accessible without authentication.
|
* Checks whether current action is accessible without authentication.
|
||||||
*
|
*
|
||||||
* @param Controller $controller A reference to the instantiating controller object
|
* @param Controller $controller A reference to the instantiating controller object
|
||||||
* @return boolean True if action is accessible without authentication else false
|
* @return bool True if action is accessible without authentication else false
|
||||||
*/
|
*/
|
||||||
protected function _isAllowed(Controller $controller) {
|
protected function _isAllowed(Controller $controller) {
|
||||||
$action = strtolower($controller->request->params['action']);
|
$action = strtolower($controller->request->params['action']);
|
||||||
|
@ -338,7 +338,7 @@ class AuthComponent extends Component {
|
||||||
* is returned.
|
* is returned.
|
||||||
*
|
*
|
||||||
* @param Controller $controller A reference to the controller object.
|
* @param Controller $controller A reference to the controller object.
|
||||||
* @return boolean True if current action is login action else false.
|
* @return bool True if current action is login action else false.
|
||||||
*/
|
*/
|
||||||
protected function _unauthenticated(Controller $controller) {
|
protected function _unauthenticated(Controller $controller) {
|
||||||
if (empty($this->_authenticateObjects)) {
|
if (empty($this->_authenticateObjects)) {
|
||||||
|
@ -379,7 +379,7 @@ class AuthComponent extends Component {
|
||||||
* Normalizes $loginAction and checks if current request URL is same as login action.
|
* Normalizes $loginAction and checks if current request URL is same as login action.
|
||||||
*
|
*
|
||||||
* @param Controller $controller A reference to the controller object.
|
* @param Controller $controller A reference to the controller object.
|
||||||
* @return boolean True if current action is login action else false.
|
* @return bool True if current action is login action else false.
|
||||||
*/
|
*/
|
||||||
protected function _isLoginAction(Controller $controller) {
|
protected function _isLoginAction(Controller $controller) {
|
||||||
$url = '';
|
$url = '';
|
||||||
|
@ -396,7 +396,7 @@ class AuthComponent extends Component {
|
||||||
* Handle unauthorized access attempt
|
* Handle unauthorized access attempt
|
||||||
*
|
*
|
||||||
* @param Controller $controller A reference to the controller object
|
* @param Controller $controller A reference to the controller object
|
||||||
* @return boolean Returns false
|
* @return bool Returns false
|
||||||
* @throws ForbiddenException
|
* @throws ForbiddenException
|
||||||
* @see AuthComponent::$unauthorizedRedirect
|
* @see AuthComponent::$unauthorizedRedirect
|
||||||
*/
|
*/
|
||||||
|
@ -422,7 +422,7 @@ class AuthComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Attempts to introspect the correct values for object properties.
|
* Attempts to introspect the correct values for object properties.
|
||||||
*
|
*
|
||||||
* @return boolean True
|
* @return bool True
|
||||||
*/
|
*/
|
||||||
protected function _setDefaults() {
|
protected function _setDefaults() {
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
|
@ -446,7 +446,7 @@ class AuthComponent extends Component {
|
||||||
*
|
*
|
||||||
* @param array $user The user to check the authorization of. If empty the user in the session will be used.
|
* @param array $user The user to check the authorization of. If empty the user in the session will be used.
|
||||||
* @param CakeRequest $request The request to authenticate for. If empty, the current request will be used.
|
* @param CakeRequest $request The request to authenticate for. If empty, the current request will be used.
|
||||||
* @return boolean True if $user is authorized, otherwise false
|
* @return bool True if $user is authorized, otherwise false
|
||||||
*/
|
*/
|
||||||
public function isAuthorized($user = null, CakeRequest $request = null) {
|
public function isAuthorized($user = null, CakeRequest $request = null) {
|
||||||
if (empty($user) && !$this->user()) {
|
if (empty($user) && !$this->user()) {
|
||||||
|
@ -590,7 +590,7 @@ class AuthComponent extends Component {
|
||||||
* will also change the session id in order to help mitigate session replays.
|
* will also change the session id in order to help mitigate session replays.
|
||||||
*
|
*
|
||||||
* @param array $user Either an array of user data, or null to identify a user using the current request.
|
* @param array $user Either an array of user data, or null to identify a user using the current request.
|
||||||
* @return boolean True on login success, false on failure
|
* @return bool True on login success, false on failure
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in
|
||||||
*/
|
*/
|
||||||
public function login($user = null) {
|
public function login($user = null) {
|
||||||
|
@ -663,7 +663,7 @@ class AuthComponent extends Component {
|
||||||
* Similar to AuthComponent::user() except if the session user cannot be found, connected authentication
|
* Similar to AuthComponent::user() except if the session user cannot be found, connected authentication
|
||||||
* objects will have their getUser() methods called. This lets stateless authentication methods function correctly.
|
* objects will have their getUser() methods called. This lets stateless authentication methods function correctly.
|
||||||
*
|
*
|
||||||
* @return boolean true if a user can be found, false if one cannot.
|
* @return bool true if a user can be found, false if one cannot.
|
||||||
*/
|
*/
|
||||||
protected function _getUser() {
|
protected function _getUser() {
|
||||||
$user = $this->user();
|
$user = $this->user();
|
||||||
|
@ -812,7 +812,7 @@ class AuthComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Check whether or not the current user has data in the session, and is considered logged in.
|
* Check whether or not the current user has data in the session, and is considered logged in.
|
||||||
*
|
*
|
||||||
* @return boolean true if the user is logged in, false otherwise
|
* @return bool true if the user is logged in, false otherwise
|
||||||
* @deprecated Since 2.5. Use AuthComponent::user() directly.
|
* @deprecated Since 2.5. Use AuthComponent::user() directly.
|
||||||
*/
|
*/
|
||||||
public function loggedIn() {
|
public function loggedIn() {
|
||||||
|
|
|
@ -92,7 +92,7 @@ class CookieComponent extends Component {
|
||||||
* Indicates that the cookie should only be transmitted over a secure HTTPS connection.
|
* Indicates that the cookie should only be transmitted over a secure HTTPS connection.
|
||||||
* When set to true, the cookie will only be set if a secure connection exists.
|
* When set to true, the cookie will only be set if a secure connection exists.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $secure = false;
|
public $secure = false;
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ class CookieComponent extends Component {
|
||||||
* Set to true to make HTTP only cookies. Cookies that are HTTP only
|
* Set to true to make HTTP only cookies. Cookies that are HTTP only
|
||||||
* are not accessible in JavaScript.
|
* are not accessible in JavaScript.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $httpOnly = false;
|
public $httpOnly = false;
|
||||||
|
|
||||||
|
@ -208,8 +208,8 @@ class CookieComponent extends Component {
|
||||||
*
|
*
|
||||||
* @param string|array $key Key for the value
|
* @param string|array $key Key for the value
|
||||||
* @param mixed $value Value
|
* @param mixed $value Value
|
||||||
* @param boolean $encrypt Set to true to encrypt value, false otherwise
|
* @param bool $encrypt Set to true to encrypt value, false otherwise
|
||||||
* @param integer|string $expires Can be either the number of seconds until a cookie
|
* @param int|string $expires Can be either the number of seconds until a cookie
|
||||||
* expires, or a strtotime compatible time offset.
|
* expires, or a strtotime compatible time offset.
|
||||||
* @return void
|
* @return void
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html#CookieComponent::write
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html#CookieComponent::write
|
||||||
|
@ -294,7 +294,7 @@ class CookieComponent extends Component {
|
||||||
* Returns true if given variable is set in cookie.
|
* Returns true if given variable is set in cookie.
|
||||||
*
|
*
|
||||||
* @param string $key Variable name to check for
|
* @param string $key Variable name to check for
|
||||||
* @return boolean True if variable is there
|
* @return bool True if variable is there
|
||||||
*/
|
*/
|
||||||
public function check($key = null) {
|
public function check($key = null) {
|
||||||
if (empty($key)) {
|
if (empty($key)) {
|
||||||
|
@ -400,8 +400,8 @@ class CookieComponent extends Component {
|
||||||
* CookieComponent::write(string, string, boolean, 8400);
|
* CookieComponent::write(string, string, boolean, 8400);
|
||||||
* CookieComponent::write(string, string, boolean, '5 Days');
|
* CookieComponent::write(string, string, boolean, '5 Days');
|
||||||
*
|
*
|
||||||
* @param integer|string $expires Can be either Unix timestamp, or date string
|
* @param int|string $expires Can be either Unix timestamp, or date string
|
||||||
* @return integer Unix timestamp
|
* @return int Unix timestamp
|
||||||
*/
|
*/
|
||||||
protected function _expire($expires = null) {
|
protected function _expire($expires = null) {
|
||||||
if ($expires === null) {
|
if ($expires === null) {
|
||||||
|
|
|
@ -282,7 +282,7 @@ class EmailComponent extends Component {
|
||||||
* If you are rendering a template this variable will be sent to the templates as `$content`
|
* If you are rendering a template this variable will be sent to the templates as `$content`
|
||||||
* @param string $template Template to use when sending email
|
* @param string $template Template to use when sending email
|
||||||
* @param string $layout Layout to use to enclose email body
|
* @param string $layout Layout to use to enclose email body
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function send($content = null, $template = null, $layout = null) {
|
public function send($content = null, $template = null, $layout = null) {
|
||||||
$lib = new CakeEmail();
|
$lib = new CakeEmail();
|
||||||
|
@ -444,7 +444,7 @@ class EmailComponent extends Component {
|
||||||
* Helps prevent header injection / manipulation on user content.
|
* Helps prevent header injection / manipulation on user content.
|
||||||
*
|
*
|
||||||
* @param string $value Value to strip
|
* @param string $value Value to strip
|
||||||
* @param boolean $message Set to true to indicate main message content
|
* @param bool $message Set to true to indicate main message content
|
||||||
* @return string Stripped value
|
* @return string Stripped value
|
||||||
*/
|
*/
|
||||||
protected function _strip($value, $message = false) {
|
protected function _strip($value, $message = false) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Determines whether or not callbacks will be fired on this component
|
* Determines whether or not callbacks will be fired on this component
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $enabled = true;
|
public $enabled = true;
|
||||||
|
|
||||||
|
@ -245,8 +245,8 @@ class RequestHandlerComponent extends Component {
|
||||||
*
|
*
|
||||||
* @param Controller $controller A reference to the controller
|
* @param Controller $controller A reference to the controller
|
||||||
* @param string|array $url A string or array containing the redirect location
|
* @param string|array $url A string or array containing the redirect location
|
||||||
* @param integer|array $status HTTP Status for redirect
|
* @param int|array $status HTTP Status for redirect
|
||||||
* @param boolean $exit Whether to exit script, defaults to `true`.
|
* @param bool $exit Whether to exit script, defaults to `true`.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
|
public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
|
||||||
|
@ -280,7 +280,7 @@ class RequestHandlerComponent extends Component {
|
||||||
* "304 Not Modified" header.
|
* "304 Not Modified" header.
|
||||||
*
|
*
|
||||||
* @param Controller $controller Controller instance.
|
* @param Controller $controller Controller instance.
|
||||||
* @return boolean false if the render process should be aborted
|
* @return bool false if the render process should be aborted
|
||||||
*/
|
*/
|
||||||
public function beforeRender(Controller $controller) {
|
public function beforeRender(Controller $controller) {
|
||||||
if ($this->settings['checkHttpCache'] && $this->response->checkNotModified($this->request)) {
|
if ($this->settings['checkHttpCache'] && $this->response->checkNotModified($this->request)) {
|
||||||
|
@ -291,7 +291,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current HTTP request is Ajax, false otherwise
|
* Returns true if the current HTTP request is Ajax, false otherwise
|
||||||
*
|
*
|
||||||
* @return boolean True if call is Ajax
|
* @return bool True if call is Ajax
|
||||||
* @deprecated use `$this->request->is('ajax')` instead.
|
* @deprecated use `$this->request->is('ajax')` instead.
|
||||||
*/
|
*/
|
||||||
public function isAjax() {
|
public function isAjax() {
|
||||||
|
@ -301,7 +301,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current HTTP request is coming from a Flash-based client
|
* Returns true if the current HTTP request is coming from a Flash-based client
|
||||||
*
|
*
|
||||||
* @return boolean True if call is from Flash
|
* @return bool True if call is from Flash
|
||||||
* @deprecated use `$this->request->is('flash')` instead.
|
* @deprecated use `$this->request->is('flash')` instead.
|
||||||
*/
|
*/
|
||||||
public function isFlash() {
|
public function isFlash() {
|
||||||
|
@ -311,7 +311,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current request is over HTTPS, false otherwise.
|
* Returns true if the current request is over HTTPS, false otherwise.
|
||||||
*
|
*
|
||||||
* @return boolean True if call is over HTTPS
|
* @return bool True if call is over HTTPS
|
||||||
* @deprecated use `$this->request->is('ssl')` instead.
|
* @deprecated use `$this->request->is('ssl')` instead.
|
||||||
*/
|
*/
|
||||||
public function isSSL() {
|
public function isSSL() {
|
||||||
|
@ -321,7 +321,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current call accepts an XML response, false otherwise
|
* Returns true if the current call accepts an XML response, false otherwise
|
||||||
*
|
*
|
||||||
* @return boolean True if client accepts an XML response
|
* @return bool True if client accepts an XML response
|
||||||
*/
|
*/
|
||||||
public function isXml() {
|
public function isXml() {
|
||||||
return $this->prefers('xml');
|
return $this->prefers('xml');
|
||||||
|
@ -330,7 +330,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current call accepts an RSS response, false otherwise
|
* Returns true if the current call accepts an RSS response, false otherwise
|
||||||
*
|
*
|
||||||
* @return boolean True if client accepts an RSS response
|
* @return bool True if client accepts an RSS response
|
||||||
*/
|
*/
|
||||||
public function isRss() {
|
public function isRss() {
|
||||||
return $this->prefers('rss');
|
return $this->prefers('rss');
|
||||||
|
@ -339,7 +339,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current call accepts an Atom response, false otherwise
|
* Returns true if the current call accepts an Atom response, false otherwise
|
||||||
*
|
*
|
||||||
* @return boolean True if client accepts an RSS response
|
* @return bool True if client accepts an RSS response
|
||||||
*/
|
*/
|
||||||
public function isAtom() {
|
public function isAtom() {
|
||||||
return $this->prefers('atom');
|
return $this->prefers('atom');
|
||||||
|
@ -349,7 +349,7 @@ class RequestHandlerComponent extends Component {
|
||||||
* Returns true if user agent string matches a mobile web browser, or if the
|
* Returns true if user agent string matches a mobile web browser, or if the
|
||||||
* client accepts WAP content.
|
* client accepts WAP content.
|
||||||
*
|
*
|
||||||
* @return boolean True if user agent is a mobile web browser
|
* @return bool True if user agent is a mobile web browser
|
||||||
*/
|
*/
|
||||||
public function isMobile() {
|
public function isMobile() {
|
||||||
return $this->request->is('mobile') || $this->accepts('wap');
|
return $this->request->is('mobile') || $this->accepts('wap');
|
||||||
|
@ -358,7 +358,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the client accepts WAP content
|
* Returns true if the client accepts WAP content
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isWap() {
|
public function isWap() {
|
||||||
return $this->prefers('wap');
|
return $this->prefers('wap');
|
||||||
|
@ -367,7 +367,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current call a POST request
|
* Returns true if the current call a POST request
|
||||||
*
|
*
|
||||||
* @return boolean True if call is a POST
|
* @return bool True if call is a POST
|
||||||
* @deprecated Use $this->request->is('post'); from your controller.
|
* @deprecated Use $this->request->is('post'); from your controller.
|
||||||
*/
|
*/
|
||||||
public function isPost() {
|
public function isPost() {
|
||||||
|
@ -377,7 +377,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current call a PUT request
|
* Returns true if the current call a PUT request
|
||||||
*
|
*
|
||||||
* @return boolean True if call is a PUT
|
* @return bool True if call is a PUT
|
||||||
* @deprecated Use $this->request->is('put'); from your controller.
|
* @deprecated Use $this->request->is('put'); from your controller.
|
||||||
*/
|
*/
|
||||||
public function isPut() {
|
public function isPut() {
|
||||||
|
@ -387,7 +387,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current call a GET request
|
* Returns true if the current call a GET request
|
||||||
*
|
*
|
||||||
* @return boolean True if call is a GET
|
* @return bool True if call is a GET
|
||||||
* @deprecated Use $this->request->is('get'); from your controller.
|
* @deprecated Use $this->request->is('get'); from your controller.
|
||||||
*/
|
*/
|
||||||
public function isGet() {
|
public function isGet() {
|
||||||
|
@ -397,7 +397,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns true if the current call a DELETE request
|
* Returns true if the current call a DELETE request
|
||||||
*
|
*
|
||||||
* @return boolean True if call is a DELETE
|
* @return bool True if call is a DELETE
|
||||||
* @deprecated Use $this->request->is('delete'); from your controller.
|
* @deprecated Use $this->request->is('delete'); from your controller.
|
||||||
*/
|
*/
|
||||||
public function isDelete() {
|
public function isDelete() {
|
||||||
|
@ -408,7 +408,7 @@ class RequestHandlerComponent extends Component {
|
||||||
* Gets Prototype version if call is Ajax, otherwise empty string.
|
* Gets Prototype version if call is Ajax, otherwise empty string.
|
||||||
* The Prototype library sets a special "Prototype version" HTTP header.
|
* The Prototype library sets a special "Prototype version" HTTP header.
|
||||||
*
|
*
|
||||||
* @return string|boolean When Ajax the prototype version of component making the call otherwise false
|
* @return string|bool When Ajax the prototype version of component making the call otherwise false
|
||||||
*/
|
*/
|
||||||
public function getAjaxVersion() {
|
public function getAjaxVersion() {
|
||||||
$httpX = env('HTTP_X_PROTOTYPE_VERSION');
|
$httpX = env('HTTP_X_PROTOTYPE_VERSION');
|
||||||
|
@ -444,7 +444,7 @@ class RequestHandlerComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Gets remote client IP
|
* Gets remote client IP
|
||||||
*
|
*
|
||||||
* @param boolean $safe Use safe = false when you think the user might manipulate
|
* @param bool $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
|
* their HTTP_CLIENT_IP header. Setting $safe = false will also look at HTTP_X_FORWARDED_FOR
|
||||||
* @return string Client IP address
|
* @return string Client IP address
|
||||||
* @deprecated use $this->request->clientIp() from your, controller instead.
|
* @deprecated use $this->request->clientIp() from your, controller instead.
|
||||||
|
@ -659,7 +659,7 @@ class RequestHandlerComponent extends Component {
|
||||||
* like 'application/x-shockwave'.
|
* like 'application/x-shockwave'.
|
||||||
* @param array $options If $type is a friendly type name that is associated with
|
* @param array $options If $type is a friendly type name that is associated with
|
||||||
* more than one type of content, $index is used to select which content-type to use.
|
* more than one type of content, $index is used to select which content-type to use.
|
||||||
* @return boolean Returns false if the friendly type name given in $type does
|
* @return bool Returns false if the friendly type name given in $type does
|
||||||
* not exist in the type map, or if the Content-type header has
|
* not exist in the type map, or if the Content-type header has
|
||||||
* already been set by this method.
|
* already been set by this method.
|
||||||
* @see RequestHandlerComponent::setContent()
|
* @see RequestHandlerComponent::setContent()
|
||||||
|
|
|
@ -145,14 +145,14 @@ class SecurityComponent extends Component {
|
||||||
* Whether to validate POST data. Set to false to disable for data coming from 3rd party
|
* Whether to validate POST data. Set to false to disable for data coming from 3rd party
|
||||||
* services, etc.
|
* services, etc.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $validatePost = true;
|
public $validatePost = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to use CSRF protected forms. Set to false to disable CSRF protection on forms.
|
* Whether to use CSRF protected forms. Set to false to disable CSRF protection on forms.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
* @see http://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
|
* @see http://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
|
||||||
* @see SecurityComponent::$csrfExpires
|
* @see SecurityComponent::$csrfExpires
|
||||||
*/
|
*/
|
||||||
|
@ -173,7 +173,7 @@ class SecurityComponent extends Component {
|
||||||
* the chances of users getting invalid requests because of token consumption.
|
* the chances of users getting invalid requests because of token consumption.
|
||||||
* It has the side effect of making CSRF less secure, as tokens are reusable.
|
* It has the side effect of making CSRF less secure, as tokens are reusable.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $csrfUseOnce = true;
|
public $csrfUseOnce = true;
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ class SecurityComponent extends Component {
|
||||||
* When tokens are evicted, the oldest ones will be removed, as they are the most likely
|
* When tokens are evicted, the oldest ones will be removed, as they are the most likely
|
||||||
* to be dead/expired.
|
* to be dead/expired.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $csrfLimit = 100;
|
public $csrfLimit = 100;
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ class SecurityComponent extends Component {
|
||||||
* Check if HTTP methods are required
|
* Check if HTTP methods are required
|
||||||
*
|
*
|
||||||
* @param Controller $controller Instantiating controller
|
* @param Controller $controller Instantiating controller
|
||||||
* @return boolean true if $method is required
|
* @return bool true if $method is required
|
||||||
*/
|
*/
|
||||||
protected function _methodsRequired(Controller $controller) {
|
protected function _methodsRequired(Controller $controller) {
|
||||||
foreach (array('Post', 'Get', 'Put', 'Delete') as $method) {
|
foreach (array('Post', 'Get', 'Put', 'Delete') as $method) {
|
||||||
|
@ -378,7 +378,7 @@ class SecurityComponent extends Component {
|
||||||
* Check if access requires secure connection
|
* Check if access requires secure connection
|
||||||
*
|
*
|
||||||
* @param Controller $controller Instantiating controller
|
* @param Controller $controller Instantiating controller
|
||||||
* @return boolean true if secure connection required
|
* @return bool true if secure connection required
|
||||||
*/
|
*/
|
||||||
protected function _secureRequired(Controller $controller) {
|
protected function _secureRequired(Controller $controller) {
|
||||||
if (is_array($this->requireSecure) && !empty($this->requireSecure)) {
|
if (is_array($this->requireSecure) && !empty($this->requireSecure)) {
|
||||||
|
@ -399,7 +399,7 @@ class SecurityComponent extends Component {
|
||||||
* Check if authentication is required
|
* Check if authentication is required
|
||||||
*
|
*
|
||||||
* @param Controller $controller Instantiating controller
|
* @param Controller $controller Instantiating controller
|
||||||
* @return boolean true if authentication required
|
* @return bool true if authentication required
|
||||||
*/
|
*/
|
||||||
protected function _authRequired(Controller $controller) {
|
protected function _authRequired(Controller $controller) {
|
||||||
if (is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($this->request->data)) {
|
if (is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($this->request->data)) {
|
||||||
|
@ -439,7 +439,7 @@ class SecurityComponent extends Component {
|
||||||
* Validate submitted form
|
* Validate submitted form
|
||||||
*
|
*
|
||||||
* @param Controller $controller Instantiating controller
|
* @param Controller $controller Instantiating controller
|
||||||
* @return boolean true if submitted form is valid
|
* @return bool true if submitted form is valid
|
||||||
*/
|
*/
|
||||||
protected function _validatePost(Controller $controller) {
|
protected function _validatePost(Controller $controller) {
|
||||||
if (empty($controller->request->data)) {
|
if (empty($controller->request->data)) {
|
||||||
|
@ -524,7 +524,7 @@ class SecurityComponent extends Component {
|
||||||
* Manually add CSRF token information into the provided request object.
|
* Manually add CSRF token information into the provided request object.
|
||||||
*
|
*
|
||||||
* @param CakeRequest $request The request object to add into.
|
* @param CakeRequest $request The request object to add into.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function generateToken(CakeRequest $request) {
|
public function generateToken(CakeRequest $request) {
|
||||||
if (isset($request->params['requested']) && $request->params['requested'] === 1) {
|
if (isset($request->params['requested']) && $request->params['requested'] === 1) {
|
||||||
|
@ -570,7 +570,7 @@ class SecurityComponent extends Component {
|
||||||
* it will be removed from the list of valid tokens.
|
* it will be removed from the list of valid tokens.
|
||||||
*
|
*
|
||||||
* @param Controller $controller A controller to check
|
* @param Controller $controller A controller to check
|
||||||
* @return boolean Valid csrf token.
|
* @return bool Valid csrf token.
|
||||||
*/
|
*/
|
||||||
protected function _validateCsrf(Controller $controller) {
|
protected function _validateCsrf(Controller $controller) {
|
||||||
$token = $this->Session->read('_Token');
|
$token = $this->Session->read('_Token');
|
||||||
|
|
|
@ -48,7 +48,7 @@ class SessionComponent extends Component {
|
||||||
* @param string $name The name of the key your are setting in the session.
|
* @param string $name The name of the key your are setting in the session.
|
||||||
* This should be in a Controller.key format for better organizing
|
* This should be in a Controller.key format for better organizing
|
||||||
* @param string $value The value you want to store in a session.
|
* @param string $value The value you want to store in a session.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::write
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::write
|
||||||
*/
|
*/
|
||||||
public function write($name, $value = null) {
|
public function write($name, $value = null) {
|
||||||
|
@ -75,7 +75,7 @@ class SessionComponent extends Component {
|
||||||
* In your controller: $this->Session->delete('Controller.sessKey');
|
* In your controller: $this->Session->delete('Controller.sessKey');
|
||||||
*
|
*
|
||||||
* @param string $name the name of the session key you want to delete
|
* @param string $name the name of the session key you want to delete
|
||||||
* @return boolean true is session variable is set and can be deleted, false is variable was not set.
|
* @return bool true is session variable is set and can be deleted, false is variable was not set.
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::delete
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::delete
|
||||||
*/
|
*/
|
||||||
public function delete($name) {
|
public function delete($name) {
|
||||||
|
@ -88,7 +88,7 @@ class SessionComponent extends Component {
|
||||||
* In your controller: $this->Session->check('Controller.sessKey');
|
* In your controller: $this->Session->check('Controller.sessKey');
|
||||||
*
|
*
|
||||||
* @param string $name the name of the session key you want to check
|
* @param string $name the name of the session key you want to check
|
||||||
* @return boolean true is session variable is set, false if not
|
* @return bool true is session variable is set, false if not
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::check
|
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::check
|
||||||
*/
|
*/
|
||||||
public function check($name) {
|
public function check($name) {
|
||||||
|
@ -142,7 +142,7 @@ class SessionComponent extends Component {
|
||||||
*
|
*
|
||||||
* In your controller: $this->Session->valid();
|
* In your controller: $this->Session->valid();
|
||||||
*
|
*
|
||||||
* @return boolean true is session is valid, false is session is invalid
|
* @return bool true is session is valid, false is session is invalid
|
||||||
*/
|
*/
|
||||||
public function valid() {
|
public function valid() {
|
||||||
return CakeSession::valid();
|
return CakeSession::valid();
|
||||||
|
@ -180,7 +180,7 @@ class SessionComponent extends Component {
|
||||||
/**
|
/**
|
||||||
* Returns a bool, whether or not the session has been started.
|
* Returns a bool, whether or not the session has been started.
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function started() {
|
public function started() {
|
||||||
return CakeSession::started();
|
return CakeSession::started();
|
||||||
|
|
|
@ -79,7 +79,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* The default value is `true`.
|
* The default value is `true`.
|
||||||
*
|
*
|
||||||
* @var mixed A single name as a string or a list of names as an array.
|
* @var mixed
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#components-helpers-and-uses
|
* @link http://book.cakephp.org/2.0/en/controllers.html#components-helpers-and-uses
|
||||||
*/
|
*/
|
||||||
public $uses = true;
|
public $uses = true;
|
||||||
|
@ -90,7 +90,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* Example: `public $helpers = array('Html', 'Js', 'Time', 'Ajax');`
|
* Example: `public $helpers = array('Html', 'Js', 'Time', 'Ajax');`
|
||||||
*
|
*
|
||||||
* @var mixed A single name as a string or a list of names as an array.
|
* @var mixed
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#components-helpers-and-uses
|
* @link http://book.cakephp.org/2.0/en/controllers.html#components-helpers-and-uses
|
||||||
*/
|
*/
|
||||||
public $helpers = array();
|
public $helpers = array();
|
||||||
|
@ -162,14 +162,14 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Set to true to automatically render the view
|
* Set to true to automatically render the view
|
||||||
* after action logic.
|
* after action logic.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $autoRender = true;
|
public $autoRender = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true to automatically render the layout around views.
|
* Set to true to automatically render the layout around views.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $autoLayout = true;
|
public $autoLayout = true;
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
/**
|
/**
|
||||||
* Holds any validation errors produced by the last call of the validateErrors() method.
|
* Holds any validation errors produced by the last call of the validateErrors() method.
|
||||||
*
|
*
|
||||||
* @var array Validation errors, or false if none
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $validationErrors = null;
|
public $validationErrors = null;
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Lazy loads models using the loadModel() method if declared in $uses
|
* Lazy loads models using the loadModel() method if declared in $uses
|
||||||
*
|
*
|
||||||
* @param string $name Property name to check.
|
* @param string $name Property name to check.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function __isset($name) {
|
public function __isset($name) {
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
|
@ -506,7 +506,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* @param ReflectionMethod $method The method to be invoked.
|
* @param ReflectionMethod $method The method to be invoked.
|
||||||
* @param CakeRequest $request The request to check.
|
* @param CakeRequest $request The request to check.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function _isPrivateAction(ReflectionMethod $method, CakeRequest $request) {
|
protected function _isPrivateAction(ReflectionMethod $method, CakeRequest $request) {
|
||||||
$privateAction = (
|
$privateAction = (
|
||||||
|
@ -691,7 +691,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
/**
|
/**
|
||||||
* Queries & sets valid HTTP response codes & messages.
|
* Queries & sets valid HTTP response codes & messages.
|
||||||
*
|
*
|
||||||
* @param integer|array $code If $code is an integer, then the corresponding code/message is
|
* @param int|array $code If $code is an integer, then the corresponding code/message is
|
||||||
* returned if it exists, null if it does not exist. If $code is an array,
|
* returned if it exists, null if it does not exist. If $code is an array,
|
||||||
* then the 'code' and 'message' keys of each nested array are added to the default
|
* then the 'code' and 'message' keys of each nested array are added to the default
|
||||||
* HTTP codes. Example:
|
* HTTP codes. Example:
|
||||||
|
@ -717,8 +717,8 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* dynamic models for the time being.
|
* dynamic models for the time being.
|
||||||
*
|
*
|
||||||
* @param string $modelClass Name of model class to load
|
* @param string $modelClass Name of model class to load
|
||||||
* @param integer|string $id Initial ID the instanced model class should have
|
* @param int|string $id Initial ID the instanced model class should have
|
||||||
* @return boolean True if the model was found
|
* @return bool True if the model was found
|
||||||
* @throws MissingModelException if the model class cannot be found.
|
* @throws MissingModelException if the model class cannot be found.
|
||||||
*/
|
*/
|
||||||
public function loadModel($modelClass = null, $id = null) {
|
public function loadModel($modelClass = null, $id = null) {
|
||||||
|
@ -748,8 +748,8 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* @param string|array $url A string or array-based URL pointing to another location within the app,
|
* @param string|array $url A string or array-based URL pointing to another location within the app,
|
||||||
* or an absolute URL
|
* or an absolute URL
|
||||||
* @param integer $status Optional HTTP status code (eg: 404)
|
* @param int $status Optional HTTP status code (eg: 404)
|
||||||
* @param boolean $exit If true, exit() will be called after the redirect
|
* @param bool $exit If true, exit() will be called after the redirect
|
||||||
* @return void
|
* @return void
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::redirect
|
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::redirect
|
||||||
*/
|
*/
|
||||||
|
@ -796,8 +796,8 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* @param mixed $response Response from beforeRedirect callback
|
* @param mixed $response Response from beforeRedirect callback
|
||||||
* @param string|array $url The same value of beforeRedirect
|
* @param string|array $url The same value of beforeRedirect
|
||||||
* @param integer $status The same value of beforeRedirect
|
* @param int $status The same value of beforeRedirect
|
||||||
* @param boolean $exit The same value of beforeRedirect
|
* @param bool $exit The same value of beforeRedirect
|
||||||
* @return array Array with keys url, status and exit
|
* @return array Array with keys url, status and exit
|
||||||
*/
|
*/
|
||||||
protected function _parseBeforeRedirect($response, $url, $status, $exit) {
|
protected function _parseBeforeRedirect($response, $url, $status, $exit) {
|
||||||
|
@ -873,7 +873,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
/**
|
/**
|
||||||
* Returns number of errors in a submitted FORM.
|
* Returns number of errors in a submitted FORM.
|
||||||
*
|
*
|
||||||
* @return integer Number of errors
|
* @return int Number of errors
|
||||||
* @deprecated This method will be removed in 3.0
|
* @deprecated This method will be removed in 3.0
|
||||||
*/
|
*/
|
||||||
public function validate() {
|
public function validate() {
|
||||||
|
@ -959,7 +959,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Returns the referring URL for this request.
|
* Returns the referring URL for this request.
|
||||||
*
|
*
|
||||||
* @param string $default Default URL to use if HTTP_REFERER cannot be read from headers
|
* @param string $default Default URL to use if HTTP_REFERER cannot be read from headers
|
||||||
* @param boolean $local If true, restrict referring URLs to local server
|
* @param bool $local If true, restrict referring URLs to local server
|
||||||
* @return string Referring URL
|
* @return string Referring URL
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::referer
|
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::referer
|
||||||
*/
|
*/
|
||||||
|
@ -993,7 +993,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* @param string $message Message to display to the user
|
* @param string $message Message to display to the user
|
||||||
* @param string|array $url Relative string or array-based URL to redirect to after the time expires
|
* @param string|array $url Relative string or array-based URL to redirect to after the time expires
|
||||||
* @param integer $pause Time to show the message
|
* @param int $pause Time to show the message
|
||||||
* @param string $layout Layout you want to use, defaults to 'flash'
|
* @param string $layout Layout you want to use, defaults to 'flash'
|
||||||
* @return void
|
* @return void
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::flash
|
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::flash
|
||||||
|
@ -1015,7 +1015,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* @param string|array $op A string containing an SQL comparison operator, or an array matching operators
|
* @param string|array $op A string containing an SQL comparison operator, or an array matching operators
|
||||||
* to fields
|
* to fields
|
||||||
* @param string $bool SQL boolean operator: AND, OR, XOR, etc.
|
* @param string $bool SQL boolean operator: AND, OR, XOR, etc.
|
||||||
* @param boolean $exclusive If true, and $op is an array, fields not included in $op will not be
|
* @param bool $exclusive If true, and $op is an array, fields not included in $op will not be
|
||||||
* included in the returned conditions
|
* included in the returned conditions
|
||||||
* @return array An array of model conditions
|
* @return array An array of model conditions
|
||||||
* @deprecated Will be removed in 3.0.
|
* @deprecated Will be removed in 3.0.
|
||||||
|
@ -1111,8 +1111,8 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* @param string|array $url A string or array-based URL pointing to another location within the app,
|
* @param string|array $url A string or array-based URL pointing to another location within the app,
|
||||||
* or an absolute URL
|
* or an absolute URL
|
||||||
* @param integer $status Optional HTTP status code (eg: 404)
|
* @param int $status Optional HTTP status code (eg: 404)
|
||||||
* @param boolean $exit If true, exit() will be called after the redirect
|
* @param bool $exit If true, exit() will be called after the redirect
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* false to stop redirection event,
|
* false to stop redirection event,
|
||||||
* string controllers a new redirection URL or
|
* string controllers a new redirection URL or
|
||||||
|
@ -1135,7 +1135,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* This method should be overridden in child classes.
|
* This method should be overridden in child classes.
|
||||||
*
|
*
|
||||||
* @param string $method name of method called example index, edit, etc.
|
* @param string $method name of method called example index, edit, etc.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
||||||
*/
|
*/
|
||||||
public function beforeScaffold($method) {
|
public function beforeScaffold($method) {
|
||||||
|
@ -1146,7 +1146,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Alias to beforeScaffold()
|
* Alias to beforeScaffold()
|
||||||
*
|
*
|
||||||
* @param string $method Method name.
|
* @param string $method Method name.
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @see Controller::beforeScaffold()
|
* @see Controller::beforeScaffold()
|
||||||
* @deprecated Will be removed in 3.0.
|
* @deprecated Will be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
|
@ -1158,7 +1158,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* This method should be overridden in child classes.
|
* This method should be overridden in child classes.
|
||||||
*
|
*
|
||||||
* @param string $method name of method called either edit or update.
|
* @param string $method name of method called either edit or update.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
||||||
*/
|
*/
|
||||||
public function afterScaffoldSave($method) {
|
public function afterScaffoldSave($method) {
|
||||||
|
@ -1169,7 +1169,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Alias to afterScaffoldSave()
|
* Alias to afterScaffoldSave()
|
||||||
*
|
*
|
||||||
* @param string $method Method name.
|
* @param string $method Method name.
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @see Controller::afterScaffoldSave()
|
* @see Controller::afterScaffoldSave()
|
||||||
* @deprecated Will be removed in 3.0.
|
* @deprecated Will be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
|
@ -1181,7 +1181,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* This method should be overridden in child classes.
|
* This method should be overridden in child classes.
|
||||||
*
|
*
|
||||||
* @param string $method name of method called either edit or update.
|
* @param string $method name of method called either edit or update.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
||||||
*/
|
*/
|
||||||
public function afterScaffoldSaveError($method) {
|
public function afterScaffoldSaveError($method) {
|
||||||
|
@ -1192,7 +1192,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Alias to afterScaffoldSaveError()
|
* Alias to afterScaffoldSaveError()
|
||||||
*
|
*
|
||||||
* @param string $method Method name.
|
* @param string $method Method name.
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @see Controller::afterScaffoldSaveError()
|
* @see Controller::afterScaffoldSaveError()
|
||||||
* @deprecated Will be removed in 3.0.
|
* @deprecated Will be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
|
@ -1206,7 +1206,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Method MUST return true in child classes
|
* Method MUST return true in child classes
|
||||||
*
|
*
|
||||||
* @param string $method name of method called example index, edit, etc.
|
* @param string $method name of method called example index, edit, etc.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
* @link http://book.cakephp.org/2.0/en/controllers.html#callbacks
|
||||||
*/
|
*/
|
||||||
public function scaffoldError($method) {
|
public function scaffoldError($method) {
|
||||||
|
@ -1217,7 +1217,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* Alias to scaffoldError()
|
* Alias to scaffoldError()
|
||||||
*
|
*
|
||||||
* @param string $method Method name.
|
* @param string $method Method name.
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @see Controller::scaffoldError()
|
* @see Controller::scaffoldError()
|
||||||
* @deprecated Will be removed in 3.0.
|
* @deprecated Will be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -76,7 +76,7 @@ class Scaffold {
|
||||||
/**
|
/**
|
||||||
* Valid session.
|
* Valid session.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_validSession = null;
|
protected $_validSession = null;
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ class App {
|
||||||
/**
|
/**
|
||||||
* Reset paths instead of merging
|
* Reset paths instead of merging
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
const RESET = true;
|
const RESET = true;
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ class App {
|
||||||
/**
|
/**
|
||||||
* Whether or not to return the file that is loaded.
|
* Whether or not to return the file that is loaded.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public static $return = false;
|
public static $return = false;
|
||||||
|
|
||||||
|
@ -184,14 +184,14 @@ class App {
|
||||||
/**
|
/**
|
||||||
* Indicates whether the class cache should be stored again because of an addition to it
|
* Indicates whether the class cache should be stored again because of an addition to it
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected static $_cacheChange = false;
|
protected static $_cacheChange = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the object cache should be stored again because of an addition to it
|
* Indicates whether the object cache should be stored again because of an addition to it
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected static $_objectCacheChange = false;
|
protected static $_objectCacheChange = false;
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ class App {
|
||||||
* Indicates the the Application is in the bootstrapping process. Used to better cache
|
* Indicates the the Application is in the bootstrapping process. Used to better cache
|
||||||
* loaded classes while the cache libraries have not been yet initialized
|
* loaded classes while the cache libraries have not been yet initialized
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public static $bootstrapping = false;
|
public static $bootstrapping = false;
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ class App {
|
||||||
* If reset is set to true, all loaded plugins will be forgotten and they will be needed to be loaded again.
|
* If reset is set to true, all loaded plugins will be forgotten and they will be needed to be loaded again.
|
||||||
*
|
*
|
||||||
* @param array $paths associative array with package names as keys and a list of directories for new search paths
|
* @param array $paths associative array with package names as keys and a list of directories for new search paths
|
||||||
* @param boolean|string $mode App::RESET will set paths, App::APPEND with append paths, App::PREPEND will prepend paths (default)
|
* @param bool|string $mode App::RESET will set paths, App::APPEND with append paths, App::PREPEND will prepend paths (default)
|
||||||
* App::REGISTER will register new packages and their paths, %s in path will be replaced by APP path
|
* App::REGISTER will register new packages and their paths, %s in path will be replaced by APP path
|
||||||
* @return void
|
* @return void
|
||||||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::build
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::build
|
||||||
|
@ -422,7 +422,7 @@ class App {
|
||||||
*
|
*
|
||||||
* @param string $type Type of object, i.e. 'Model', 'Controller', 'View/Helper', 'file', 'class' or 'plugin'
|
* @param string $type Type of object, i.e. 'Model', 'Controller', 'View/Helper', 'file', 'class' or 'plugin'
|
||||||
* @param string|array $path Optional Scan only the path given. If null, paths for the chosen type will be used.
|
* @param string|array $path Optional Scan only the path given. If null, paths for the chosen type will be used.
|
||||||
* @param boolean $cache Set to false to rescan objects of the chosen type. Defaults to true.
|
* @param bool $cache Set to false to rescan objects of the chosen type. Defaults to true.
|
||||||
* @return mixed Either false on incorrect / miss. Or an array of found objects.
|
* @return mixed Either false on incorrect / miss. Or an array of found objects.
|
||||||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::objects
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::objects
|
||||||
*/
|
*/
|
||||||
|
@ -529,7 +529,7 @@ class App {
|
||||||
* if a class is name `MyCustomClass` the file name should be `MyCustomClass.php`
|
* if a class is name `MyCustomClass` the file name should be `MyCustomClass.php`
|
||||||
*
|
*
|
||||||
* @param string $className the name of the class to load
|
* @param string $className the name of the class to load
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function load($className) {
|
public static function load($className) {
|
||||||
if (!isset(self::$_classMap[$className])) {
|
if (!isset(self::$_classMap[$className])) {
|
||||||
|
@ -592,15 +592,15 @@ class App {
|
||||||
* @param string|array $type The type of Class if passed as a string, or all params can be passed as
|
* @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 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
|
* @param bool|array $parent boolean true if Class Parent should be searched, accepts key => value
|
||||||
* array('parent' => $parent, 'file' => $file, 'search' => $search, 'ext' => '$ext');
|
* array('parent' => $parent, 'file' => $file, 'search' => $search, 'ext' => '$ext');
|
||||||
* $ext allows setting the extension of the file name
|
* $ext allows setting the extension of the file name
|
||||||
* based on Inflector::underscore($name) . ".$ext";
|
* based on Inflector::underscore($name) . ".$ext";
|
||||||
* @param array $search paths to search for files, array('path 1', 'path 2', 'path 3');
|
* @param array $search paths to search for files, array('path 1', 'path 2', 'path 3');
|
||||||
* @param string $file full name of the file to search for including extension
|
* @param string $file full name of the file to search for including extension
|
||||||
* @param boolean $return Return the loaded file, the file must have a return
|
* @param bool $return Return the loaded file, the file must have a return
|
||||||
* statement in it to work: return $variable;
|
* 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
|
* @return bool 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
|
* @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) {
|
public static function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) {
|
||||||
|
@ -662,8 +662,8 @@ class App {
|
||||||
* @param string $plugin camel cased plugin name if any
|
* @param string $plugin camel cased plugin name if any
|
||||||
* @param string $type name of the packed where the class is located
|
* @param string $type name of the packed where the class is located
|
||||||
* @param string $originalType type name as supplied initially by the user
|
* @param string $originalType type name as supplied initially by the user
|
||||||
* @param boolean $parent whether to load the class parent or not
|
* @param bool $parent whether to load the class parent or not
|
||||||
* @return boolean true indicating the successful load and existence of the class
|
* @return bool true indicating the successful load and existence of the class
|
||||||
*/
|
*/
|
||||||
protected static function _loadClass($name, $plugin, $type, $originalType, $parent) {
|
protected static function _loadClass($name, $plugin, $type, $originalType, $parent) {
|
||||||
if ($type === 'Console/Command' && $name === 'Shell') {
|
if ($type === 'Console/Command' && $name === 'Shell') {
|
||||||
|
@ -700,7 +700,7 @@ class App {
|
||||||
* @param string $plugin camel cased plugin name if any
|
* @param string $plugin camel cased plugin name if any
|
||||||
* @param array $search list of paths to search the file into
|
* @param array $search list of paths to search the file into
|
||||||
* @param string $file filename if known, the $name param will be used otherwise
|
* @param string $file filename if known, the $name param will be used otherwise
|
||||||
* @param boolean $return whether this function should return the contents of the file after being parsed by php or just a success notice
|
* @param bool $return whether this function should return the contents of the file after being parsed by php or just a success notice
|
||||||
* @return mixed if $return contents of the file after php parses it, boolean indicating success otherwise
|
* @return mixed if $return contents of the file after php parses it, boolean indicating success otherwise
|
||||||
*/
|
*/
|
||||||
protected static function _loadFile($name, $plugin, $search, $file, $return) {
|
protected static function _loadFile($name, $plugin, $search, $file, $return) {
|
||||||
|
@ -738,7 +738,7 @@ class App {
|
||||||
* @param string $plugin camel cased plugin name if any
|
* @param string $plugin camel cased plugin name if any
|
||||||
* @param string $file file name if known
|
* @param string $file file name if known
|
||||||
* @param string $ext file extension if known
|
* @param string $ext file extension if known
|
||||||
* @return boolean true if the file was loaded successfully, false otherwise
|
* @return bool true if the file was loaded successfully, false otherwise
|
||||||
*/
|
*/
|
||||||
protected static function _loadVendor($name, $plugin, $file, $ext) {
|
protected static function _loadVendor($name, $plugin, $file, $ext) {
|
||||||
if ($mapped = self::_mapped($name, $plugin)) {
|
if ($mapped = self::_mapped($name, $plugin)) {
|
||||||
|
|
|
@ -183,7 +183,7 @@ class CakePlugin {
|
||||||
*
|
*
|
||||||
* @param string $plugin name of the plugin, if null will operate on all plugins having enabled the
|
* @param string $plugin name of the plugin, if null will operate on all plugins having enabled the
|
||||||
* loading of routes files
|
* loading of routes files
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function routes($plugin = null) {
|
public static function routes($plugin = null) {
|
||||||
if ($plugin === null) {
|
if ($plugin === null) {
|
||||||
|
@ -237,7 +237,7 @@ class CakePlugin {
|
||||||
* Include file, ignoring include error if needed if file is missing
|
* Include file, ignoring include error if needed if file is missing
|
||||||
*
|
*
|
||||||
* @param string $file File to include
|
* @param string $file File to include
|
||||||
* @param boolean $ignoreMissing Whether to ignore include error for missing files
|
* @param bool $ignoreMissing Whether to ignore include error for missing files
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected static function _includeFile($file, $ignoreMissing = false) {
|
protected static function _includeFile($file, $ignoreMissing = false) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ class Configure {
|
||||||
* - Include app/Config/bootstrap.php.
|
* - Include app/Config/bootstrap.php.
|
||||||
* - Setup error/exception handlers.
|
* - Setup error/exception handlers.
|
||||||
*
|
*
|
||||||
* @param boolean $boot Whether to do bootstrapping.
|
* @param bool $boot Whether to do bootstrapping.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function bootstrap($boot = true) {
|
public static function bootstrap($boot = true) {
|
||||||
|
@ -147,7 +147,7 @@ class Configure {
|
||||||
* @param string|array $config The key to write, can be a dot notation value.
|
* @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).
|
* Alternatively can be an array containing key(s) and value(s).
|
||||||
* @param mixed $value Value to set for var
|
* @param mixed $value Value to set for var
|
||||||
* @return boolean True if write was successful
|
* @return bool True if write was successful
|
||||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::write
|
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::write
|
||||||
*/
|
*/
|
||||||
public static function write($config, $value = null) {
|
public static function write($config, $value = null) {
|
||||||
|
@ -194,7 +194,7 @@ class Configure {
|
||||||
* Returns true if given variable is set in Configure.
|
* Returns true if given variable is set in Configure.
|
||||||
*
|
*
|
||||||
* @param string $var Variable name to check for
|
* @param string $var Variable name to check for
|
||||||
* @return boolean True if variable is there
|
* @return bool True if variable is there
|
||||||
*/
|
*/
|
||||||
public static function check($var = null) {
|
public static function check($var = null) {
|
||||||
if (empty($var)) {
|
if (empty($var)) {
|
||||||
|
@ -256,7 +256,7 @@ class Configure {
|
||||||
* and make any future attempts to use it cause an Exception.
|
* and make any future attempts to use it cause an Exception.
|
||||||
*
|
*
|
||||||
* @param string $name Name of the reader to drop.
|
* @param string $name Name of the reader to drop.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public static function drop($name) {
|
public static function drop($name) {
|
||||||
if (!isset(self::$_readers[$name])) {
|
if (!isset(self::$_readers[$name])) {
|
||||||
|
@ -286,8 +286,8 @@ class Configure {
|
||||||
*
|
*
|
||||||
* @param string $key name of configuration resource to 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 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
|
* @param bool $merge if config files should be merged instead of simply overridden
|
||||||
* @return boolean False if file not found, true if load successful.
|
* @return bool False if file not found, true if load successful.
|
||||||
* @throws ConfigureException Will throw any exceptions the reader raises.
|
* @throws ConfigureException Will throw any exceptions the reader raises.
|
||||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::load
|
* @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::load
|
||||||
*/
|
*/
|
||||||
|
@ -332,7 +332,7 @@ class Configure {
|
||||||
* @param string $config The name of the configured adapter to dump data with.
|
* @param string $config The name of the configured adapter to dump data with.
|
||||||
* @param array $keys The name of the top-level keys you want to dump.
|
* @param array $keys The name of the top-level keys you want to dump.
|
||||||
* This allows you save only some data stored in Configure.
|
* This allows you save only some data stored in Configure.
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
* @throws ConfigureException if the adapter does not implement a `dump` method.
|
* @throws ConfigureException if the adapter does not implement a `dump` method.
|
||||||
*/
|
*/
|
||||||
public static function dump($key, $config = 'default', $keys = array()) {
|
public static function dump($key, $config = 'default', $keys = array()) {
|
||||||
|
@ -391,7 +391,7 @@ class Configure {
|
||||||
* @param string $name The storage name for the saved configuration.
|
* @param string $name The storage name for the saved configuration.
|
||||||
* @param string $cacheConfig The cache configuration to save into. Defaults to 'default'
|
* @param string $cacheConfig The cache configuration to save into. Defaults to 'default'
|
||||||
* @param array $data Either an array of data to store, or leave empty to store all values.
|
* @param array $data Either an array of data to store, or leave empty to store all values.
|
||||||
* @return boolean Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public static function store($name, $cacheConfig = 'default', $data = null) {
|
public static function store($name, $cacheConfig = 'default', $data = null) {
|
||||||
if ($data === null) {
|
if ($data === null) {
|
||||||
|
@ -406,7 +406,7 @@ class Configure {
|
||||||
*
|
*
|
||||||
* @param string $name Name of the stored config file to load.
|
* @param string $name Name of the stored config file to load.
|
||||||
* @param string $cacheConfig Name of the Cache configuration to read from.
|
* @param string $cacheConfig Name of the Cache configuration to read from.
|
||||||
* @return boolean Success.
|
* @return bool Success.
|
||||||
*/
|
*/
|
||||||
public static function restore($name, $cacheConfig = 'default') {
|
public static function restore($name, $cacheConfig = 'default') {
|
||||||
$values = Cache::read($name, $cacheConfig);
|
$values = Cache::read($name, $cacheConfig);
|
||||||
|
@ -419,7 +419,7 @@ class Configure {
|
||||||
/**
|
/**
|
||||||
* Clear all values stored in Configure.
|
* Clear all values stored in Configure.
|
||||||
*
|
*
|
||||||
* @return boolean success.
|
* @return bool success.
|
||||||
*/
|
*/
|
||||||
public static function clear() {
|
public static function clear() {
|
||||||
self::$_values = array();
|
self::$_values = array();
|
||||||
|
|
|
@ -139,7 +139,7 @@ class Object {
|
||||||
* Stop execution of the current script. Wraps exit() making
|
* Stop execution of the current script. Wraps exit() making
|
||||||
* testing easier.
|
* testing easier.
|
||||||
*
|
*
|
||||||
* @param integer|string $status see http://php.net/exit for values
|
* @param int|string $status see http://php.net/exit for values
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _stop($status = 0) {
|
protected function _stop($status = 0) {
|
||||||
|
@ -151,10 +151,10 @@ class Object {
|
||||||
* for more information on writing to logs.
|
* for more information on writing to logs.
|
||||||
*
|
*
|
||||||
* @param string $msg Log message
|
* @param string $msg Log message
|
||||||
* @param integer $type Error type constant. Defined in app/Config/core.php.
|
* @param int $type Error type constant. Defined in app/Config/core.php.
|
||||||
* @param null|string|array $scope The scope(s) a log message is being created in.
|
* @param null|string|array $scope The scope(s) a log message is being created in.
|
||||||
* See CakeLog::config() for more information on logging scopes.
|
* See CakeLog::config() for more information on logging scopes.
|
||||||
* @return boolean Success of log write
|
* @return bool Success of log write
|
||||||
*/
|
*/
|
||||||
public function log($msg, $type = LOG_ERR, $scope = null) {
|
public function log($msg, $type = LOG_ERR, $scope = null) {
|
||||||
if (!is_string($msg)) {
|
if (!is_string($msg)) {
|
||||||
|
@ -191,7 +191,7 @@ class Object {
|
||||||
*
|
*
|
||||||
* @param array $properties The name of the properties to merge.
|
* @param array $properties The name of the properties to merge.
|
||||||
* @param string $class The class to merge the property with.
|
* @param string $class The class to merge the property with.
|
||||||
* @param boolean $normalize Set to true to run the properties through Hash::normalize() before merging.
|
* @param bool $normalize Set to true to run the properties through Hash::normalize() before merging.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _mergeVars($properties, $class, $normalize = true) {
|
protected function _mergeVars($properties, $class, $normalize = true) {
|
||||||
|
|
|
@ -24,7 +24,6 @@ App::uses('ExceptionRenderer', 'Error');
|
||||||
App::uses('Router', 'Routing');
|
App::uses('Router', 'Routing');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Error Handler provides basic error and exception handling for your application. It captures and
|
* Error Handler provides basic error and exception handling for your application. It captures and
|
||||||
* handles all unhandled exceptions and errors. Displays helpful framework errors when debug > 1.
|
* handles all unhandled exceptions and errors. Displays helpful framework errors when debug > 1.
|
||||||
*
|
*
|
||||||
|
@ -162,7 +161,7 @@ class ErrorHandler {
|
||||||
*
|
*
|
||||||
* @param Exception $exception The exception to render.
|
* @param Exception $exception The exception to render.
|
||||||
* @param array $config An array of configuration for logging.
|
* @param array $config An array of configuration for logging.
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected static function _log(Exception $exception, $config) {
|
protected static function _log(Exception $exception, $config) {
|
||||||
if (empty($config['log'])) {
|
if (empty($config['log'])) {
|
||||||
|
@ -187,12 +186,12 @@ class ErrorHandler {
|
||||||
* You can use Configure::write('Error.level', $value); to set what type of errors will be handled here.
|
* You can use Configure::write('Error.level', $value); to set what type of errors will be handled here.
|
||||||
* Stack traces for errors can be enabled with Configure::write('Error.trace', true);
|
* Stack traces for errors can be enabled with Configure::write('Error.trace', true);
|
||||||
*
|
*
|
||||||
* @param integer $code Code of error
|
* @param int $code Code of error
|
||||||
* @param string $description Error description
|
* @param string $description Error description
|
||||||
* @param string $file File on which error occurred
|
* @param string $file File on which error occurred
|
||||||
* @param integer $line Line that triggered the error
|
* @param int $line Line that triggered the error
|
||||||
* @param array $context Context
|
* @param array $context Context
|
||||||
* @return boolean true if error was handled
|
* @return bool true if error was handled
|
||||||
*/
|
*/
|
||||||
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
|
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
|
||||||
if (error_reporting() === 0) {
|
if (error_reporting() === 0) {
|
||||||
|
@ -230,11 +229,11 @@ class ErrorHandler {
|
||||||
/**
|
/**
|
||||||
* Generate an error page when some fatal error happens.
|
* Generate an error page when some fatal error happens.
|
||||||
*
|
*
|
||||||
* @param integer $code Code of error
|
* @param int $code Code of error
|
||||||
* @param string $description Error description
|
* @param string $description Error description
|
||||||
* @param string $file File on which error occurred
|
* @param string $file File on which error occurred
|
||||||
* @param integer $line Line that triggered the error
|
* @param int $line Line that triggered the error
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function handleFatalError($code, $description, $file, $line) {
|
public static function handleFatalError($code, $description, $file, $line) {
|
||||||
$logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
|
$logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
|
||||||
|
@ -260,7 +259,7 @@ class ErrorHandler {
|
||||||
/**
|
/**
|
||||||
* Map an error code into an Error word, and log location.
|
* Map an error code into an Error word, and log location.
|
||||||
*
|
*
|
||||||
* @param integer $code Error code to map
|
* @param int $code Error code to map
|
||||||
* @return array Array of error word, and log location.
|
* @return array Array of error word, and log location.
|
||||||
*/
|
*/
|
||||||
public static function mapErrorCode($code) {
|
public static function mapErrorCode($code) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue