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:
mark_story 2008-09-25 16:49:56 +00:00
parent bd57349665
commit 62168bfe0f
32 changed files with 277 additions and 45 deletions

View file

@ -68,6 +68,7 @@ class Cache extends Object {
*
* @return object
* @access public
* @static
*/
function &getInstance() {
static $instance = array();
@ -97,6 +98,7 @@ class Cache extends Object {
* @param array $settings Optional associative array of settings passed to the engine
* @return array(engine, settings) on success, false on failure
* @access public
* @static
*/
function config($name = null, $settings = array()) {
$_this =& Cache::getInstance();
@ -142,6 +144,7 @@ class Cache extends Object {
* @param array $settings Optional associative array of settings passed to the engine
* @return boolean True on success, false on failure
* @access public
* @static
*/
function engine($name = 'File', $settings = array()) {
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 string $value Optional for a simple name-value pair
* @return void
* @return array of settings
* @access public
* @static
*/
function set($settings = array(), $value = null) {
$_this =& Cache::getInstance();
@ -207,7 +211,9 @@ class Cache extends Object {
*
* Permanently remove all expired and deleted data
*
* @return void
* @access public
* @static
*/
function gc() {
$_this =& Cache::getInstance();
@ -224,6 +230,7 @@ class Cache extends Object {
* or array('config' => 'string configuration name', 'duration' => 'duration for expiration')
* @return boolean True if the data was successfully cached, false on failure
* @access public
* @static
*/
function write($key, $value, $config = null) {
$_this =& Cache::getInstance();
@ -280,6 +287,7 @@ class Cache extends Object {
* @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
* @access public
* @static
*/
function read($key, $config = null) {
$_this =& Cache::getInstance();
@ -315,6 +323,7 @@ class Cache extends Object {
* @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
* @access public
* @static
*/
function delete($key, $config = null) {
$_this =& Cache::getInstance();
@ -348,6 +357,7 @@ class Cache extends Object {
* @param string $config name of the configuration to use
* @return boolean True if the cache was succesfully cleared, false otherwise
* @access public
* @static
*/
function clear($check = false, $config = null) {
$_this =& Cache::getInstance();
@ -376,6 +386,7 @@ class Cache extends Object {
* @param string $config Name of the configuration setting
* @return bool
* @access public
* @static
*/
function isInitialized($engine = null) {
if (Configure::read('Cache.disable')) {
@ -394,6 +405,7 @@ class Cache extends Object {
* @param string $engine Name of the engine
* @return array list of settings for this engine
* @access public
* @static
*/
function settings($engine = null) {
$_this =& Cache::getInstance();

View file

@ -64,6 +64,7 @@ class CakeLog {
* @param string $msg Message to log
* @return boolean Success
* @access public
* @static
*/
function write($type, $msg) {
if (!defined('LOG_ERROR')) {

View file

@ -86,6 +86,8 @@ class ClassRegistry {
*
* @param string $type TypeOfClass
* @return object intance of ClassName
* @access public
* @static
*/
function &init($class, $type = null) {
$_this =& ClassRegistry::getInstance();
@ -171,6 +173,7 @@ class ClassRegistry {
* @param mixed $object Object to store
* @return boolean True if the object was written, false if $key already exists
* @access public
* @static
*/
function addObject($key, &$object) {
$_this =& ClassRegistry::getInstance();
@ -185,7 +188,9 @@ class ClassRegistry {
* Remove object which corresponds to given key.
*
* @param string $key Key of object to remove from registry
* @return void
* @access public
* @static
*/
function removeObject($key) {
$_this =& ClassRegistry::getInstance();
@ -200,6 +205,7 @@ class ClassRegistry {
* @param string $key Key to look for
* @return boolean true if key exists in registry, false otherwise
* @access public
* @static
*/
function isKeySet($key) {
$_this =& ClassRegistry::getInstance();
@ -216,6 +222,7 @@ class ClassRegistry {
*
* @return array Set of keys stored in registry
* @access public
* @static
*/
function keys() {
$_this =& ClassRegistry::getInstance();
@ -227,6 +234,7 @@ class ClassRegistry {
* @param string $key Key of object to look for
* @return mixed Object stored in registry
* @access public
* @static
*/
function &getObject($key) {
$_this =& ClassRegistry::getInstance();
@ -243,7 +251,7 @@ class ClassRegistry {
return $return;
}
/*
/**
* Sets the default constructor parameter for an object type
*
* @param string $type Type of object. If this parameter is omitted, defaults to "Model"
@ -251,6 +259,8 @@ class ClassRegistry {
* of $type are created
* @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.
* @access public
* @static
*/
function config($type, $param = array()) {
$_this =& ClassRegistry::getInstance();
@ -272,6 +282,8 @@ class ClassRegistry {
* @param string $alias
* @param string $class
* @return boolean
* @access protected
* @static
*/
function &_duplicate($alias, $class) {
$_this =& ClassRegistry::getInstance();
@ -291,6 +303,7 @@ class ClassRegistry {
* @param string $key Key to include in map
* @param string $name Key that is being mapped
* @access public
* @static
*/
function map($key, $name) {
$_this =& ClassRegistry::getInstance();
@ -305,6 +318,7 @@ class ClassRegistry {
*
* @return array Keys of registry's map
* @access public
* @static
*/
function mapKeys() {
$_this =& ClassRegistry::getInstance();
@ -316,6 +330,7 @@ class ClassRegistry {
* @param string $key Key to find in map
* @return string Mapped value
* @access private
* @static
*/
function __getMap($key) {
$_this =& ClassRegistry::getInstance();
@ -326,7 +341,9 @@ class ClassRegistry {
/**
* Flushes all objects from the ClassRegistry.
*
* @return void
* @access public
* @static
*/
function flush() {
$_this =& ClassRegistry::getInstance();

View file

@ -242,6 +242,7 @@ class Configure extends Object {
*
* @param array $config Name of var to write
* @param mixed $value Value to set for var
* @return void
* @access public
*/
function write($config, $value = null) {
@ -341,6 +342,7 @@ class Configure extends Object {
* Configure::delete('Name.key'); will delete only the Configure::Name[key]
*
* @param string $var the var to be deleted
* @return void
* @access public
*/
function delete($var = null) {
@ -362,6 +364,7 @@ class Configure extends Object {
* 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
* @return mixed false if file not found, void if load successful
* @access public
*/
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 $name file name.
* @param array $data array of values to store.
* @return void
* @access public
*/
function store($type, $name, $data = array()) {
@ -502,6 +506,7 @@ class Configure extends Object {
* @param string $content Content to write on file
* @param string $name Name to use for cache file
* @param boolean $write true if content should be written, false otherwise
* @return void
* @access private
*/
function __writeConfig($content, $name, $write = true) {
@ -550,6 +555,7 @@ class Configure extends Object {
* Sets the paths for the given object type
*
* @param array $paths paths defines in config/bootstrap.php
* @return void
* @access private
*/
function buildPaths($paths) {
@ -597,6 +603,7 @@ class Configure extends Object {
* they will be added to the paths vars
*
* @param boolean $boot Load application bootstrap (if true)
* @return void
* @access private
*/
function __loadBootstrap($boot) {
@ -914,6 +921,7 @@ class App extends Object {
*
* @param string $file full path to file including file name
* @return boolean
* @access private
*/
function __load($file) {
if (empty($file)) {
@ -1117,6 +1125,8 @@ class App extends Object {
* @param string $name name of object
* @param string $type type of object
* @param string $plugin name of plugin
* @return void
* @access private
*/
function __remove($name, $type, $plugin) {
$_this =& App::getInstance();
@ -1132,6 +1142,7 @@ class App extends Object {
* Object destructor
*
* Write cache file if changes have been made to the $__map or $__paths
* @return void
* @access private
*/
function __destruct() {

View file

@ -55,6 +55,7 @@ class Component extends Object {
* Used to initialize the components for current controller
*
* @param object $controller Controller with components to load
* @return void
* @access public
*/
function init(&$controller) {
@ -73,6 +74,7 @@ class Component extends Object {
* Called before the Controller::beforeFilter()
*
* @param object $controller Controller with components to initialize
* @return void
* @access public
*/
function initialize(&$controller) {
@ -91,6 +93,7 @@ class Component extends Object {
* Called after the Controller::beforeFilter() and before the controller action
*
* @param object $controller Controller with components to startup
* @return void
* @access public
*/
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()
*
* @param object $controller Controller with components to beforeRender
* @return void
* @access public
*/
function beforeRender(&$controller) {
@ -119,6 +123,7 @@ class Component extends Object {
* Called before Controller::redirect();
*
* @param object $controller Controller with components to beforeRedirect
* @return void
* @access public
*/
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
*
* @param object $controller Controller with components to shutdown
* @return void
* @access public
*/
function shutdown(&$controller) {

View file

@ -254,6 +254,7 @@ class DbAcl extends AclBase {
* Enter description here...
*
* @param object $component
* @return void
* @access public
*/
function initialize(&$component) {

View file

@ -220,6 +220,7 @@ class AuthComponent extends Object {
* Initializes AuthComponent for use in the controller
*
* @param object $controller A reference to the instantiating controller object
* @return void
* @access public
*/
function initialize(&$controller) {
@ -251,6 +252,7 @@ class AuthComponent extends Object {
* of login form data.
*
* @param object $controller A reference to the instantiating controller object
* @return boolean
* @access public
*/
function startup(&$controller) {
@ -380,6 +382,7 @@ class AuthComponent extends Object {
* $userModel and $sessionKey.
*
* @param object $controller A reference to the instantiating controller object
* @return boolean
* @access private
*/
function __setDefaults() {
@ -511,6 +514,7 @@ class AuthComponent extends Object {
* @param string $action Controller action name
* @param string $action Controller action name
* @param string ... etc.
* @return void
* @access public
*/
function allow() {
@ -530,6 +534,7 @@ class AuthComponent extends Object {
* @param string $action Controller action name
* @param string $action Controller action name
* @param string ... etc.
* @return void
* @see AuthComponent::allow()
* @access public
*/
@ -547,6 +552,7 @@ class AuthComponent extends Object {
* Maps action names to CRUD operations. Used for controller-based authentication.
*
* @param array $map Actions to map
* @return void
* @access public
*/
function mapActions($map = array()) {
@ -605,7 +611,8 @@ class AuthComponent extends Object {
/**
* 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
*/
function user($key = null) {

View file

@ -270,6 +270,7 @@ class CookieComponent extends Object {
* Failure to do so will result in header already sent errors.
*
* @param string $key Key of the value to be deleted
* @return void
* @access public
*/
function del($key) {
@ -298,6 +299,7 @@ class CookieComponent extends Object {
* You must use this method before any output is sent to the browser.
* Failure to do so will result in header already sent errors.
*
* @return void
* @access public
*/
function destroy() {
@ -416,13 +418,13 @@ class CookieComponent extends Object {
}
}
} else {
$pos = strpos($value, 'Q2FrZQ==.');
$decrypted[$name] = $this->__explode($value);
$pos = strpos($value, 'Q2FrZQ==.');
$decrypted[$name] = $this->__explode($value);
if ($pos !== false) {
$value = substr($value, 8);
$decrypted[$name] = $this->__explode(Security::$type(base64_decode($value), $this->key));
}
if ($pos !== false) {
$value = substr($value, 8);
$decrypted[$name] = $this->__explode(Security::$type(base64_decode($value), $this->key));
}
}
}

View file

@ -157,6 +157,7 @@ class RequestHandlerComponent extends Object {
* as the first item.
*
* @param object $controller A reference to the controller
* @return void
* @see Router::parseExtensions()
* @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.
*
* @param object $controller A reference to the controller
* @return void
* @access public
*/
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 mixed $type The Content-type or array of Content-types assigned to the name,
* i.e. "text/html", or "application/xml"
* @return void
* @access public
*/
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)
*
* @param mixed $type Can be null (or no parameter), a string type name, or an array of types
* @return mixed
* @access public
*/
function requestedWith($type = null) {
@ -546,6 +550,7 @@ class RequestHandlerComponent extends Object {
*
* @param object $controller A reference to a controller object
* @param string $type Type of response to send (e.g: 'ajax')
* @return void
* @access public
* @see RequestHandlerComponent::setContent()
* @see RequestHandlerComponent::respondAs()

View file

@ -192,6 +192,7 @@ class SecurityComponent extends Object {
/**
* Sets the actions that require a POST request, or empty for all actions
*
* @return void
* @access public
*/
function requirePost() {
@ -201,6 +202,7 @@ class SecurityComponent extends Object {
/**
* Sets the actions that require a GET request, or empty for all actions
*
* @return void
* @access public
*/
function requireGet() {
@ -210,6 +212,7 @@ class SecurityComponent extends Object {
/**
* Sets the actions that require a PUT request, or empty for all actions
*
* @return void
* @access public
*/
function requirePut() {
@ -219,6 +222,7 @@ class SecurityComponent extends Object {
/**
* Sets the actions that require a DELETE request, or empty for all actions
*
* @return void
* @access public
*/
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
*
* @return void
* @access public
*/
function requireSecure() {
@ -237,6 +242,7 @@ class SecurityComponent extends Object {
/**
* Sets the actions that require an authenticated request, or empty for all actions
*
* @return void
* @access public
*/
function requireAuth() {
@ -246,6 +252,7 @@ class SecurityComponent extends Object {
/**
* Sets the actions that require an HTTP-authenticated request, or empty for all actions
*
* @return void
* @access public
*/
function requireLogin() {
@ -393,6 +400,7 @@ class SecurityComponent extends Object {
*
* @param string $method The HTTP method to assign controller actions to
* @param array $actions Controller actions to set the required HTTP method to.
* @return void
* @access protected
*/
function _requireMethod($method, $actions = array()) {
@ -642,6 +650,7 @@ class SecurityComponent extends Object {
* Sets the default login options for an HTTP-authenticated request
*
* @param array $options Default login options
* @return void
* @access protected
*/
function _setLoginDefaults(&$options) {

View file

@ -76,6 +76,7 @@ class SessionComponent extends CakeSession {
* Initializes the component, gets a reference to Controller::$param['bare'].
*
* @param object $controller A reference to the controller
* @return void
* @access public
*/
function initialize(&$controller) {
@ -87,6 +88,7 @@ class SessionComponent extends CakeSession {
* Startup method.
*
* @param object $controller Instantiating controller
* @return void
* @access public
*/
function startup(&$controller) {
@ -98,6 +100,7 @@ class SessionComponent extends CakeSession {
* Starts Session on if 'Session.start' is set to false in core.php
*
* @param string $base The base path for the Session
* @return void
* @access public
*/
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.
* This should be in a Controller.key format for better organizing
* @param string $value The value you want to store in a session.
* @return boolean Success
* @access public
*/
function write($name, $value = null) {
@ -239,6 +243,7 @@ class SessionComponent extends CakeSession {
*
* In your controller: $this->Session->renew();
*
* @return void
* @access public
*/
function renew() {
@ -267,6 +272,7 @@ class SessionComponent extends CakeSession {
*
* In your controller: $this->Session->destroy();
*
* @return void
* @access public
*/
function destroy() {
@ -291,7 +297,8 @@ class SessionComponent extends CakeSession {
/**
* Starts Session if SessionComponent is used in Controller::beforeFilter(),
* or is called from
*
*
* @return boolean
* @access private
*/
function __start() {

View file

@ -301,6 +301,7 @@ class Controller extends Object {
/**
* Merge components, helpers, and uses vars from AppController and PluginAppController
*
* @return void
* @access protected
*/
function __mergeVars() {
@ -472,6 +473,7 @@ class Controller extends Object {
* within the app, or an absolute URL
* @param integer $status Optional HTTP status code (eg: 404)
* @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
*/
function redirect($url, $status = null, $exit = true) {
@ -575,7 +577,7 @@ class Controller extends Object {
}
}
/**
* undocumented function
* Conveinence method for header()
*
* @param string $status
* @return void
@ -590,6 +592,7 @@ class Controller extends Object {
* @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).
* Unused if $one is an associative array, otherwise serves as the values to $one's keys.
* @return void
* @access public
*/
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
*
* @return void
* @access public
*/
function disableCache() {
@ -789,6 +793,7 @@ class Controller extends Object {
* @param string $message Message to display to the user
* @param string $url Relative URL to redirect to after the time expires
* @param integer $pause Time to show the message
* @return void Renders flash layout
* @access public
*/
function flash($message, $url, $pause = 1) {

View file

@ -195,7 +195,8 @@ class Scaffold extends Object {
/**
* Outputs the content of a scaffold method passing it through the Controller::afterFilter()
*
* @access private
* @return void
* @access protected
*/
function _output() {
$this->controller->afterFilter();

View file

@ -92,6 +92,7 @@ class Debugger extends Object {
*
* @return object
* @access public
* @static
*/
function &getInstance() {
static $instance = array();
@ -106,15 +107,26 @@ class Debugger extends Object {
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) {
$_this = Debugger::getInstance();
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) {
$_this = Debugger::getInstance();
$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
* @return string Formatted stack trace
* @access public
* @static
*/
function trace($options = array()) {
$options = array_merge(array(
@ -289,6 +302,7 @@ class Debugger extends Object {
* @param string $path Path to shorten
* @return string Normalized path
* @access public
* @static
*/
function trimPath($path) {
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
* @return array Set of lines highlighted
* @access public
* @static
*/
function excerpt($file, $line, $context = 2) {
$data = $lines = array();
@ -345,6 +360,7 @@ class Debugger extends Object {
* @param string $var Variable to convert
* @return string Variable as a formatted string
* @access public
* @static
*/
function exportVar($var, $recursion = 0) {
$_this = Debugger::getInstance();
@ -395,6 +411,7 @@ class Debugger extends Object {
* Handles object conversion to debug string
*
* @param string $var Object to convert
* @return string
* @access private
*/
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>]";
if (Configure::read() > 0) {
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\")";
e("<a href='javascript:void(0);' onclick='{$link}'>Code</a>");
echo "<a href='javascript:void(0);' onclick='{$link}'>Code</a>";
if (!empty($context)) {
$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)) {
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;\">");
e(implode("\n", $context));
e("</pre>");
echo "<pre id=\"CakeErrorContext" . count($_this->errors) . "\" class=\"cake-context\" style=\"display: none;\">";
echo implode("\n", $context);
echo "</pre>";
}
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);
e('</div>');
echo '</div>';
}
pr($trace, false);
e('</div>');
echo '</div>';
}
break;
case 'html':
@ -517,6 +534,7 @@ class Debugger extends Object {
* Verify that the application's salt has been changed from the default value
*
* @access public
* @static
*/
function checkSessionKey() {
if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') {
@ -529,6 +547,7 @@ class Debugger extends Object {
*
* @param object $debugger A reference to the Debugger object
* @access public
* @static
*/
function invoke(&$debugger) {
set_error_handler(array(&$debugger, 'handleError'));

View file

@ -436,6 +436,7 @@ class File extends Object {
* Returns the File's owner.
*
* @return integer the Fileowner
* @access public
*/
function owner() {
if ($this->exists()) {

View file

@ -490,6 +490,7 @@ class Folder extends Object {
* Returns the size in bytes of this Folder.
*
* @param string $directory Path to directory
* @return int size in bytes of current folder
* @access public
*/
function dirsize() {

View file

@ -144,6 +144,7 @@ class Inflector extends Object {
/**
* Initializes plural inflection rules
*
* @return void
* @access protected
*/
function __initPluralRules() {
@ -271,6 +272,7 @@ class Inflector extends Object {
/**
* Initializes singular inflection rules
*
* @return void
* @access protected
*/
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.
*
* @param string $tableName Name of database table to get class name for
* @return string
* @return string Class name
* @access public
* @static
*/
@ -470,7 +472,7 @@ class Inflector extends Object {
* Returns camelBacked version of a string.
*
* @param string $string
* @return string
* @return string in variable form
* @access public
* @static
*/

View file

@ -150,6 +150,7 @@ class ModelBehavior extends Object {
*
* @see Object::dispatchMethod
* @access public
* @return mixed
*/
function dispatchMethod(&$model, $method, $params = array()) {
if (empty($params)) {
@ -244,6 +245,7 @@ class BehaviorCollection extends Object {
* Attaches a model object and loads a list of behaviors
*
* @access public
* @return void
*/
function init($modelName, $behaviors = array()) {
$this->modelName = $modelName;
@ -317,6 +319,7 @@ class BehaviorCollection extends Object {
* Detaches a behavior from a model
*
* @param string $name CamelCased name of the behavior to unload
* @return void
* @access public
*/
function detach($name) {

View file

@ -48,6 +48,7 @@ class AclBehavior extends ModelBehavior {
*
* @param mixed $config
* @return void
* @access public
*/
function setup(&$model, $config = array()) {
if (is_string($config)) {
@ -69,6 +70,7 @@ class AclBehavior extends ModelBehavior {
*
* @param mixed $ref
* @return array
* @access public
*/
function node(&$model, $ref = null) {
$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
* @return void
* @access public
*/
function afterSave(&$model, $created) {
if ($created) {
@ -105,6 +108,7 @@ class AclBehavior extends ModelBehavior {
* Destroys the ARO/ACO node bound to the deleted record
*
* @return void
* @access public
*/
function afterDelete(&$model) {
$type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])];

View file

@ -92,6 +92,7 @@ class ContainableBehavior extends ModelBehavior {
*
* @param object $Model Model using the behavior
* @param array $query Query parameters as set by cake
* @return array
* @access public
*/
function beforeFind(&$Model, $query) {
@ -223,6 +224,7 @@ class ContainableBehavior extends ModelBehavior {
* parameters unbinds all related models.
*
* @param object $Model Model on which binding restriction is being applied
* @return void
* @access public
*/
function contain(&$Model) {
@ -236,6 +238,7 @@ class ContainableBehavior extends ModelBehavior {
* contain call.
*
* @param object $Model Model on which to reset bindings
* @return void
* @access public
*/
function resetBindings(&$Model) {

View file

@ -51,6 +51,10 @@ class TranslateBehavior extends ModelBehavior {
*
* $config could be empty - and translations configured dynamically by
* bindTranslation() method
*
* @param array $config
* @return mixed
* @access public
*/
function setup(&$model, $config = array()) {
$db =& ConnectionManager::getDataSource($model->useDbConfig);
@ -66,6 +70,9 @@ class TranslateBehavior extends ModelBehavior {
}
/**
* Callback
*
* @return void
* @access public
*/
function cleanup(&$model) {
$this->unbindTranslation($model);
@ -73,7 +80,11 @@ class TranslateBehavior extends ModelBehavior {
unset($this->runtime[$model->alias]);
}
/**
* Callback
* beforeFind Callback
*
* @param array $query
* @return array Modified query
* @access public
*/
function beforeFind(&$model, $query) {
$locale = $this->_getLocale($model);
@ -182,7 +193,12 @@ class TranslateBehavior extends ModelBehavior {
return $query;
}
/**
* Callback
* afterFind Callback
*
* @param array $results
* @param boolean $primary
* @return array Modified results
* @access public
*/
function afterFind(&$model, $results, $primary) {
$this->runtime[$model->alias]['fields'] = array();
@ -221,7 +237,10 @@ class TranslateBehavior extends ModelBehavior {
return $results;
}
/**
* Callback
* beforeValidate Callback
*
* @return boolean
* @access public
*/
function beforeValidate(&$model) {
$locale = $this->_getLocale($model);
@ -250,7 +269,11 @@ class TranslateBehavior extends ModelBehavior {
return true;
}
/**
* Callback
* afterSave Callback
*
* @param boolean $created
* @return void
* @access public
*/
function afterSave(&$model, $created) {
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) {
$RuntimeModel =& $this->translateModel($model);
@ -300,6 +326,7 @@ class TranslateBehavior extends ModelBehavior {
* Get selected locale for model
*
* @return mixed string or false
* @access protected
*/
function _getLocale(&$model) {
if (!isset($model->locale) || is_null($model->locale)) {
@ -317,6 +344,7 @@ class TranslateBehavior extends ModelBehavior {
* Get instance of model for translations
*
* @return object
* @access public
*/
function &translateModel(&$model) {
if (!isset($this->runtime[$model->alias]['model'])) {

View file

@ -35,14 +35,30 @@
* @subpackage cake.cake.libs.model.behaviors
*/
class TreeBehavior extends ModelBehavior {
/**
* Errors
*
* @var array
*/
var $errors = array();
/**
* Defaults
*
* @var array
* @access protected
*/
var $_defaults = array(
'parent' => 'parent_id', 'left' => 'lft', 'right' => 'rght',
'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()) {
if (!is_array($config)) {
$config = array('type' => $config);
@ -66,6 +82,7 @@ class TreeBehavior extends ModelBehavior {
* @param AppModel $model
* @param boolean $created indicates whether the node just saved was created or updated
* @return boolean true on success, false on failure
* @access public
*/
function afterSave(&$model, $created) {
extract($this->settings[$model->alias]);
@ -85,6 +102,7 @@ class TreeBehavior extends ModelBehavior {
*
* @param AppModel $model
* @return boolean true to continue, false to abort the delete
* @access public
*/
function beforeDelete(&$model) {
extract($this->settings[$model->alias]);
@ -116,6 +134,7 @@ class TreeBehavior extends ModelBehavior {
* @since 1.2
* @param AppModel $model
* @return boolean true to continue, false to abort the save
* @access public
*/
function beforeSave(&$model) {
extract($this->settings[$model->alias]);

View file

@ -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
* be bound
* @param boolean $permanent Set to true to make the binding permanent
* @return void
* @access public
* @todo
*/
@ -526,6 +527,7 @@ class Model extends Overloadable {
/**
* Create a set of associations
*
* @return void
* @access private
*/
function __createLinks() {
@ -585,6 +587,7 @@ class Model extends Overloadable {
*
* var $hasMany = array('ModelName');
* usage: $this->ModelName->modelMethods();
* @return void
* @access private
*/
function __constructLinkedModel($assoc, $className = null) {
@ -608,6 +611,7 @@ class Model extends Overloadable {
* Build array-based association from string.
*
* @param string $type 'belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'
* @return void
* @access private
*/
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.
*
* @param string $tableName Name of the custom table
* @return void
* @access public
*/
function setSource($tableName) {
@ -1475,6 +1480,7 @@ class Model extends Overloadable {
/**
* Private helper method used by saveAll
*
* @return boolean Success
* @access private
* @see Model::saveAll()
*/
@ -1571,6 +1577,7 @@ class Model extends Overloadable {
*
* @param string $id ID of record that was deleted
* @param boolean $cascade Set to true to delete records that depend on this record
* @return void
* @access protected
*/
function _deleteDependent($id, $cascade) {
@ -1609,6 +1616,7 @@ class Model extends Overloadable {
* Cascades model deletes to HABTM join keys.
*
* @param string $id ID of record that was deleted
* @return void
* @access protected
*/
function _deleteLinks($id) {
@ -1675,6 +1683,7 @@ class Model extends Overloadable {
/**
* Collects foreign keys from associations
*
* @return array
* @access private
*/
function __collectForeignKeys($type = 'belongsTo') {
@ -1942,7 +1951,7 @@ class Model extends Overloadable {
* @param string $state Either "before" or "after"
* @param mixed $query
* @param array $results
* @return void
* @return array
* @access protected
*/
function _findNeighbors($state, $query, $results = array()) {
@ -2390,6 +2399,7 @@ class Model extends Overloadable {
/**
* Top secret
*
* @return array
* @access public
*/
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 array $keys Any join keys which must be merged with the keys queried
* @return array
* @access public
*/
function joinModel($assoc, $keys = array()) {
if (is_string($assoc)) {
@ -2693,6 +2704,7 @@ class Model extends Overloadable {
* Called when unserializing a model
*
* @access private
* @todo
*/
function __wakeup() {
}

View file

@ -94,6 +94,7 @@ class CakeSchema extends Object {
* Builds schema object properties
*
* @param array $data loaded object properties
* @return void
* @access protected
*/
function _build($data) {

View file

@ -142,6 +142,7 @@ class Object {
*
* @param string $msg Log message
* @param integer $type Error type constant. Defined in app/config/core.php.
* @return boolean Success of log write
* @access public
*/
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.
*
* @param array $properties An associative array containing properties and corresponding values.
* @return void
* @access protected
*/
function _set($properties = array()) {
@ -237,7 +239,7 @@ class Object {
*
* @param string $name name used for object to cache
* @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
*/
function _savePersistent($name, &$object) {
@ -253,6 +255,7 @@ class Object {
*
* @param string $name Name of persisted class
* @param string $type Type of persistance (e.g: registry)
* @return void
* @access private
*/
function __openPersistent($name, $type = null) {

View file

@ -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 $options Allows to control all settings: separator, greedy, reset, default
* @return array
* @access public
* @static
*/
@ -283,6 +284,7 @@ class Router extends Object {
* 'id' - The regular expression fragment to use when matching IDs. By default, matches
* integer values and UUIDs.
* 'prefix' - URL prefix to use for the generated routes. Defaults to '/'.
* @return void
* @access public
* @static
*/
@ -312,7 +314,7 @@ class Router extends Object {
* @param string $route An empty string, or a route string "/"
* @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.
* @return string
* @return array
* @see routes
* @access public
* @static
@ -580,7 +582,8 @@ class Router extends Object {
/**
* Connects the default, built-in routes, including admin routes, and (deprecated) web services
* routes.
*
*
* @return void
* @access private
*/
function __connectDefaultRoutes() {
@ -623,6 +626,7 @@ class Router extends Object {
* Takes parameter and path information back from the Dispatcher
*
* @param array $params Parameters and path information
* @return void
* @access public
* @static
*/
@ -697,6 +701,7 @@ class Router extends Object {
* Reloads default Router settings
*
* @access public
* @return void
* @static
*/
function reload() {
@ -1282,6 +1287,7 @@ class Router extends Object {
* parsed, excluding querystring parameters (i.e. ?q=...).
*
* @access public
* @return void
* @static
*/
function parseExtensions() {
@ -1294,8 +1300,9 @@ class Router extends Object {
/**
* Takes an passed params and converts it to args
*
* @access public
* @param array $params
* @return array Array containing passed and named parameters
* @access public
* @static
*/
function getArgs($args, $options = array()) {

View file

@ -103,6 +103,7 @@ class Sanitize {
* Strips extra whitespace from output
*
* @param string $str String to sanitize
* @return string whitespace sanitized string
* @access public
* @static
*/
@ -114,6 +115,7 @@ class Sanitize {
* Strips image tags from output
*
* @param string $str String to sanitize
* @return string Sting with images stripped.
* @access public
* @static
*/
@ -127,6 +129,7 @@ class Sanitize {
* Strips scripts and stylesheets from output
*
* @param string $str String to sanitize
* @return string String with <script>, <style>, <link> elements removed.
* @access public
* @static
*/
@ -137,6 +140,7 @@ class Sanitize {
* Strips extra whitespace, images, scripts and stylesheets from output
*
* @param string $str String to sanitize
* @return string sanitized string
* @access public
*/
function stripAll($str) {
@ -151,6 +155,7 @@ class Sanitize {
*
* @param string $str String to sanitize
* @param string $tag Tag to remove (add more parameters as needed)
* @return string sanitized String
* @access public
* @static
*/

View file

@ -99,6 +99,7 @@ class Security extends Object {
* @return boolean Success
* @access public
* @static
* @todo Complete implementation
*/
function validateAuthKey($authKey) {
return true;
@ -149,6 +150,7 @@ class Security extends Object {
*
* @param string $hash Method to use (sha1/sha256/md5)
* @access public
* @return void
* @static
* @see Security::hash()
*/

View file

@ -175,6 +175,7 @@ class CakeSession extends Object {
* Determine if Session has been started.
*
* @access public
* @return boolean True if session has been started.
*/
function started() {
if (isset($_SESSION)) {
@ -198,7 +199,8 @@ class CakeSession extends Object {
return isset($result);
}
/**
*
* Returns the Session id
*
* @param id $name string
* @return string Session id
* @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
*
* @param mixed $var The variable path to watch
* @return void
* @access public
*/
function watch($var) {
@ -351,6 +354,7 @@ class CakeSession extends Object {
* Tells Session to stop watching a given key path
*
* @param mixed $var The variable path to watch
* @return void
* @access public
*/
function ignore($var) {
@ -389,6 +393,7 @@ class CakeSession extends Object {
/**
* Helper method to destroy invalid sessions.
*
* @return void
* @access public
*/
function destroy() {
@ -549,6 +554,7 @@ class CakeSession extends Object {
/**
* Helper method to create a new session.
*
* @return void
* @access protected
*/
function _checkValid() {
@ -586,6 +592,7 @@ class CakeSession extends Object {
/**
* Helper method to restart a session.
*
* @return void
* @access private
*/
function __regenerateId() {
@ -643,6 +650,7 @@ class CakeSession extends Object {
*
* @param integer $errorNumber Number of the error
* @param string $errorMessage Description of the error
* @return void
* @access private
*/
function __setError($errorNumber, $errorMessage) {

View file

@ -49,6 +49,7 @@ class Set extends Object {
* @param array $arr2 Array to merge with
* @return array Merged array
* @access public
* @static
*/
function merge($arr1, $arr2 = null) {
$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
* @return mixed Either filtered array, or true/false when in callback
* @access public
* @static
*/
function filter($var, $isArray = false) {
if (is_array($var) && (!empty($var) || $isArray)) {
@ -95,6 +97,7 @@ class Set extends Object {
* @param mixed $array2 Differences to push
* @return array Combined array
* @access public
* @static
*/
function pushDiff($array, $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
* @return object Hierarchical object
* @access public
* @static
*/
function map($class = 'stdClass', $tmp = 'stdClass') {
if (is_array($class)) {
@ -169,6 +173,7 @@ class Set extends Object {
* @param boolean $primary whether to assign first array key as the _name_
* @return mixed Mapped object
* @access private
* @static
*/
function __map(&$array, $class, $primary = false) {
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
* @return boolean true if values are numeric, false otherwise
* @access public
* @static
*/
function numeric($array = null) {
if (empty($array)) {
@ -260,6 +266,7 @@ class Set extends Object {
* @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
* @access public
* @static
*/
function enum($select, $list = null) {
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
* @return array An array of strings extracted from $keys and formatted with $format
* @access public
* @static
*/
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
* @return array An array of matched items
* @access public
* @static
*/
function extract($path, $data = null, $options = array()) {
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.
* @return boolean
* @access public
* @static
*/
function matches($conditions, $data = array(), $i = null, $length = null) {
if (empty($conditions)) {
@ -543,6 +553,7 @@ class Set extends Object {
* @param mixed $path As an array, or as a dot-separated string.
* @return array Extracted data
* @access public
* @static
*/
function classicExtract($data, $path = null) {
if (empty($path)) {
@ -627,6 +638,7 @@ class Set extends Object {
* @param array $data Data to insert
* @return array
* @access public
* @static
*/
function insert($list, $path, $data = null) {
if (!is_array($path)) {
@ -656,6 +668,7 @@ class Set extends Object {
* @param mixed $path A dot-separated string.
* @return array Array with $path removed from its value
* @access public
* @static
*/
function remove($list, $path = null) {
if (empty($path)) {
@ -688,6 +701,7 @@ class Set extends Object {
* @param mixed $path A dot-separated string.
* @return boolean true if path is found, false otherwise
* @access public
* @static
*/
function check($data, $path = null) {
if (empty($path)) {
@ -719,6 +733,7 @@ class Set extends Object {
* @param mixed $val2 Second value
* @return array Computed difference
* @access public
* @static
*/
function diff($val1, $val2 = null) {
if (empty($val1)) {
@ -754,6 +769,7 @@ class Set extends Object {
* @param array $val2 Second value
* @return boolean true if they are equal, false otherwise
* @access public
* @static
*/
function isEqual($val1, $val2 = null) {
return ($val1 == $val2);
@ -765,6 +781,7 @@ class Set extends Object {
* @param array $val2 Second value
* @return boolean true if $val1 contains $val2, false otherwise
* @access public
* @static
*/
function contains($val1, $val2 = null) {
if (empty($val1) || empty($val2)) {
@ -791,6 +808,7 @@ class Set extends Object {
* @param integer $count Start the dimension count at this number
* @return integer The number of dimensions in $array
* @access public
* @static
*/
function countDim($array = null, $all = false, $count = 0) {
if ($all) {
@ -819,6 +837,7 @@ class Set extends Object {
* @param boolean $trim If true, separated strings will be trimmed
* @return array
* @access public
* @static
*/
function normalize($list, $assoc = true, $sep = ',', $trim = true) {
if (is_string($list)) {
@ -870,6 +889,7 @@ class Set extends Object {
* @param string $groupPath As an array, or as a dot-separated string.
* @return array Combined array
* @access public
* @static
*/
function combine($data, $path1 = null, $path2 = null, $groupPath = null) {
if (empty($data)) {
@ -926,6 +946,7 @@ class Set extends Object {
*
* @param object $object Object to reverse
* @return array
* @static
*/
function reverse($object) {
$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 '.'
* @return array
* @access public
* @static
*/
function flatten($data, $separator = '.') {
$result = array();
@ -1028,6 +1050,7 @@ class Set extends Object {
* @param string $path A Set-compatible path to the array value
* @param string $dir asc/desc
* @return array
* @static
*/
function sort($data, $path, $dir) {
$result = Set::__flatten(Set::extract($data, $path));

View file

@ -124,7 +124,7 @@ class String extends Object {
*
* @param string $data The data to tokenize
* @param string $separator The token to split the data on
* @return string
* @return array
* @access public
* @static
*/
@ -265,7 +265,7 @@ class String extends Object {
*
* @param string $str
* @param string $options
* @return void
* @return string
* @access public
*/
function cleanInsert($str, $options) {

View file

@ -303,7 +303,7 @@ class Validation extends Object {
* is greater >, is less <, greater or equal >=
* less or equal <=, is less <, equal to ==, not equal !=
* @param integer $check2 only needed if $check1 is a string
* @return bool
* @return boolean Success
* @access public
*/
function comparison($check1, $operator = null, $check2 = null) {
@ -535,6 +535,7 @@ class Validation extends Object {
*
* @param mixed $check Value to check
* @param mixed $comparedTo Value to compare
* @return boolean Success
* @access public
*/
function equalTo($check, $comparedTo) {
@ -545,6 +546,7 @@ class Validation extends Object {
*
* @param mixed $check Value to check
* @param array $extensions file extenstions to allow
* @return boolean Success
* @access public
*/
function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) {
@ -568,6 +570,7 @@ class Validation extends Object {
*
* @param mixed $check Value to check
* @access public
* @todo finish implementation
*/
function file($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
* max => maximun 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
*/
function multiple($check, $options = array()) {
@ -768,6 +772,7 @@ class Validation extends Object {
* @param string $check Value to check
* @param integer $lower Lower limit
* @param integer $upper Upper limit
* @return boolean Success
* @access public
*/
function range($check, $lower = null, $upper = null ) {
@ -881,6 +886,7 @@ class Validation extends Object {
* an array.
*
* @param array $params Parameters sent to validation method
* @return void
* @access protected
*/
function _extract($params) {
@ -940,7 +946,8 @@ class Validation extends Object {
}
/**
* Reset internal variables for another validation run.
*
*
* @return void
* @access private
*/
function __reset() {