mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Updating doc blocks to include access and return PHPDOC tags.
Removing use of e() in Debugger. Fixing code formatting in CookieComponent Closes #5477 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7662 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
bd57349665
commit
62168bfe0f
32 changed files with 277 additions and 45 deletions
|
@ -68,6 +68,7 @@ class Cache extends Object {
|
||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function &getInstance() {
|
function &getInstance() {
|
||||||
static $instance = array();
|
static $instance = array();
|
||||||
|
@ -97,6 +98,7 @@ class Cache extends Object {
|
||||||
* @param array $settings Optional associative array of settings passed to the engine
|
* @param array $settings Optional associative array of settings passed to the engine
|
||||||
* @return array(engine, settings) on success, false on failure
|
* @return array(engine, settings) on success, false on failure
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function config($name = null, $settings = array()) {
|
function config($name = null, $settings = array()) {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
@ -142,6 +144,7 @@ class Cache extends Object {
|
||||||
* @param array $settings Optional associative array of settings passed to the engine
|
* @param array $settings Optional associative array of settings passed to the engine
|
||||||
* @return boolean True on success, false on failure
|
* @return boolean True on success, false on failure
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function engine($name = 'File', $settings = array()) {
|
function engine($name = 'File', $settings = array()) {
|
||||||
if (!$name || Configure::read('Cache.disable')) {
|
if (!$name || Configure::read('Cache.disable')) {
|
||||||
|
@ -172,8 +175,9 @@ class Cache extends Object {
|
||||||
*
|
*
|
||||||
* @param mixed $settings Optional string for simple name-value pair or array
|
* @param mixed $settings Optional string for simple name-value pair or array
|
||||||
* @param string $value Optional for a simple name-value pair
|
* @param string $value Optional for a simple name-value pair
|
||||||
* @return void
|
* @return array of settings
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function set($settings = array(), $value = null) {
|
function set($settings = array(), $value = null) {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
@ -207,7 +211,9 @@ class Cache extends Object {
|
||||||
*
|
*
|
||||||
* Permanently remove all expired and deleted data
|
* Permanently remove all expired and deleted data
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function gc() {
|
function gc() {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
@ -224,6 +230,7 @@ class Cache extends Object {
|
||||||
* or array('config' => 'string configuration name', 'duration' => 'duration for expiration')
|
* or array('config' => 'string configuration name', 'duration' => 'duration for expiration')
|
||||||
* @return boolean True if the data was successfully cached, false on failure
|
* @return boolean True if the data was successfully cached, false on failure
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function write($key, $value, $config = null) {
|
function write($key, $value, $config = null) {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
@ -280,6 +287,7 @@ class Cache extends Object {
|
||||||
* @param string $config name of the configuration to use
|
* @param string $config name of the configuration to use
|
||||||
* @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
|
* @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function read($key, $config = null) {
|
function read($key, $config = null) {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
@ -315,6 +323,7 @@ class Cache extends Object {
|
||||||
* @param string $config name of the configuration to use
|
* @param string $config name of the configuration to use
|
||||||
* @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
|
* @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function delete($key, $config = null) {
|
function delete($key, $config = null) {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
@ -348,6 +357,7 @@ class Cache extends Object {
|
||||||
* @param string $config name of the configuration to use
|
* @param string $config name of the configuration to use
|
||||||
* @return boolean True if the cache was succesfully cleared, false otherwise
|
* @return boolean True if the cache was succesfully cleared, false otherwise
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function clear($check = false, $config = null) {
|
function clear($check = false, $config = null) {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
@ -376,6 +386,7 @@ class Cache extends Object {
|
||||||
* @param string $config Name of the configuration setting
|
* @param string $config Name of the configuration setting
|
||||||
* @return bool
|
* @return bool
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function isInitialized($engine = null) {
|
function isInitialized($engine = null) {
|
||||||
if (Configure::read('Cache.disable')) {
|
if (Configure::read('Cache.disable')) {
|
||||||
|
@ -394,6 +405,7 @@ class Cache extends Object {
|
||||||
* @param string $engine Name of the engine
|
* @param string $engine Name of the engine
|
||||||
* @return array list of settings for this engine
|
* @return array list of settings for this engine
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function settings($engine = null) {
|
function settings($engine = null) {
|
||||||
$_this =& Cache::getInstance();
|
$_this =& Cache::getInstance();
|
||||||
|
|
|
@ -64,6 +64,7 @@ class CakeLog {
|
||||||
* @param string $msg Message to log
|
* @param string $msg Message to log
|
||||||
* @return boolean Success
|
* @return boolean Success
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function write($type, $msg) {
|
function write($type, $msg) {
|
||||||
if (!defined('LOG_ERROR')) {
|
if (!defined('LOG_ERROR')) {
|
||||||
|
|
|
@ -86,6 +86,8 @@ class ClassRegistry {
|
||||||
*
|
*
|
||||||
* @param string $type TypeOfClass
|
* @param string $type TypeOfClass
|
||||||
* @return object intance of ClassName
|
* @return object intance of ClassName
|
||||||
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function &init($class, $type = null) {
|
function &init($class, $type = null) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -171,6 +173,7 @@ class ClassRegistry {
|
||||||
* @param mixed $object Object to store
|
* @param mixed $object Object to store
|
||||||
* @return boolean True if the object was written, false if $key already exists
|
* @return boolean True if the object was written, false if $key already exists
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function addObject($key, &$object) {
|
function addObject($key, &$object) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -185,7 +188,9 @@ class ClassRegistry {
|
||||||
* Remove object which corresponds to given key.
|
* Remove object which corresponds to given key.
|
||||||
*
|
*
|
||||||
* @param string $key Key of object to remove from registry
|
* @param string $key Key of object to remove from registry
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function removeObject($key) {
|
function removeObject($key) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -200,6 +205,7 @@ class ClassRegistry {
|
||||||
* @param string $key Key to look for
|
* @param string $key Key to look for
|
||||||
* @return boolean true if key exists in registry, false otherwise
|
* @return boolean true if key exists in registry, false otherwise
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function isKeySet($key) {
|
function isKeySet($key) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -216,6 +222,7 @@ class ClassRegistry {
|
||||||
*
|
*
|
||||||
* @return array Set of keys stored in registry
|
* @return array Set of keys stored in registry
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function keys() {
|
function keys() {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -227,6 +234,7 @@ class ClassRegistry {
|
||||||
* @param string $key Key of object to look for
|
* @param string $key Key of object to look for
|
||||||
* @return mixed Object stored in registry
|
* @return mixed Object stored in registry
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function &getObject($key) {
|
function &getObject($key) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -243,7 +251,7 @@ class ClassRegistry {
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Sets the default constructor parameter for an object type
|
* Sets the default constructor parameter for an object type
|
||||||
*
|
*
|
||||||
* @param string $type Type of object. If this parameter is omitted, defaults to "Model"
|
* @param string $type Type of object. If this parameter is omitted, defaults to "Model"
|
||||||
|
@ -251,6 +259,8 @@ class ClassRegistry {
|
||||||
* of $type are created
|
* of $type are created
|
||||||
* @return mixed Void if $param is being set. Otherwise, if only $type is passed, returns
|
* @return mixed Void if $param is being set. Otherwise, if only $type is passed, returns
|
||||||
* the previously-set value of $param, or null if not set.
|
* the previously-set value of $param, or null if not set.
|
||||||
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function config($type, $param = array()) {
|
function config($type, $param = array()) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -272,6 +282,8 @@ class ClassRegistry {
|
||||||
* @param string $alias
|
* @param string $alias
|
||||||
* @param string $class
|
* @param string $class
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @access protected
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function &_duplicate($alias, $class) {
|
function &_duplicate($alias, $class) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -291,6 +303,7 @@ class ClassRegistry {
|
||||||
* @param string $key Key to include in map
|
* @param string $key Key to include in map
|
||||||
* @param string $name Key that is being mapped
|
* @param string $name Key that is being mapped
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function map($key, $name) {
|
function map($key, $name) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -305,6 +318,7 @@ class ClassRegistry {
|
||||||
*
|
*
|
||||||
* @return array Keys of registry's map
|
* @return array Keys of registry's map
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function mapKeys() {
|
function mapKeys() {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -316,6 +330,7 @@ class ClassRegistry {
|
||||||
* @param string $key Key to find in map
|
* @param string $key Key to find in map
|
||||||
* @return string Mapped value
|
* @return string Mapped value
|
||||||
* @access private
|
* @access private
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function __getMap($key) {
|
function __getMap($key) {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
@ -326,7 +341,9 @@ class ClassRegistry {
|
||||||
/**
|
/**
|
||||||
* Flushes all objects from the ClassRegistry.
|
* Flushes all objects from the ClassRegistry.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function flush() {
|
function flush() {
|
||||||
$_this =& ClassRegistry::getInstance();
|
$_this =& ClassRegistry::getInstance();
|
||||||
|
|
|
@ -242,6 +242,7 @@ class Configure extends Object {
|
||||||
*
|
*
|
||||||
* @param array $config Name of var to write
|
* @param array $config Name of var to write
|
||||||
* @param mixed $value Value to set for var
|
* @param mixed $value Value to set for var
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function write($config, $value = null) {
|
function write($config, $value = null) {
|
||||||
|
@ -341,6 +342,7 @@ class Configure extends Object {
|
||||||
* Configure::delete('Name.key'); will delete only the Configure::Name[key]
|
* Configure::delete('Name.key'); will delete only the Configure::Name[key]
|
||||||
*
|
*
|
||||||
* @param string $var the var to be deleted
|
* @param string $var the var to be deleted
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function delete($var = null) {
|
function delete($var = null) {
|
||||||
|
@ -362,6 +364,7 @@ class Configure extends Object {
|
||||||
* Usage Configure::load('configure_file');
|
* Usage Configure::load('configure_file');
|
||||||
*
|
*
|
||||||
* @param string $fileName name of file to load, extension must be .php and only the name should be used, not the extenstion
|
* @param string $fileName name of file to load, extension must be .php and only the name should be used, not the extenstion
|
||||||
|
* @return mixed false if file not found, void if load successful
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function load($fileName) {
|
function load($fileName) {
|
||||||
|
@ -418,6 +421,7 @@ class Configure extends Object {
|
||||||
* @param string $type Type of config file to write, ex: Models, Controllers, Helpers, Components
|
* @param string $type Type of config file to write, ex: Models, Controllers, Helpers, Components
|
||||||
* @param string $name file name.
|
* @param string $name file name.
|
||||||
* @param array $data array of values to store.
|
* @param array $data array of values to store.
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function store($type, $name, $data = array()) {
|
function store($type, $name, $data = array()) {
|
||||||
|
@ -502,6 +506,7 @@ class Configure extends Object {
|
||||||
* @param string $content Content to write on file
|
* @param string $content Content to write on file
|
||||||
* @param string $name Name to use for cache file
|
* @param string $name Name to use for cache file
|
||||||
* @param boolean $write true if content should be written, false otherwise
|
* @param boolean $write true if content should be written, false otherwise
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __writeConfig($content, $name, $write = true) {
|
function __writeConfig($content, $name, $write = true) {
|
||||||
|
@ -550,6 +555,7 @@ class Configure extends Object {
|
||||||
* Sets the paths for the given object type
|
* Sets the paths for the given object type
|
||||||
*
|
*
|
||||||
* @param array $paths paths defines in config/bootstrap.php
|
* @param array $paths paths defines in config/bootstrap.php
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function buildPaths($paths) {
|
function buildPaths($paths) {
|
||||||
|
@ -597,6 +603,7 @@ class Configure extends Object {
|
||||||
* they will be added to the paths vars
|
* they will be added to the paths vars
|
||||||
*
|
*
|
||||||
* @param boolean $boot Load application bootstrap (if true)
|
* @param boolean $boot Load application bootstrap (if true)
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __loadBootstrap($boot) {
|
function __loadBootstrap($boot) {
|
||||||
|
@ -914,6 +921,7 @@ class App extends Object {
|
||||||
*
|
*
|
||||||
* @param string $file full path to file including file name
|
* @param string $file full path to file including file name
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __load($file) {
|
function __load($file) {
|
||||||
if (empty($file)) {
|
if (empty($file)) {
|
||||||
|
@ -1117,6 +1125,8 @@ class App extends Object {
|
||||||
* @param string $name name of object
|
* @param string $name name of object
|
||||||
* @param string $type type of object
|
* @param string $type type of object
|
||||||
* @param string $plugin name of plugin
|
* @param string $plugin name of plugin
|
||||||
|
* @return void
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __remove($name, $type, $plugin) {
|
function __remove($name, $type, $plugin) {
|
||||||
$_this =& App::getInstance();
|
$_this =& App::getInstance();
|
||||||
|
@ -1132,6 +1142,7 @@ class App extends Object {
|
||||||
* Object destructor
|
* Object destructor
|
||||||
*
|
*
|
||||||
* Write cache file if changes have been made to the $__map or $__paths
|
* Write cache file if changes have been made to the $__map or $__paths
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __destruct() {
|
function __destruct() {
|
||||||
|
|
|
@ -55,6 +55,7 @@ class Component extends Object {
|
||||||
* Used to initialize the components for current controller
|
* Used to initialize the components for current controller
|
||||||
*
|
*
|
||||||
* @param object $controller Controller with components to load
|
* @param object $controller Controller with components to load
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function init(&$controller) {
|
function init(&$controller) {
|
||||||
|
@ -73,6 +74,7 @@ class Component extends Object {
|
||||||
* Called before the Controller::beforeFilter()
|
* Called before the Controller::beforeFilter()
|
||||||
*
|
*
|
||||||
* @param object $controller Controller with components to initialize
|
* @param object $controller Controller with components to initialize
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function initialize(&$controller) {
|
function initialize(&$controller) {
|
||||||
|
@ -91,6 +93,7 @@ class Component extends Object {
|
||||||
* Called after the Controller::beforeFilter() and before the controller action
|
* Called after the Controller::beforeFilter() and before the controller action
|
||||||
*
|
*
|
||||||
* @param object $controller Controller with components to startup
|
* @param object $controller Controller with components to startup
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function startup(&$controller) {
|
function startup(&$controller) {
|
||||||
|
@ -105,6 +108,7 @@ class Component extends Object {
|
||||||
* Called after the Controller::beforeRender(), after the view class is loaded, and before the Controller::render()
|
* Called after the Controller::beforeRender(), after the view class is loaded, and before the Controller::render()
|
||||||
*
|
*
|
||||||
* @param object $controller Controller with components to beforeRender
|
* @param object $controller Controller with components to beforeRender
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function beforeRender(&$controller) {
|
function beforeRender(&$controller) {
|
||||||
|
@ -119,6 +123,7 @@ class Component extends Object {
|
||||||
* Called before Controller::redirect();
|
* Called before Controller::redirect();
|
||||||
*
|
*
|
||||||
* @param object $controller Controller with components to beforeRedirect
|
* @param object $controller Controller with components to beforeRedirect
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function beforeRedirect(&$controller, $url, $status = null, $exit = true) {
|
function beforeRedirect(&$controller, $url, $status = null, $exit = true) {
|
||||||
|
@ -139,6 +144,7 @@ class Component extends Object {
|
||||||
* Called after Controller::render() and before the output is printed to the browser
|
* Called after Controller::render() and before the output is printed to the browser
|
||||||
*
|
*
|
||||||
* @param object $controller Controller with components to shutdown
|
* @param object $controller Controller with components to shutdown
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function shutdown(&$controller) {
|
function shutdown(&$controller) {
|
||||||
|
|
|
@ -254,6 +254,7 @@ class DbAcl extends AclBase {
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*
|
*
|
||||||
* @param object $component
|
* @param object $component
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function initialize(&$component) {
|
function initialize(&$component) {
|
||||||
|
|
|
@ -220,6 +220,7 @@ class AuthComponent extends Object {
|
||||||
* Initializes AuthComponent for use in the controller
|
* Initializes AuthComponent for use in the controller
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to the instantiating controller object
|
* @param object $controller A reference to the instantiating controller object
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function initialize(&$controller) {
|
function initialize(&$controller) {
|
||||||
|
@ -251,6 +252,7 @@ class AuthComponent extends Object {
|
||||||
* of login form data.
|
* of login form data.
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to the instantiating controller object
|
* @param object $controller A reference to the instantiating controller object
|
||||||
|
* @return boolean
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function startup(&$controller) {
|
function startup(&$controller) {
|
||||||
|
@ -380,6 +382,7 @@ class AuthComponent extends Object {
|
||||||
* $userModel and $sessionKey.
|
* $userModel and $sessionKey.
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to the instantiating controller object
|
* @param object $controller A reference to the instantiating controller object
|
||||||
|
* @return boolean
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __setDefaults() {
|
function __setDefaults() {
|
||||||
|
@ -511,6 +514,7 @@ class AuthComponent extends Object {
|
||||||
* @param string $action Controller action name
|
* @param string $action Controller action name
|
||||||
* @param string $action Controller action name
|
* @param string $action Controller action name
|
||||||
* @param string ... etc.
|
* @param string ... etc.
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function allow() {
|
function allow() {
|
||||||
|
@ -530,6 +534,7 @@ class AuthComponent extends Object {
|
||||||
* @param string $action Controller action name
|
* @param string $action Controller action name
|
||||||
* @param string $action Controller action name
|
* @param string $action Controller action name
|
||||||
* @param string ... etc.
|
* @param string ... etc.
|
||||||
|
* @return void
|
||||||
* @see AuthComponent::allow()
|
* @see AuthComponent::allow()
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
@ -547,6 +552,7 @@ class AuthComponent extends Object {
|
||||||
* Maps action names to CRUD operations. Used for controller-based authentication.
|
* Maps action names to CRUD operations. Used for controller-based authentication.
|
||||||
*
|
*
|
||||||
* @param array $map Actions to map
|
* @param array $map Actions to map
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function mapActions($map = array()) {
|
function mapActions($map = array()) {
|
||||||
|
@ -605,7 +611,8 @@ class AuthComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Get the current user from the session.
|
* Get the current user from the session.
|
||||||
*
|
*
|
||||||
* @return array User record, or null if no user is logged in.
|
* @param string $key field to retrive. Leave null to get entire User record
|
||||||
|
* @return mixed User record. or null if no user is logged in.
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function user($key = null) {
|
function user($key = null) {
|
||||||
|
|
|
@ -270,6 +270,7 @@ class CookieComponent extends Object {
|
||||||
* Failure to do so will result in header already sent errors.
|
* Failure to do so will result in header already sent errors.
|
||||||
*
|
*
|
||||||
* @param string $key Key of the value to be deleted
|
* @param string $key Key of the value to be deleted
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function del($key) {
|
function del($key) {
|
||||||
|
@ -298,6 +299,7 @@ class CookieComponent extends Object {
|
||||||
* You must use this method before any output is sent to the browser.
|
* You must use this method before any output is sent to the browser.
|
||||||
* Failure to do so will result in header already sent errors.
|
* Failure to do so will result in header already sent errors.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function destroy() {
|
function destroy() {
|
||||||
|
@ -416,13 +418,13 @@ class CookieComponent extends Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$pos = strpos($value, 'Q2FrZQ==.');
|
$pos = strpos($value, 'Q2FrZQ==.');
|
||||||
$decrypted[$name] = $this->__explode($value);
|
$decrypted[$name] = $this->__explode($value);
|
||||||
|
|
||||||
if ($pos !== false) {
|
if ($pos !== false) {
|
||||||
$value = substr($value, 8);
|
$value = substr($value, 8);
|
||||||
$decrypted[$name] = $this->__explode(Security::$type(base64_decode($value), $this->key));
|
$decrypted[$name] = $this->__explode(Security::$type(base64_decode($value), $this->key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,7 @@ class RequestHandlerComponent extends Object {
|
||||||
* as the first item.
|
* as the first item.
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to the controller
|
* @param object $controller A reference to the controller
|
||||||
|
* @return void
|
||||||
* @see Router::parseExtensions()
|
* @see Router::parseExtensions()
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
@ -180,6 +181,7 @@ class RequestHandlerComponent extends Object {
|
||||||
* to the $data property of the controller, which can then be saved to a model object.
|
* to the $data property of the controller, which can then be saved to a model object.
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to the controller
|
* @param object $controller A reference to the controller
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function startup(&$controller) {
|
function startup(&$controller) {
|
||||||
|
@ -359,6 +361,7 @@ class RequestHandlerComponent extends Object {
|
||||||
* @param string $name The name of the Content-type, i.e. "html", "xml", "css"
|
* @param string $name The name of the Content-type, i.e. "html", "xml", "css"
|
||||||
* @param mixed $type The Content-type or array of Content-types assigned to the name,
|
* @param mixed $type The Content-type or array of Content-types assigned to the name,
|
||||||
* i.e. "text/html", or "application/xml"
|
* i.e. "text/html", or "application/xml"
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setContent($name, $type = null) {
|
function setContent($name, $type = null) {
|
||||||
|
@ -462,6 +465,7 @@ class RequestHandlerComponent extends Object {
|
||||||
* Determines the content type of the data the client has sent (i.e. in a POST request)
|
* Determines the content type of the data the client has sent (i.e. in a POST request)
|
||||||
*
|
*
|
||||||
* @param mixed $type Can be null (or no parameter), a string type name, or an array of types
|
* @param mixed $type Can be null (or no parameter), a string type name, or an array of types
|
||||||
|
* @return mixed
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requestedWith($type = null) {
|
function requestedWith($type = null) {
|
||||||
|
@ -546,6 +550,7 @@ class RequestHandlerComponent extends Object {
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to a controller object
|
* @param object $controller A reference to a controller object
|
||||||
* @param string $type Type of response to send (e.g: 'ajax')
|
* @param string $type Type of response to send (e.g: 'ajax')
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
* @see RequestHandlerComponent::setContent()
|
* @see RequestHandlerComponent::setContent()
|
||||||
* @see RequestHandlerComponent::respondAs()
|
* @see RequestHandlerComponent::respondAs()
|
||||||
|
|
|
@ -192,6 +192,7 @@ class SecurityComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Sets the actions that require a POST request, or empty for all actions
|
* Sets the actions that require a POST request, or empty for all actions
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requirePost() {
|
function requirePost() {
|
||||||
|
@ -201,6 +202,7 @@ class SecurityComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Sets the actions that require a GET request, or empty for all actions
|
* Sets the actions that require a GET request, or empty for all actions
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requireGet() {
|
function requireGet() {
|
||||||
|
@ -210,6 +212,7 @@ class SecurityComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Sets the actions that require a PUT request, or empty for all actions
|
* Sets the actions that require a PUT request, or empty for all actions
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requirePut() {
|
function requirePut() {
|
||||||
|
@ -219,6 +222,7 @@ class SecurityComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Sets the actions that require a DELETE request, or empty for all actions
|
* Sets the actions that require a DELETE request, or empty for all actions
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requireDelete() {
|
function requireDelete() {
|
||||||
|
@ -228,6 +232,7 @@ class SecurityComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Sets the actions that require a request that is SSL-secured, or empty for all actions
|
* Sets the actions that require a request that is SSL-secured, or empty for all actions
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requireSecure() {
|
function requireSecure() {
|
||||||
|
@ -237,6 +242,7 @@ class SecurityComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Sets the actions that require an authenticated request, or empty for all actions
|
* Sets the actions that require an authenticated request, or empty for all actions
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requireAuth() {
|
function requireAuth() {
|
||||||
|
@ -246,6 +252,7 @@ class SecurityComponent extends Object {
|
||||||
/**
|
/**
|
||||||
* Sets the actions that require an HTTP-authenticated request, or empty for all actions
|
* Sets the actions that require an HTTP-authenticated request, or empty for all actions
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function requireLogin() {
|
function requireLogin() {
|
||||||
|
@ -393,6 +400,7 @@ class SecurityComponent extends Object {
|
||||||
*
|
*
|
||||||
* @param string $method The HTTP method to assign controller actions to
|
* @param string $method The HTTP method to assign controller actions to
|
||||||
* @param array $actions Controller actions to set the required HTTP method to.
|
* @param array $actions Controller actions to set the required HTTP method to.
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _requireMethod($method, $actions = array()) {
|
function _requireMethod($method, $actions = array()) {
|
||||||
|
@ -642,6 +650,7 @@ class SecurityComponent extends Object {
|
||||||
* Sets the default login options for an HTTP-authenticated request
|
* Sets the default login options for an HTTP-authenticated request
|
||||||
*
|
*
|
||||||
* @param array $options Default login options
|
* @param array $options Default login options
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _setLoginDefaults(&$options) {
|
function _setLoginDefaults(&$options) {
|
||||||
|
|
|
@ -76,6 +76,7 @@ class SessionComponent extends CakeSession {
|
||||||
* Initializes the component, gets a reference to Controller::$param['bare'].
|
* Initializes the component, gets a reference to Controller::$param['bare'].
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to the controller
|
* @param object $controller A reference to the controller
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function initialize(&$controller) {
|
function initialize(&$controller) {
|
||||||
|
@ -87,6 +88,7 @@ class SessionComponent extends CakeSession {
|
||||||
* Startup method.
|
* Startup method.
|
||||||
*
|
*
|
||||||
* @param object $controller Instantiating controller
|
* @param object $controller Instantiating controller
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function startup(&$controller) {
|
function startup(&$controller) {
|
||||||
|
@ -98,6 +100,7 @@ class SessionComponent extends CakeSession {
|
||||||
* Starts Session on if 'Session.start' is set to false in core.php
|
* Starts Session on if 'Session.start' is set to false in core.php
|
||||||
*
|
*
|
||||||
* @param string $base The base path for the Session
|
* @param string $base The base path for the Session
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function activate($base = null) {
|
function activate($base = null) {
|
||||||
|
@ -115,6 +118,7 @@ class SessionComponent extends CakeSession {
|
||||||
* @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
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function write($name, $value = null) {
|
function write($name, $value = null) {
|
||||||
|
@ -239,6 +243,7 @@ class SessionComponent extends CakeSession {
|
||||||
*
|
*
|
||||||
* In your controller: $this->Session->renew();
|
* In your controller: $this->Session->renew();
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function renew() {
|
function renew() {
|
||||||
|
@ -267,6 +272,7 @@ class SessionComponent extends CakeSession {
|
||||||
*
|
*
|
||||||
* In your controller: $this->Session->destroy();
|
* In your controller: $this->Session->destroy();
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function destroy() {
|
function destroy() {
|
||||||
|
@ -291,7 +297,8 @@ class SessionComponent extends CakeSession {
|
||||||
/**
|
/**
|
||||||
* Starts Session if SessionComponent is used in Controller::beforeFilter(),
|
* Starts Session if SessionComponent is used in Controller::beforeFilter(),
|
||||||
* or is called from
|
* or is called from
|
||||||
*
|
*
|
||||||
|
* @return boolean
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __start() {
|
function __start() {
|
||||||
|
|
|
@ -301,6 +301,7 @@ class Controller extends Object {
|
||||||
/**
|
/**
|
||||||
* Merge components, helpers, and uses vars from AppController and PluginAppController
|
* Merge components, helpers, and uses vars from AppController and PluginAppController
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function __mergeVars() {
|
function __mergeVars() {
|
||||||
|
@ -472,6 +473,7 @@ class Controller extends Object {
|
||||||
* within the app, or an absolute URL
|
* within the app, or an absolute URL
|
||||||
* @param integer $status Optional HTTP status code (eg: 404)
|
* @param integer $status Optional HTTP status code (eg: 404)
|
||||||
* @param boolean $exit If true, exit() will be called after the redirect
|
* @param boolean $exit If true, exit() will be called after the redirect
|
||||||
|
* @return mixed void if $exit = false. Terminates script if $exit = true
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function redirect($url, $status = null, $exit = true) {
|
function redirect($url, $status = null, $exit = true) {
|
||||||
|
@ -575,7 +577,7 @@ class Controller extends Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* undocumented function
|
* Conveinence method for header()
|
||||||
*
|
*
|
||||||
* @param string $status
|
* @param string $status
|
||||||
* @return void
|
* @return void
|
||||||
|
@ -590,6 +592,7 @@ class Controller extends Object {
|
||||||
* @param mixed $one A string or an array of data.
|
* @param mixed $one A string or an array of data.
|
||||||
* @param mixed $two Value in case $one is a string (which then works as the key).
|
* @param mixed $two Value in case $one is a string (which then works as the key).
|
||||||
* Unused if $one is an associative array, otherwise serves as the values to $one's keys.
|
* Unused if $one is an associative array, otherwise serves as the values to $one's keys.
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function set($one, $two = null) {
|
function set($one, $two = null) {
|
||||||
|
@ -773,6 +776,7 @@ class Controller extends Object {
|
||||||
/**
|
/**
|
||||||
* Tells the browser not to cache the results of the current request by sending headers
|
* Tells the browser not to cache the results of the current request by sending headers
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function disableCache() {
|
function disableCache() {
|
||||||
|
@ -789,6 +793,7 @@ class Controller extends Object {
|
||||||
* @param string $message Message to display to the user
|
* @param string $message Message to display to the user
|
||||||
* @param string $url Relative URL to redirect to after the time expires
|
* @param string $url Relative URL to redirect to after the time expires
|
||||||
* @param integer $pause Time to show the message
|
* @param integer $pause Time to show the message
|
||||||
|
* @return void Renders flash layout
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function flash($message, $url, $pause = 1) {
|
function flash($message, $url, $pause = 1) {
|
||||||
|
|
|
@ -195,7 +195,8 @@ class Scaffold extends Object {
|
||||||
/**
|
/**
|
||||||
* Outputs the content of a scaffold method passing it through the Controller::afterFilter()
|
* Outputs the content of a scaffold method passing it through the Controller::afterFilter()
|
||||||
*
|
*
|
||||||
* @access private
|
* @return void
|
||||||
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _output() {
|
function _output() {
|
||||||
$this->controller->afterFilter();
|
$this->controller->afterFilter();
|
||||||
|
|
|
@ -92,6 +92,7 @@ class Debugger extends Object {
|
||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function &getInstance() {
|
function &getInstance() {
|
||||||
static $instance = array();
|
static $instance = array();
|
||||||
|
@ -106,15 +107,26 @@ class Debugger extends Object {
|
||||||
return $instance[0];
|
return $instance[0];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* formats and outputs the passed var
|
* Formats and outputs the passed var
|
||||||
|
*
|
||||||
|
* @param $var mixed the variable to dump
|
||||||
|
* @return void
|
||||||
|
* @see exportVar
|
||||||
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function dump($var) {
|
function dump($var) {
|
||||||
$_this = Debugger::getInstance();
|
$_this = Debugger::getInstance();
|
||||||
pr($_this->exportVar($var));
|
pr($_this->exportVar($var));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* neatly logs a given var
|
* Neatly logs a given var
|
||||||
*/
|
*
|
||||||
|
* @param $var mixed Variable or content to log
|
||||||
|
* @param $level int type of log to use. Defaults to LOG_DEBUG
|
||||||
|
* @return void
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
function log($var, $level = LOG_DEBUG) {
|
function log($var, $level = LOG_DEBUG) {
|
||||||
$_this = Debugger::getInstance();
|
$_this = Debugger::getInstance();
|
||||||
$trace = $_this->trace(array('start' => 1, 'depth' => 2, 'format' => 'array'));
|
$trace = $_this->trace(array('start' => 1, 'depth' => 2, 'format' => 'array'));
|
||||||
|
@ -213,6 +225,7 @@ class Debugger extends Object {
|
||||||
* @param array $options Format for outputting stack trace
|
* @param array $options Format for outputting stack trace
|
||||||
* @return string Formatted stack trace
|
* @return string Formatted stack trace
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function trace($options = array()) {
|
function trace($options = array()) {
|
||||||
$options = array_merge(array(
|
$options = array_merge(array(
|
||||||
|
@ -289,6 +302,7 @@ class Debugger extends Object {
|
||||||
* @param string $path Path to shorten
|
* @param string $path Path to shorten
|
||||||
* @return string Normalized path
|
* @return string Normalized path
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function trimPath($path) {
|
function trimPath($path) {
|
||||||
if (!defined('CAKE_CORE_INCLUDE_PATH') || !defined('APP')) {
|
if (!defined('CAKE_CORE_INCLUDE_PATH') || !defined('APP')) {
|
||||||
|
@ -318,6 +332,7 @@ class Debugger extends Object {
|
||||||
* @param integer $context Number of lines of context to extract above and below $line
|
* @param integer $context Number of lines of context to extract above and below $line
|
||||||
* @return array Set of lines highlighted
|
* @return array Set of lines highlighted
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function excerpt($file, $line, $context = 2) {
|
function excerpt($file, $line, $context = 2) {
|
||||||
$data = $lines = array();
|
$data = $lines = array();
|
||||||
|
@ -345,6 +360,7 @@ class Debugger extends Object {
|
||||||
* @param string $var Variable to convert
|
* @param string $var Variable to convert
|
||||||
* @return string Variable as a formatted string
|
* @return string Variable as a formatted string
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function exportVar($var, $recursion = 0) {
|
function exportVar($var, $recursion = 0) {
|
||||||
$_this = Debugger::getInstance();
|
$_this = Debugger::getInstance();
|
||||||
|
@ -395,6 +411,7 @@ class Debugger extends Object {
|
||||||
* Handles object conversion to debug string
|
* Handles object conversion to debug string
|
||||||
*
|
*
|
||||||
* @param string $var Object to convert
|
* @param string $var Object to convert
|
||||||
|
* @return string
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __object($var) {
|
function __object($var) {
|
||||||
|
@ -463,30 +480,30 @@ class Debugger extends Object {
|
||||||
$out = "<a href='javascript:void(0);' onclick='{$link}'><b>{$error}</b> ({$code})</a>: {$description} [<b>{$file}</b>, line <b>{$line}</b>]";
|
$out = "<a href='javascript:void(0);' onclick='{$link}'><b>{$error}</b> ({$code})</a>: {$description} [<b>{$file}</b>, line <b>{$line}</b>]";
|
||||||
if (Configure::read() > 0) {
|
if (Configure::read() > 0) {
|
||||||
debug($out, false, false);
|
debug($out, false, false);
|
||||||
e('<div id="CakeStackTrace' . count($_this->errors) . '" class="cake-stack-trace" style="display: none;">');
|
echo '<div id="CakeStackTrace' . count($_this->errors) . '" class="cake-stack-trace" style="display: none;">';
|
||||||
$link = "document.getElementById(\"CakeErrorCode" . count($_this->errors) . "\").style.display = (document.getElementById(\"CakeErrorCode" . count($_this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
|
$link = "document.getElementById(\"CakeErrorCode" . count($_this->errors) . "\").style.display = (document.getElementById(\"CakeErrorCode" . count($_this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
|
||||||
e("<a href='javascript:void(0);' onclick='{$link}'>Code</a>");
|
echo "<a href='javascript:void(0);' onclick='{$link}'>Code</a>";
|
||||||
|
|
||||||
if (!empty($context)) {
|
if (!empty($context)) {
|
||||||
$link = "document.getElementById(\"CakeErrorContext" . count($_this->errors) . "\").style.display = (document.getElementById(\"CakeErrorContext" . count($_this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
|
$link = "document.getElementById(\"CakeErrorContext" . count($_this->errors) . "\").style.display = (document.getElementById(\"CakeErrorContext" . count($_this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
|
||||||
e(" | <a href='javascript:void(0);' onclick='{$link}'>Context</a>");
|
echo " | <a href='javascript:void(0);' onclick='{$link}'>Context</a>";
|
||||||
|
|
||||||
if (!empty($helpCode)) {
|
if (!empty($helpCode)) {
|
||||||
e(" | <a href='{$_this->helpPath}{$helpCode}' target='_blank'>Help</a>");
|
echo " | <a href='{$_this->helpPath}{$helpCode}' target='_blank'>Help</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
e("<pre id=\"CakeErrorContext" . count($_this->errors) . "\" class=\"cake-context\" style=\"display: none;\">");
|
echo "<pre id=\"CakeErrorContext" . count($_this->errors) . "\" class=\"cake-context\" style=\"display: none;\">";
|
||||||
e(implode("\n", $context));
|
echo implode("\n", $context);
|
||||||
e("</pre>");
|
echo "</pre>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($listing)) {
|
if (!empty($listing)) {
|
||||||
e("<div id=\"CakeErrorCode" . count($_this->errors) . "\" class=\"cake-code-dump\" style=\"display: none;\">");
|
echo "<div id=\"CakeErrorCode" . count($_this->errors) . "\" class=\"cake-code-dump\" style=\"display: none;\">";
|
||||||
pr(implode("\n", $listing) . "\n", false);
|
pr(implode("\n", $listing) . "\n", false);
|
||||||
e('</div>');
|
echo '</div>';
|
||||||
}
|
}
|
||||||
pr($trace, false);
|
pr($trace, false);
|
||||||
e('</div>');
|
echo '</div>';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'html':
|
case 'html':
|
||||||
|
@ -517,6 +534,7 @@ class Debugger extends Object {
|
||||||
* Verify that the application's salt has been changed from the default value
|
* Verify that the application's salt has been changed from the default value
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function checkSessionKey() {
|
function checkSessionKey() {
|
||||||
if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') {
|
if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') {
|
||||||
|
@ -529,6 +547,7 @@ class Debugger extends Object {
|
||||||
*
|
*
|
||||||
* @param object $debugger A reference to the Debugger object
|
* @param object $debugger A reference to the Debugger object
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function invoke(&$debugger) {
|
function invoke(&$debugger) {
|
||||||
set_error_handler(array(&$debugger, 'handleError'));
|
set_error_handler(array(&$debugger, 'handleError'));
|
||||||
|
|
|
@ -436,6 +436,7 @@ class File extends Object {
|
||||||
* Returns the File's owner.
|
* Returns the File's owner.
|
||||||
*
|
*
|
||||||
* @return integer the Fileowner
|
* @return integer the Fileowner
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function owner() {
|
function owner() {
|
||||||
if ($this->exists()) {
|
if ($this->exists()) {
|
||||||
|
|
|
@ -490,6 +490,7 @@ class Folder extends Object {
|
||||||
* Returns the size in bytes of this Folder.
|
* Returns the size in bytes of this Folder.
|
||||||
*
|
*
|
||||||
* @param string $directory Path to directory
|
* @param string $directory Path to directory
|
||||||
|
* @return int size in bytes of current folder
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function dirsize() {
|
function dirsize() {
|
||||||
|
|
|
@ -144,6 +144,7 @@ class Inflector extends Object {
|
||||||
/**
|
/**
|
||||||
* Initializes plural inflection rules
|
* Initializes plural inflection rules
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function __initPluralRules() {
|
function __initPluralRules() {
|
||||||
|
@ -271,6 +272,7 @@ class Inflector extends Object {
|
||||||
/**
|
/**
|
||||||
* Initializes singular inflection rules
|
* Initializes singular inflection rules
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function __initSingularRules() {
|
function __initSingularRules() {
|
||||||
|
@ -458,7 +460,7 @@ class Inflector extends Object {
|
||||||
* Returns Cake model class name ("Post" for the database table "posts".) for given database table.
|
* Returns Cake model class name ("Post" for the database table "posts".) for given database table.
|
||||||
*
|
*
|
||||||
* @param string $tableName Name of database table to get class name for
|
* @param string $tableName Name of database table to get class name for
|
||||||
* @return string
|
* @return string Class name
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -470,7 +472,7 @@ class Inflector extends Object {
|
||||||
* Returns camelBacked version of a string.
|
* Returns camelBacked version of a string.
|
||||||
*
|
*
|
||||||
* @param string $string
|
* @param string $string
|
||||||
* @return string
|
* @return string in variable form
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -150,6 +150,7 @@ class ModelBehavior extends Object {
|
||||||
*
|
*
|
||||||
* @see Object::dispatchMethod
|
* @see Object::dispatchMethod
|
||||||
* @access public
|
* @access public
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function dispatchMethod(&$model, $method, $params = array()) {
|
function dispatchMethod(&$model, $method, $params = array()) {
|
||||||
if (empty($params)) {
|
if (empty($params)) {
|
||||||
|
@ -244,6 +245,7 @@ class BehaviorCollection extends Object {
|
||||||
* Attaches a model object and loads a list of behaviors
|
* Attaches a model object and loads a list of behaviors
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function init($modelName, $behaviors = array()) {
|
function init($modelName, $behaviors = array()) {
|
||||||
$this->modelName = $modelName;
|
$this->modelName = $modelName;
|
||||||
|
@ -317,6 +319,7 @@ class BehaviorCollection extends Object {
|
||||||
* Detaches a behavior from a model
|
* Detaches a behavior from a model
|
||||||
*
|
*
|
||||||
* @param string $name CamelCased name of the behavior to unload
|
* @param string $name CamelCased name of the behavior to unload
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function detach($name) {
|
function detach($name) {
|
||||||
|
|
|
@ -48,6 +48,7 @@ class AclBehavior extends ModelBehavior {
|
||||||
*
|
*
|
||||||
* @param mixed $config
|
* @param mixed $config
|
||||||
* @return void
|
* @return void
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setup(&$model, $config = array()) {
|
function setup(&$model, $config = array()) {
|
||||||
if (is_string($config)) {
|
if (is_string($config)) {
|
||||||
|
@ -69,6 +70,7 @@ class AclBehavior extends ModelBehavior {
|
||||||
*
|
*
|
||||||
* @param mixed $ref
|
* @param mixed $ref
|
||||||
* @return array
|
* @return array
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function node(&$model, $ref = null) {
|
function node(&$model, $ref = null) {
|
||||||
$type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])];
|
$type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])];
|
||||||
|
@ -82,6 +84,7 @@ class AclBehavior extends ModelBehavior {
|
||||||
*
|
*
|
||||||
* @param boolean $created True if this is a new record
|
* @param boolean $created True if this is a new record
|
||||||
* @return void
|
* @return void
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function afterSave(&$model, $created) {
|
function afterSave(&$model, $created) {
|
||||||
if ($created) {
|
if ($created) {
|
||||||
|
@ -105,6 +108,7 @@ class AclBehavior extends ModelBehavior {
|
||||||
* Destroys the ARO/ACO node bound to the deleted record
|
* Destroys the ARO/ACO node bound to the deleted record
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function afterDelete(&$model) {
|
function afterDelete(&$model) {
|
||||||
$type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])];
|
$type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])];
|
||||||
|
|
|
@ -92,6 +92,7 @@ class ContainableBehavior extends ModelBehavior {
|
||||||
*
|
*
|
||||||
* @param object $Model Model using the behavior
|
* @param object $Model Model using the behavior
|
||||||
* @param array $query Query parameters as set by cake
|
* @param array $query Query parameters as set by cake
|
||||||
|
* @return array
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function beforeFind(&$Model, $query) {
|
function beforeFind(&$Model, $query) {
|
||||||
|
@ -223,6 +224,7 @@ class ContainableBehavior extends ModelBehavior {
|
||||||
* parameters unbinds all related models.
|
* parameters unbinds all related models.
|
||||||
*
|
*
|
||||||
* @param object $Model Model on which binding restriction is being applied
|
* @param object $Model Model on which binding restriction is being applied
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function contain(&$Model) {
|
function contain(&$Model) {
|
||||||
|
@ -236,6 +238,7 @@ class ContainableBehavior extends ModelBehavior {
|
||||||
* contain call.
|
* contain call.
|
||||||
*
|
*
|
||||||
* @param object $Model Model on which to reset bindings
|
* @param object $Model Model on which to reset bindings
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function resetBindings(&$Model) {
|
function resetBindings(&$Model) {
|
||||||
|
|
|
@ -51,6 +51,10 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
*
|
*
|
||||||
* $config could be empty - and translations configured dynamically by
|
* $config could be empty - and translations configured dynamically by
|
||||||
* bindTranslation() method
|
* bindTranslation() method
|
||||||
|
*
|
||||||
|
* @param array $config
|
||||||
|
* @return mixed
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setup(&$model, $config = array()) {
|
function setup(&$model, $config = array()) {
|
||||||
$db =& ConnectionManager::getDataSource($model->useDbConfig);
|
$db =& ConnectionManager::getDataSource($model->useDbConfig);
|
||||||
|
@ -66,6 +70,9 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Callback
|
* Callback
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function cleanup(&$model) {
|
function cleanup(&$model) {
|
||||||
$this->unbindTranslation($model);
|
$this->unbindTranslation($model);
|
||||||
|
@ -73,7 +80,11 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
unset($this->runtime[$model->alias]);
|
unset($this->runtime[$model->alias]);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Callback
|
* beforeFind Callback
|
||||||
|
*
|
||||||
|
* @param array $query
|
||||||
|
* @return array Modified query
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function beforeFind(&$model, $query) {
|
function beforeFind(&$model, $query) {
|
||||||
$locale = $this->_getLocale($model);
|
$locale = $this->_getLocale($model);
|
||||||
|
@ -182,7 +193,12 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Callback
|
* afterFind Callback
|
||||||
|
*
|
||||||
|
* @param array $results
|
||||||
|
* @param boolean $primary
|
||||||
|
* @return array Modified results
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function afterFind(&$model, $results, $primary) {
|
function afterFind(&$model, $results, $primary) {
|
||||||
$this->runtime[$model->alias]['fields'] = array();
|
$this->runtime[$model->alias]['fields'] = array();
|
||||||
|
@ -221,7 +237,10 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Callback
|
* beforeValidate Callback
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function beforeValidate(&$model) {
|
function beforeValidate(&$model) {
|
||||||
$locale = $this->_getLocale($model);
|
$locale = $this->_getLocale($model);
|
||||||
|
@ -250,7 +269,11 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Callback
|
* afterSave Callback
|
||||||
|
*
|
||||||
|
* @param boolean $created
|
||||||
|
* @return void
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function afterSave(&$model, $created) {
|
function afterSave(&$model, $created) {
|
||||||
if (!isset($this->runtime[$model->alias]['beforeSave'])) {
|
if (!isset($this->runtime[$model->alias]['beforeSave'])) {
|
||||||
|
@ -289,7 +312,10 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Callback
|
* afterDelete Callback
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function afterDelete(&$model) {
|
function afterDelete(&$model) {
|
||||||
$RuntimeModel =& $this->translateModel($model);
|
$RuntimeModel =& $this->translateModel($model);
|
||||||
|
@ -300,6 +326,7 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
* Get selected locale for model
|
* Get selected locale for model
|
||||||
*
|
*
|
||||||
* @return mixed string or false
|
* @return mixed string or false
|
||||||
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _getLocale(&$model) {
|
function _getLocale(&$model) {
|
||||||
if (!isset($model->locale) || is_null($model->locale)) {
|
if (!isset($model->locale) || is_null($model->locale)) {
|
||||||
|
@ -317,6 +344,7 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
* Get instance of model for translations
|
* Get instance of model for translations
|
||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function &translateModel(&$model) {
|
function &translateModel(&$model) {
|
||||||
if (!isset($this->runtime[$model->alias]['model'])) {
|
if (!isset($this->runtime[$model->alias]['model'])) {
|
||||||
|
|
|
@ -35,14 +35,30 @@
|
||||||
* @subpackage cake.cake.libs.model.behaviors
|
* @subpackage cake.cake.libs.model.behaviors
|
||||||
*/
|
*/
|
||||||
class TreeBehavior extends ModelBehavior {
|
class TreeBehavior extends ModelBehavior {
|
||||||
|
/**
|
||||||
|
* Errors
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $errors = array();
|
var $errors = array();
|
||||||
|
/**
|
||||||
|
* Defaults
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
var $_defaults = array(
|
var $_defaults = array(
|
||||||
'parent' => 'parent_id', 'left' => 'lft', 'right' => 'rght',
|
'parent' => 'parent_id', 'left' => 'lft', 'right' => 'rght',
|
||||||
'scope' => '1 = 1', 'type' => 'nested', '__parentChange' => false, 'recursive' => -1
|
'scope' => '1 = 1', 'type' => 'nested', '__parentChange' => false, 'recursive' => -1
|
||||||
);
|
);
|
||||||
|
/**
|
||||||
|
* Initiate Tree behavior
|
||||||
|
*
|
||||||
|
* @param object $model
|
||||||
|
* @param array $config
|
||||||
|
* @return void
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
function setup(&$model, $config = array()) {
|
function setup(&$model, $config = array()) {
|
||||||
if (!is_array($config)) {
|
if (!is_array($config)) {
|
||||||
$config = array('type' => $config);
|
$config = array('type' => $config);
|
||||||
|
@ -66,6 +82,7 @@ class TreeBehavior extends ModelBehavior {
|
||||||
* @param AppModel $model
|
* @param AppModel $model
|
||||||
* @param boolean $created indicates whether the node just saved was created or updated
|
* @param boolean $created indicates whether the node just saved was created or updated
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function afterSave(&$model, $created) {
|
function afterSave(&$model, $created) {
|
||||||
extract($this->settings[$model->alias]);
|
extract($this->settings[$model->alias]);
|
||||||
|
@ -85,6 +102,7 @@ class TreeBehavior extends ModelBehavior {
|
||||||
*
|
*
|
||||||
* @param AppModel $model
|
* @param AppModel $model
|
||||||
* @return boolean true to continue, false to abort the delete
|
* @return boolean true to continue, false to abort the delete
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function beforeDelete(&$model) {
|
function beforeDelete(&$model) {
|
||||||
extract($this->settings[$model->alias]);
|
extract($this->settings[$model->alias]);
|
||||||
|
@ -116,6 +134,7 @@ class TreeBehavior extends ModelBehavior {
|
||||||
* @since 1.2
|
* @since 1.2
|
||||||
* @param AppModel $model
|
* @param AppModel $model
|
||||||
* @return boolean true to continue, false to abort the save
|
* @return boolean true to continue, false to abort the save
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function beforeSave(&$model) {
|
function beforeSave(&$model) {
|
||||||
extract($this->settings[$model->alias]);
|
extract($this->settings[$model->alias]);
|
||||||
|
|
|
@ -417,6 +417,7 @@ class Model extends Overloadable {
|
||||||
* @param array $options If $model is a string, this is the list of association properties with which $model will
|
* @param array $options If $model is a string, this is the list of association properties with which $model will
|
||||||
* be bound
|
* be bound
|
||||||
* @param boolean $permanent Set to true to make the binding permanent
|
* @param boolean $permanent Set to true to make the binding permanent
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
* @todo
|
* @todo
|
||||||
*/
|
*/
|
||||||
|
@ -526,6 +527,7 @@ class Model extends Overloadable {
|
||||||
/**
|
/**
|
||||||
* Create a set of associations
|
* Create a set of associations
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __createLinks() {
|
function __createLinks() {
|
||||||
|
@ -585,6 +587,7 @@ class Model extends Overloadable {
|
||||||
*
|
*
|
||||||
* var $hasMany = array('ModelName');
|
* var $hasMany = array('ModelName');
|
||||||
* usage: $this->ModelName->modelMethods();
|
* usage: $this->ModelName->modelMethods();
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __constructLinkedModel($assoc, $className = null) {
|
function __constructLinkedModel($assoc, $className = null) {
|
||||||
|
@ -608,6 +611,7 @@ class Model extends Overloadable {
|
||||||
* Build array-based association from string.
|
* Build array-based association from string.
|
||||||
*
|
*
|
||||||
* @param string $type 'belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'
|
* @param string $type 'belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __generateAssociation($type) {
|
function __generateAssociation($type) {
|
||||||
|
@ -687,6 +691,7 @@ class Model extends Overloadable {
|
||||||
* Sets a custom table for your controller class. Used by your controller to select a database table.
|
* Sets a custom table for your controller class. Used by your controller to select a database table.
|
||||||
*
|
*
|
||||||
* @param string $tableName Name of the custom table
|
* @param string $tableName Name of the custom table
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setSource($tableName) {
|
function setSource($tableName) {
|
||||||
|
@ -1475,6 +1480,7 @@ class Model extends Overloadable {
|
||||||
/**
|
/**
|
||||||
* Private helper method used by saveAll
|
* Private helper method used by saveAll
|
||||||
*
|
*
|
||||||
|
* @return boolean Success
|
||||||
* @access private
|
* @access private
|
||||||
* @see Model::saveAll()
|
* @see Model::saveAll()
|
||||||
*/
|
*/
|
||||||
|
@ -1571,6 +1577,7 @@ class Model extends Overloadable {
|
||||||
*
|
*
|
||||||
* @param string $id ID of record that was deleted
|
* @param string $id ID of record that was deleted
|
||||||
* @param boolean $cascade Set to true to delete records that depend on this record
|
* @param boolean $cascade Set to true to delete records that depend on this record
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _deleteDependent($id, $cascade) {
|
function _deleteDependent($id, $cascade) {
|
||||||
|
@ -1609,6 +1616,7 @@ class Model extends Overloadable {
|
||||||
* Cascades model deletes to HABTM join keys.
|
* Cascades model deletes to HABTM join keys.
|
||||||
*
|
*
|
||||||
* @param string $id ID of record that was deleted
|
* @param string $id ID of record that was deleted
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _deleteLinks($id) {
|
function _deleteLinks($id) {
|
||||||
|
@ -1675,6 +1683,7 @@ class Model extends Overloadable {
|
||||||
/**
|
/**
|
||||||
* Collects foreign keys from associations
|
* Collects foreign keys from associations
|
||||||
*
|
*
|
||||||
|
* @return array
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __collectForeignKeys($type = 'belongsTo') {
|
function __collectForeignKeys($type = 'belongsTo') {
|
||||||
|
@ -1942,7 +1951,7 @@ class Model extends Overloadable {
|
||||||
* @param string $state Either "before" or "after"
|
* @param string $state Either "before" or "after"
|
||||||
* @param mixed $query
|
* @param mixed $query
|
||||||
* @param array $results
|
* @param array $results
|
||||||
* @return void
|
* @return array
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _findNeighbors($state, $query, $results = array()) {
|
function _findNeighbors($state, $query, $results = array()) {
|
||||||
|
@ -2390,6 +2399,7 @@ class Model extends Overloadable {
|
||||||
/**
|
/**
|
||||||
* Top secret
|
* Top secret
|
||||||
*
|
*
|
||||||
|
* @return array
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function normalizeFindParams($type, $data, $altType = null, $r = array(), $_this = null) {
|
function normalizeFindParams($type, $data, $altType = null, $r = array(), $_this = null) {
|
||||||
|
@ -2569,6 +2579,7 @@ class Model extends Overloadable {
|
||||||
* @param mixed $with The 'with' key of the model association
|
* @param mixed $with The 'with' key of the model association
|
||||||
* @param array $keys Any join keys which must be merged with the keys queried
|
* @param array $keys Any join keys which must be merged with the keys queried
|
||||||
* @return array
|
* @return array
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function joinModel($assoc, $keys = array()) {
|
function joinModel($assoc, $keys = array()) {
|
||||||
if (is_string($assoc)) {
|
if (is_string($assoc)) {
|
||||||
|
@ -2693,6 +2704,7 @@ class Model extends Overloadable {
|
||||||
* Called when unserializing a model
|
* Called when unserializing a model
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
|
* @todo
|
||||||
*/
|
*/
|
||||||
function __wakeup() {
|
function __wakeup() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ class CakeSchema extends Object {
|
||||||
* Builds schema object properties
|
* Builds schema object properties
|
||||||
*
|
*
|
||||||
* @param array $data loaded object properties
|
* @param array $data loaded object properties
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _build($data) {
|
function _build($data) {
|
||||||
|
|
|
@ -142,6 +142,7 @@ class Object {
|
||||||
*
|
*
|
||||||
* @param string $msg Log message
|
* @param string $msg Log message
|
||||||
* @param integer $type Error type constant. Defined in app/config/core.php.
|
* @param integer $type Error type constant. Defined in app/config/core.php.
|
||||||
|
* @return boolean Success of log write
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function log($msg, $type = LOG_ERROR) {
|
function log($msg, $type = LOG_ERROR) {
|
||||||
|
@ -160,6 +161,7 @@ class Object {
|
||||||
* Allows setting of multiple properties of the object in a single line of code.
|
* Allows setting of multiple properties of the object in a single line of code.
|
||||||
*
|
*
|
||||||
* @param array $properties An associative array containing properties and corresponding values.
|
* @param array $properties An associative array containing properties and corresponding values.
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _set($properties = array()) {
|
function _set($properties = array()) {
|
||||||
|
@ -237,7 +239,7 @@ class Object {
|
||||||
*
|
*
|
||||||
* @param string $name name used for object to cache
|
* @param string $name name used for object to cache
|
||||||
* @param object $object the object to persist
|
* @param object $object the object to persist
|
||||||
* @return true on save, throws error if file can not be created
|
* @return boolean true on save, throws error if file can not be created
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _savePersistent($name, &$object) {
|
function _savePersistent($name, &$object) {
|
||||||
|
@ -253,6 +255,7 @@ class Object {
|
||||||
*
|
*
|
||||||
* @param string $name Name of persisted class
|
* @param string $name Name of persisted class
|
||||||
* @param string $type Type of persistance (e.g: registry)
|
* @param string $type Type of persistance (e.g: registry)
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __openPersistent($name, $type = null) {
|
function __openPersistent($name, $type = null) {
|
||||||
|
|
|
@ -240,6 +240,7 @@ class Router extends Object {
|
||||||
*
|
*
|
||||||
* @param array $named A list of named parameters. Key value pairs are accepted where values are either regex strings to match, or arrays as seen above.
|
* @param array $named A list of named parameters. Key value pairs are accepted where values are either regex strings to match, or arrays as seen above.
|
||||||
* @param array $options Allows to control all settings: separator, greedy, reset, default
|
* @param array $options Allows to control all settings: separator, greedy, reset, default
|
||||||
|
* @return array
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -283,6 +284,7 @@ class Router extends Object {
|
||||||
* 'id' - The regular expression fragment to use when matching IDs. By default, matches
|
* 'id' - The regular expression fragment to use when matching IDs. By default, matches
|
||||||
* integer values and UUIDs.
|
* integer values and UUIDs.
|
||||||
* 'prefix' - URL prefix to use for the generated routes. Defaults to '/'.
|
* 'prefix' - URL prefix to use for the generated routes. Defaults to '/'.
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -312,7 +314,7 @@ class Router extends Object {
|
||||||
* @param string $route An empty string, or a route string "/"
|
* @param string $route An empty string, or a route string "/"
|
||||||
* @param array $default NULL or an array describing the default route
|
* @param array $default NULL or an array describing the default route
|
||||||
* @param array $params An array matching the named elements in the route to regular expressions which that element should match.
|
* @param array $params An array matching the named elements in the route to regular expressions which that element should match.
|
||||||
* @return string
|
* @return array
|
||||||
* @see routes
|
* @see routes
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
|
@ -580,7 +582,8 @@ class Router extends Object {
|
||||||
/**
|
/**
|
||||||
* Connects the default, built-in routes, including admin routes, and (deprecated) web services
|
* Connects the default, built-in routes, including admin routes, and (deprecated) web services
|
||||||
* routes.
|
* routes.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __connectDefaultRoutes() {
|
function __connectDefaultRoutes() {
|
||||||
|
@ -623,6 +626,7 @@ class Router extends Object {
|
||||||
* Takes parameter and path information back from the Dispatcher
|
* Takes parameter and path information back from the Dispatcher
|
||||||
*
|
*
|
||||||
* @param array $params Parameters and path information
|
* @param array $params Parameters and path information
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -697,6 +701,7 @@ class Router extends Object {
|
||||||
* Reloads default Router settings
|
* Reloads default Router settings
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
* @return void
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
function reload() {
|
function reload() {
|
||||||
|
@ -1282,6 +1287,7 @@ class Router extends Object {
|
||||||
* parsed, excluding querystring parameters (i.e. ?q=...).
|
* parsed, excluding querystring parameters (i.e. ?q=...).
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
* @return void
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
function parseExtensions() {
|
function parseExtensions() {
|
||||||
|
@ -1294,8 +1300,9 @@ class Router extends Object {
|
||||||
/**
|
/**
|
||||||
* Takes an passed params and converts it to args
|
* Takes an passed params and converts it to args
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @param array $params
|
* @param array $params
|
||||||
|
* @return array Array containing passed and named parameters
|
||||||
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
function getArgs($args, $options = array()) {
|
function getArgs($args, $options = array()) {
|
||||||
|
|
|
@ -103,6 +103,7 @@ class Sanitize {
|
||||||
* Strips extra whitespace from output
|
* Strips extra whitespace from output
|
||||||
*
|
*
|
||||||
* @param string $str String to sanitize
|
* @param string $str String to sanitize
|
||||||
|
* @return string whitespace sanitized string
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -114,6 +115,7 @@ class Sanitize {
|
||||||
* Strips image tags from output
|
* Strips image tags from output
|
||||||
*
|
*
|
||||||
* @param string $str String to sanitize
|
* @param string $str String to sanitize
|
||||||
|
* @return string Sting with images stripped.
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -127,6 +129,7 @@ class Sanitize {
|
||||||
* Strips scripts and stylesheets from output
|
* Strips scripts and stylesheets from output
|
||||||
*
|
*
|
||||||
* @param string $str String to sanitize
|
* @param string $str String to sanitize
|
||||||
|
* @return string String with <script>, <style>, <link> elements removed.
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -137,6 +140,7 @@ class Sanitize {
|
||||||
* Strips extra whitespace, images, scripts and stylesheets from output
|
* Strips extra whitespace, images, scripts and stylesheets from output
|
||||||
*
|
*
|
||||||
* @param string $str String to sanitize
|
* @param string $str String to sanitize
|
||||||
|
* @return string sanitized string
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function stripAll($str) {
|
function stripAll($str) {
|
||||||
|
@ -151,6 +155,7 @@ class Sanitize {
|
||||||
*
|
*
|
||||||
* @param string $str String to sanitize
|
* @param string $str String to sanitize
|
||||||
* @param string $tag Tag to remove (add more parameters as needed)
|
* @param string $tag Tag to remove (add more parameters as needed)
|
||||||
|
* @return string sanitized String
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -99,6 +99,7 @@ class Security extends Object {
|
||||||
* @return boolean Success
|
* @return boolean Success
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
|
* @todo Complete implementation
|
||||||
*/
|
*/
|
||||||
function validateAuthKey($authKey) {
|
function validateAuthKey($authKey) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -149,6 +150,7 @@ class Security extends Object {
|
||||||
*
|
*
|
||||||
* @param string $hash Method to use (sha1/sha256/md5)
|
* @param string $hash Method to use (sha1/sha256/md5)
|
||||||
* @access public
|
* @access public
|
||||||
|
* @return void
|
||||||
* @static
|
* @static
|
||||||
* @see Security::hash()
|
* @see Security::hash()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -175,6 +175,7 @@ class CakeSession extends Object {
|
||||||
* Determine if Session has been started.
|
* Determine if Session has been started.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
* @return boolean True if session has been started.
|
||||||
*/
|
*/
|
||||||
function started() {
|
function started() {
|
||||||
if (isset($_SESSION)) {
|
if (isset($_SESSION)) {
|
||||||
|
@ -198,7 +199,8 @@ class CakeSession extends Object {
|
||||||
return isset($result);
|
return isset($result);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
* Returns the Session id
|
||||||
|
*
|
||||||
* @param id $name string
|
* @param id $name string
|
||||||
* @return string Session id
|
* @return string Session id
|
||||||
* @access public
|
* @access public
|
||||||
|
@ -338,6 +340,7 @@ class CakeSession extends Object {
|
||||||
* Tells Session to write a notification when a certain session path or subpath is written to
|
* Tells Session to write a notification when a certain session path or subpath is written to
|
||||||
*
|
*
|
||||||
* @param mixed $var The variable path to watch
|
* @param mixed $var The variable path to watch
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function watch($var) {
|
function watch($var) {
|
||||||
|
@ -351,6 +354,7 @@ class CakeSession extends Object {
|
||||||
* Tells Session to stop watching a given key path
|
* Tells Session to stop watching a given key path
|
||||||
*
|
*
|
||||||
* @param mixed $var The variable path to watch
|
* @param mixed $var The variable path to watch
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function ignore($var) {
|
function ignore($var) {
|
||||||
|
@ -389,6 +393,7 @@ class CakeSession extends Object {
|
||||||
/**
|
/**
|
||||||
* Helper method to destroy invalid sessions.
|
* Helper method to destroy invalid sessions.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function destroy() {
|
function destroy() {
|
||||||
|
@ -549,6 +554,7 @@ class CakeSession extends Object {
|
||||||
/**
|
/**
|
||||||
* Helper method to create a new session.
|
* Helper method to create a new session.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _checkValid() {
|
function _checkValid() {
|
||||||
|
@ -586,6 +592,7 @@ class CakeSession extends Object {
|
||||||
/**
|
/**
|
||||||
* Helper method to restart a session.
|
* Helper method to restart a session.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __regenerateId() {
|
function __regenerateId() {
|
||||||
|
@ -643,6 +650,7 @@ class CakeSession extends Object {
|
||||||
*
|
*
|
||||||
* @param integer $errorNumber Number of the error
|
* @param integer $errorNumber Number of the error
|
||||||
* @param string $errorMessage Description of the error
|
* @param string $errorMessage Description of the error
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __setError($errorNumber, $errorMessage) {
|
function __setError($errorNumber, $errorMessage) {
|
||||||
|
|
|
@ -49,6 +49,7 @@ class Set extends Object {
|
||||||
* @param array $arr2 Array to merge with
|
* @param array $arr2 Array to merge with
|
||||||
* @return array Merged array
|
* @return array Merged array
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function merge($arr1, $arr2 = null) {
|
function merge($arr1, $arr2 = null) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
@ -77,6 +78,7 @@ class Set extends Object {
|
||||||
* @param boolean $isArray Force to tell $var is an array when $var is empty
|
* @param boolean $isArray Force to tell $var is an array when $var is empty
|
||||||
* @return mixed Either filtered array, or true/false when in callback
|
* @return mixed Either filtered array, or true/false when in callback
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function filter($var, $isArray = false) {
|
function filter($var, $isArray = false) {
|
||||||
if (is_array($var) && (!empty($var) || $isArray)) {
|
if (is_array($var) && (!empty($var) || $isArray)) {
|
||||||
|
@ -95,6 +97,7 @@ class Set extends Object {
|
||||||
* @param mixed $array2 Differences to push
|
* @param mixed $array2 Differences to push
|
||||||
* @return array Combined array
|
* @return array Combined array
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function pushDiff($array, $array2) {
|
function pushDiff($array, $array2) {
|
||||||
if (empty($array) && !empty($array2)) {
|
if (empty($array) && !empty($array2)) {
|
||||||
|
@ -121,6 +124,7 @@ class Set extends Object {
|
||||||
* @param string $tmp A temporary class name used as $class if $class is an array
|
* @param string $tmp A temporary class name used as $class if $class is an array
|
||||||
* @return object Hierarchical object
|
* @return object Hierarchical object
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function map($class = 'stdClass', $tmp = 'stdClass') {
|
function map($class = 'stdClass', $tmp = 'stdClass') {
|
||||||
if (is_array($class)) {
|
if (is_array($class)) {
|
||||||
|
@ -169,6 +173,7 @@ class Set extends Object {
|
||||||
* @param boolean $primary whether to assign first array key as the _name_
|
* @param boolean $primary whether to assign first array key as the _name_
|
||||||
* @return mixed Mapped object
|
* @return mixed Mapped object
|
||||||
* @access private
|
* @access private
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function __map(&$array, $class, $primary = false) {
|
function __map(&$array, $class, $primary = false) {
|
||||||
if ($class === true) {
|
if ($class === true) {
|
||||||
|
@ -224,6 +229,7 @@ class Set extends Object {
|
||||||
* @param array $array The array to check. If null, the value of the current Set object
|
* @param array $array The array to check. If null, the value of the current Set object
|
||||||
* @return boolean true if values are numeric, false otherwise
|
* @return boolean true if values are numeric, false otherwise
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function numeric($array = null) {
|
function numeric($array = null) {
|
||||||
if (empty($array)) {
|
if (empty($array)) {
|
||||||
|
@ -260,6 +266,7 @@ class Set extends Object {
|
||||||
* @param mixed $list can be an array or a comma-separated list.
|
* @param mixed $list can be an array or a comma-separated list.
|
||||||
* @return string the value of the array key or null if no match
|
* @return string the value of the array key or null if no match
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function enum($select, $list = null) {
|
function enum($select, $list = null) {
|
||||||
if (empty($list)) {
|
if (empty($list)) {
|
||||||
|
@ -282,6 +289,7 @@ class Set extends Object {
|
||||||
* @param array $keys An array containing one or more Set::extract()-style key paths
|
* @param array $keys An array containing one or more Set::extract()-style key paths
|
||||||
* @return array An array of strings extracted from $keys and formatted with $format
|
* @return array An array of strings extracted from $keys and formatted with $format
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function format($data, $format, $keys) {
|
function format($data, $format, $keys) {
|
||||||
|
|
||||||
|
@ -357,6 +365,7 @@ class Set extends Object {
|
||||||
* @param string $options Currently only supports 'flatten' which can be disabled for higher XPath-ness
|
* @param string $options Currently only supports 'flatten' which can be disabled for higher XPath-ness
|
||||||
* @return array An array of matched items
|
* @return array An array of matched items
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function extract($path, $data = null, $options = array()) {
|
function extract($path, $data = null, $options = array()) {
|
||||||
if (empty($data) && is_string($path) && $path{0} === '/') {
|
if (empty($data) && is_string($path) && $path{0} === '/') {
|
||||||
|
@ -470,6 +479,7 @@ class Set extends Object {
|
||||||
* @param integer $i Optional: The 'nth'-number of the item being matched.
|
* @param integer $i Optional: The 'nth'-number of the item being matched.
|
||||||
* @return boolean
|
* @return boolean
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function matches($conditions, $data = array(), $i = null, $length = null) {
|
function matches($conditions, $data = array(), $i = null, $length = null) {
|
||||||
if (empty($conditions)) {
|
if (empty($conditions)) {
|
||||||
|
@ -543,6 +553,7 @@ class Set extends Object {
|
||||||
* @param mixed $path As an array, or as a dot-separated string.
|
* @param mixed $path As an array, or as a dot-separated string.
|
||||||
* @return array Extracted data
|
* @return array Extracted data
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function classicExtract($data, $path = null) {
|
function classicExtract($data, $path = null) {
|
||||||
if (empty($path)) {
|
if (empty($path)) {
|
||||||
|
@ -627,6 +638,7 @@ class Set extends Object {
|
||||||
* @param array $data Data to insert
|
* @param array $data Data to insert
|
||||||
* @return array
|
* @return array
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function insert($list, $path, $data = null) {
|
function insert($list, $path, $data = null) {
|
||||||
if (!is_array($path)) {
|
if (!is_array($path)) {
|
||||||
|
@ -656,6 +668,7 @@ class Set extends Object {
|
||||||
* @param mixed $path A dot-separated string.
|
* @param mixed $path A dot-separated string.
|
||||||
* @return array Array with $path removed from its value
|
* @return array Array with $path removed from its value
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function remove($list, $path = null) {
|
function remove($list, $path = null) {
|
||||||
if (empty($path)) {
|
if (empty($path)) {
|
||||||
|
@ -688,6 +701,7 @@ class Set extends Object {
|
||||||
* @param mixed $path A dot-separated string.
|
* @param mixed $path A dot-separated string.
|
||||||
* @return boolean true if path is found, false otherwise
|
* @return boolean true if path is found, false otherwise
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function check($data, $path = null) {
|
function check($data, $path = null) {
|
||||||
if (empty($path)) {
|
if (empty($path)) {
|
||||||
|
@ -719,6 +733,7 @@ class Set extends Object {
|
||||||
* @param mixed $val2 Second value
|
* @param mixed $val2 Second value
|
||||||
* @return array Computed difference
|
* @return array Computed difference
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function diff($val1, $val2 = null) {
|
function diff($val1, $val2 = null) {
|
||||||
if (empty($val1)) {
|
if (empty($val1)) {
|
||||||
|
@ -754,6 +769,7 @@ class Set extends Object {
|
||||||
* @param array $val2 Second value
|
* @param array $val2 Second value
|
||||||
* @return boolean true if they are equal, false otherwise
|
* @return boolean true if they are equal, false otherwise
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function isEqual($val1, $val2 = null) {
|
function isEqual($val1, $val2 = null) {
|
||||||
return ($val1 == $val2);
|
return ($val1 == $val2);
|
||||||
|
@ -765,6 +781,7 @@ class Set extends Object {
|
||||||
* @param array $val2 Second value
|
* @param array $val2 Second value
|
||||||
* @return boolean true if $val1 contains $val2, false otherwise
|
* @return boolean true if $val1 contains $val2, false otherwise
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function contains($val1, $val2 = null) {
|
function contains($val1, $val2 = null) {
|
||||||
if (empty($val1) || empty($val2)) {
|
if (empty($val1) || empty($val2)) {
|
||||||
|
@ -791,6 +808,7 @@ class Set extends Object {
|
||||||
* @param integer $count Start the dimension count at this number
|
* @param integer $count Start the dimension count at this number
|
||||||
* @return integer The number of dimensions in $array
|
* @return integer The number of dimensions in $array
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function countDim($array = null, $all = false, $count = 0) {
|
function countDim($array = null, $all = false, $count = 0) {
|
||||||
if ($all) {
|
if ($all) {
|
||||||
|
@ -819,6 +837,7 @@ class Set extends Object {
|
||||||
* @param boolean $trim If true, separated strings will be trimmed
|
* @param boolean $trim If true, separated strings will be trimmed
|
||||||
* @return array
|
* @return array
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function normalize($list, $assoc = true, $sep = ',', $trim = true) {
|
function normalize($list, $assoc = true, $sep = ',', $trim = true) {
|
||||||
if (is_string($list)) {
|
if (is_string($list)) {
|
||||||
|
@ -870,6 +889,7 @@ class Set extends Object {
|
||||||
* @param string $groupPath As an array, or as a dot-separated string.
|
* @param string $groupPath As an array, or as a dot-separated string.
|
||||||
* @return array Combined array
|
* @return array Combined array
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function combine($data, $path1 = null, $path2 = null, $groupPath = null) {
|
function combine($data, $path1 = null, $path2 = null, $groupPath = null) {
|
||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
|
@ -926,6 +946,7 @@ class Set extends Object {
|
||||||
*
|
*
|
||||||
* @param object $object Object to reverse
|
* @param object $object Object to reverse
|
||||||
* @return array
|
* @return array
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function reverse($object) {
|
function reverse($object) {
|
||||||
$out = array();
|
$out = array();
|
||||||
|
@ -973,6 +994,7 @@ class Set extends Object {
|
||||||
* @param string $separator String used to separate array key elements in a path, defaults to '.'
|
* @param string $separator String used to separate array key elements in a path, defaults to '.'
|
||||||
* @return array
|
* @return array
|
||||||
* @access public
|
* @access public
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function flatten($data, $separator = '.') {
|
function flatten($data, $separator = '.') {
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -1028,6 +1050,7 @@ class Set extends Object {
|
||||||
* @param string $path A Set-compatible path to the array value
|
* @param string $path A Set-compatible path to the array value
|
||||||
* @param string $dir asc/desc
|
* @param string $dir asc/desc
|
||||||
* @return array
|
* @return array
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
function sort($data, $path, $dir) {
|
function sort($data, $path, $dir) {
|
||||||
$result = Set::__flatten(Set::extract($data, $path));
|
$result = Set::__flatten(Set::extract($data, $path));
|
||||||
|
|
|
@ -124,7 +124,7 @@ class String extends Object {
|
||||||
*
|
*
|
||||||
* @param string $data The data to tokenize
|
* @param string $data The data to tokenize
|
||||||
* @param string $separator The token to split the data on
|
* @param string $separator The token to split the data on
|
||||||
* @return string
|
* @return array
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
@ -265,7 +265,7 @@ class String extends Object {
|
||||||
*
|
*
|
||||||
* @param string $str
|
* @param string $str
|
||||||
* @param string $options
|
* @param string $options
|
||||||
* @return void
|
* @return string
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function cleanInsert($str, $options) {
|
function cleanInsert($str, $options) {
|
||||||
|
|
|
@ -303,7 +303,7 @@ class Validation extends Object {
|
||||||
* is greater >, is less <, greater or equal >=
|
* is greater >, is less <, greater or equal >=
|
||||||
* less or equal <=, is less <, equal to ==, not equal !=
|
* less or equal <=, is less <, equal to ==, not equal !=
|
||||||
* @param integer $check2 only needed if $check1 is a string
|
* @param integer $check2 only needed if $check1 is a string
|
||||||
* @return bool
|
* @return boolean Success
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function comparison($check1, $operator = null, $check2 = null) {
|
function comparison($check1, $operator = null, $check2 = null) {
|
||||||
|
@ -535,6 +535,7 @@ class Validation extends Object {
|
||||||
*
|
*
|
||||||
* @param mixed $check Value to check
|
* @param mixed $check Value to check
|
||||||
* @param mixed $comparedTo Value to compare
|
* @param mixed $comparedTo Value to compare
|
||||||
|
* @return boolean Success
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function equalTo($check, $comparedTo) {
|
function equalTo($check, $comparedTo) {
|
||||||
|
@ -545,6 +546,7 @@ class Validation extends Object {
|
||||||
*
|
*
|
||||||
* @param mixed $check Value to check
|
* @param mixed $check Value to check
|
||||||
* @param array $extensions file extenstions to allow
|
* @param array $extensions file extenstions to allow
|
||||||
|
* @return boolean Success
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) {
|
function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) {
|
||||||
|
@ -568,6 +570,7 @@ class Validation extends Object {
|
||||||
*
|
*
|
||||||
* @param mixed $check Value to check
|
* @param mixed $check Value to check
|
||||||
* @access public
|
* @access public
|
||||||
|
* @todo finish implementation
|
||||||
*/
|
*/
|
||||||
function file($check) {
|
function file($check) {
|
||||||
// if (is_array($check)) {
|
// if (is_array($check)) {
|
||||||
|
@ -655,6 +658,7 @@ class Validation extends Object {
|
||||||
* in => provide a list of choices that selections must be made from
|
* in => provide a list of choices that selections must be made from
|
||||||
* max => maximun number of non-zero choices that can be made
|
* max => maximun number of non-zero choices that can be made
|
||||||
* min => minimum number of non-zero choices that can be made
|
* min => minimum number of non-zero choices that can be made
|
||||||
|
* @return boolean Success
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function multiple($check, $options = array()) {
|
function multiple($check, $options = array()) {
|
||||||
|
@ -768,6 +772,7 @@ class Validation extends Object {
|
||||||
* @param string $check Value to check
|
* @param string $check Value to check
|
||||||
* @param integer $lower Lower limit
|
* @param integer $lower Lower limit
|
||||||
* @param integer $upper Upper limit
|
* @param integer $upper Upper limit
|
||||||
|
* @return boolean Success
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function range($check, $lower = null, $upper = null ) {
|
function range($check, $lower = null, $upper = null ) {
|
||||||
|
@ -881,6 +886,7 @@ class Validation extends Object {
|
||||||
* an array.
|
* an array.
|
||||||
*
|
*
|
||||||
* @param array $params Parameters sent to validation method
|
* @param array $params Parameters sent to validation method
|
||||||
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _extract($params) {
|
function _extract($params) {
|
||||||
|
@ -940,7 +946,8 @@ class Validation extends Object {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Reset internal variables for another validation run.
|
* Reset internal variables for another validation run.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __reset() {
|
function __reset() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue