diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 32d35db92..23f5b6c33 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -41,39 +41,40 @@ * * @package cake * @subpackage cake.cake.libs + * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ class Debugger extends Object { /** - * Holds a reference to errors generated by the application + * A list of errors generated by the application. * * @var array * @access public */ var $errors = array(); /** - * Contains the base URL for error code documentation + * Contains the base URL for error code documentation. * * @var string * @access public */ var $helpPath = null; /** - * holds current output format + * The current output format. * * @var string * @access private */ var $__outputFormat = 'js'; /** - * holds current output data when outputFormat is false + * Holds current output data when outputFormat is false. * * @var string * @access private */ var $__data = array(); /** - * Constructor + * Constructor. * */ 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 * @access public @@ -105,25 +106,28 @@ class Debugger extends Object { 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 * @return void * @see exportVar * @access public * @static + * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function dump($var) { $_this = Debugger::getInstance(); 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 $level int type of log to use. Defaults to LOG_DEBUG * @return void * @static + * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function log($var, $level = LOG_DEBUG) { $_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 string $description Error description @@ -218,12 +222,13 @@ class Debugger extends Object { 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 * @return string Formatted stack trace * @access public * @static + * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function trace($options = 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 - * path with 'CORE' + * path with 'CORE'. * * @param string $path Path to shorten * @return string Normalized path @@ -331,6 +336,7 @@ class Debugger extends Object { * @return array Set of lines highlighted * @access public * @static + * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function excerpt($file, $line, $context = 2) { $data = $lines = array(); @@ -356,12 +362,13 @@ class Debugger extends Object { 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 * @return string Variable as a formatted string * @access public * @static + * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function exportVar($var, $recursion = 0) { $_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 * @return string * @access private + * @see Debugger:exportVar() */ function __object($var) { $out = array(); @@ -438,7 +446,7 @@ class Debugger extends Object { return join("\n", $out); } /** - * Handles object conversion to debug string + * Handles object conversion to debug string. * * @param string $var Object to convert * @access protected @@ -457,7 +465,7 @@ class Debugger extends Object { return $data; } /** - * Handles object conversion to debug string + * Handles object conversion to debug string. * * @param string $var Object to convert * @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 * @static @@ -547,6 +555,7 @@ class Debugger extends Object { * @param object $debugger A reference to the Debugger object * @access public * @static + * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function invoke(&$debugger) { set_error_handler(array(&$debugger, 'handleError'));