mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating docblocks and adding @link tags.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7815 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
72bd7ba04b
commit
0fd3badee4
1 changed files with 25 additions and 16 deletions
|
@ -41,39 +41,40 @@
|
||||||
*
|
*
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs
|
* @subpackage cake.cake.libs
|
||||||
|
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
|
||||||
*/
|
*/
|
||||||
class Debugger extends Object {
|
class Debugger extends Object {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds a reference to errors generated by the application
|
* A list of errors generated by the application.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $errors = array();
|
var $errors = array();
|
||||||
/**
|
/**
|
||||||
* Contains the base URL for error code documentation
|
* Contains the base URL for error code documentation.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $helpPath = null;
|
var $helpPath = null;
|
||||||
/**
|
/**
|
||||||
* holds current output format
|
* The current output format.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $__outputFormat = 'js';
|
var $__outputFormat = 'js';
|
||||||
/**
|
/**
|
||||||
* holds current output data when outputFormat is false
|
* Holds current output data when outputFormat is false.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $__data = array();
|
var $__data = array();
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
@ -86,7 +87,7 @@ class Debugger extends Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Gets a reference to the Debugger object instance
|
* Returns a reference to the Debugger singleton object instance.
|
||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
* @access public
|
* @access public
|
||||||
|
@ -105,25 +106,28 @@ class Debugger extends Object {
|
||||||
return $instance[0];
|
return $instance[0];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Formats and outputs the passed var
|
* Formats and outputs the contents of the supplied variable.
|
||||||
*
|
*
|
||||||
* @param $var mixed the variable to dump
|
* @param $var mixed the variable to dump
|
||||||
* @return void
|
* @return void
|
||||||
* @see exportVar
|
* @see exportVar
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
|
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
|
||||||
*/
|
*/
|
||||||
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
|
* Creates a detailed stack trace log at the time of invocation, much like dump()
|
||||||
|
* but to debug.log.
|
||||||
*
|
*
|
||||||
* @param $var mixed Variable or content to log
|
* @param $var mixed Variable or content to log
|
||||||
* @param $level int type of log to use. Defaults to LOG_DEBUG
|
* @param $level int type of log to use. Defaults to LOG_DEBUG
|
||||||
* @return void
|
* @return void
|
||||||
* @static
|
* @static
|
||||||
|
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
|
||||||
*/
|
*/
|
||||||
function log($var, $level = LOG_DEBUG) {
|
function log($var, $level = LOG_DEBUG) {
|
||||||
$_this = Debugger::getInstance();
|
$_this = Debugger::getInstance();
|
||||||
|
@ -139,7 +143,7 @@ class Debugger extends Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrides PHP's default error handling
|
* Overrides PHP's default error handling.
|
||||||
*
|
*
|
||||||
* @param integer $code Code of error
|
* @param integer $code Code of error
|
||||||
* @param string $description Error description
|
* @param string $description Error description
|
||||||
|
@ -218,12 +222,13 @@ class Debugger extends Object {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Outputs a stack trace with the given options
|
* Outputs a stack trace based on the supplied options.
|
||||||
*
|
*
|
||||||
* @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
|
* @static
|
||||||
|
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
|
||||||
*/
|
*/
|
||||||
function trace($options = array()) {
|
function trace($options = array()) {
|
||||||
$options = array_merge(array(
|
$options = array_merge(array(
|
||||||
|
@ -295,7 +300,7 @@ class Debugger extends Object {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Shortens file paths by replacing the application base path with 'APP', and the CakePHP core
|
* Shortens file paths by replacing the application base path with 'APP', and the CakePHP core
|
||||||
* path with 'CORE'
|
* path with 'CORE'.
|
||||||
*
|
*
|
||||||
* @param string $path Path to shorten
|
* @param string $path Path to shorten
|
||||||
* @return string Normalized path
|
* @return string Normalized path
|
||||||
|
@ -331,6 +336,7 @@ class Debugger extends Object {
|
||||||
* @return array Set of lines highlighted
|
* @return array Set of lines highlighted
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
|
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
|
||||||
*/
|
*/
|
||||||
function excerpt($file, $line, $context = 2) {
|
function excerpt($file, $line, $context = 2) {
|
||||||
$data = $lines = array();
|
$data = $lines = array();
|
||||||
|
@ -356,12 +362,13 @@ class Debugger extends Object {
|
||||||
return $lines;
|
return $lines;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Converts a variable to a string for debug output
|
* Converts a variable to a string for debug output.
|
||||||
*
|
*
|
||||||
* @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
|
* @static
|
||||||
|
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
|
||||||
*/
|
*/
|
||||||
function exportVar($var, $recursion = 0) {
|
function exportVar($var, $recursion = 0) {
|
||||||
$_this = Debugger::getInstance();
|
$_this = Debugger::getInstance();
|
||||||
|
@ -409,11 +416,12 @@ class Debugger extends Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handles object conversion to debug string
|
* Handles object to string conversion.
|
||||||
*
|
*
|
||||||
* @param string $var Object to convert
|
* @param string $var Object to convert
|
||||||
* @return string
|
* @return string
|
||||||
* @access private
|
* @access private
|
||||||
|
* @see Debugger:exportVar()
|
||||||
*/
|
*/
|
||||||
function __object($var) {
|
function __object($var) {
|
||||||
$out = array();
|
$out = array();
|
||||||
|
@ -438,7 +446,7 @@ class Debugger extends Object {
|
||||||
return join("\n", $out);
|
return join("\n", $out);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handles object conversion to debug string
|
* Handles object conversion to debug string.
|
||||||
*
|
*
|
||||||
* @param string $var Object to convert
|
* @param string $var Object to convert
|
||||||
* @access protected
|
* @access protected
|
||||||
|
@ -457,7 +465,7 @@ class Debugger extends Object {
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handles object conversion to debug string
|
* Handles object conversion to debug string.
|
||||||
*
|
*
|
||||||
* @param string $var Object to convert
|
* @param string $var Object to convert
|
||||||
* @access private
|
* @access private
|
||||||
|
@ -530,7 +538,7 @@ class Debugger extends Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Verify that the application's salt has been changed from the default value
|
* Verifies that the application's salt value has been changed from the default value.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
|
@ -547,6 +555,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
|
* @static
|
||||||
|
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
|
||||||
*/
|
*/
|
||||||
function invoke(&$debugger) {
|
function invoke(&$debugger) {
|
||||||
set_error_handler(array(&$debugger, 'handleError'));
|
set_error_handler(array(&$debugger, 'handleError'));
|
||||||
|
|
Loading…
Reference in a new issue