PhpToolCase
Api Documentation Version 0.9.2
|
Static Public Member Functions | |
static | getBuffer () |
Returns the buffer array. More... | |
static | getCoverage () |
Retrieves the code coverage analysis data stored in the PtcDebug::$_finalCoverageData property. More... | |
static | addCss ($css) |
Adds style properties to the floating panel styles array. More... | |
static | checkReferer () |
Checks if the debug "url_key" and "url_pass" are set on the referer url. More... | |
static | setErrorHandler ($dieOnFatal=true) |
Sets the error handler to be the debug class. More... | |
static | load ($options=null) |
Loads the debug interface and/or the console class if requested. More... | |
static | tickHandler () |
The ticks handler to execute all tickable functions. More... | |
static | startCoverage () |
Starts the code coverage analysis utility to find executed lines. More... | |
static | stopCoverage () |
Stops the code coverage analysis utility. More... | |
static | startTrace () |
Starts the function calls trace utility. More... | |
static | stopTrace () |
Stops the function calls trace utility. More... | |
static | excludeFromTrace ($functions) |
Excludes functions from the function calls tracing engine. More... | |
static | watch ($variableName, $callback=null) |
Watches a variable that is in a declare(ticks=n); code block, for changes. More... | |
static | bufferLog ($string, $statement=null, $category=null) |
Writes data to the messages panel. More... | |
static | bufferSql ($string, $statement=null, $category=null) |
Writes data to the sql panel. More... | |
static | stopTimer ($reference=null, $precision=1) |
Monitors the execution of php code, or sql queries based on a reference. More... | |
static | convertMemUsage ($val, $precision=2) |
Convert memory_usage( ) into a readable format. More... | |
static | errorHandler ($errno, $errstr, $errfile, $errline) |
Handles php errors. More... | |
static | exceptionHandler ($exception) |
Exception handler, catches exceptions that are not in a try/catch block. More... | |
static | addToBuffer ($reference, $string, $statement=null) |
Attaches a message to the end of the buffer array to add data based on a reference. More... | |
static | processBuffer () |
Processes the buffer to show the interface and/or the console messages. More... | |
static | findString ($query, $path=null, $last=1) |
Searches files for a string inside a given folder recursively. More... | |
static | highlightFile ($file, $line=null) |
File highlighter that opens a popup window inspect source code. More... | |
static | showSearchPopup ($string, $path=null) |
Shows the search popup window with the result. More... | |
Static Protected Member Functions | |
static | _debugConsole () |
Sends the buffer to the PhpConsole class. More... | |
static | _checkAccess ($allowedIps=null) |
Checks if a given ip has access. More... | |
static | _setSessionVars () |
Sets session vars to control which panels will be shown. More... | |
static | _disablePanels () |
Controls which panels will be shown with $_GET variable "hidepanels". More... | |
static | _buildBuffer ($type, $string, $statement=null, $category=null) |
Builds the buffer. More... | |
static | _watchCallback () |
Callback function that checks if a given variable has changed. More... | |
static | _codeCoverageAnalysis ($backtrace=null) |
Collect data for code coverage analysis. More... | |
static | _formatVar ($var) |
Evaluates the type of variable for output. More... | |
static | _findWatchVar ($variableName) |
Retrieves the variable to watch from the "$GLOBALS". More... | |
static | _findReference ($reference, $type=1) |
Finds a value in the buffer based on a reference (the "$statement") More... | |
static | _doDump (&$var, $varName=NULL, $indent=NULL, $reference=NULL, $depth=0) |
Custom dump to properly format a given variable and make it more friendly to read. More... | |
static | _sortBuffer () |
Sorts the buffer. More... | |
static | _debugTrace ($depth=NULL) |
Trace php as best as we can. More... | |
static | _lastError () |
Gets the fatal error on shutdown. More... | |
static | _buildInterface () |
Builds the debug interface. More... | |
static | _buildMenu () |
Builds the debug menu. More... | |
static | _menuLinks ($id, $title, $text) |
Builds the menu links. More... | |
static | _msgType ($msg=NULL) |
Checks message types. More... | |
static | _buildHtmlTable ($type) |
Builds the html log and sql tables. More... | |
static | _buildTraceLink ($file, $line=null) |
Builds the link for the code highlighter popup. More... | |
static | _buildTraceTree ($var, $className=null, $styleColor=null) |
Builds the tree for the links in the vars & config panel. More... | |
static | _buildMsgPanel ($type, $panelId) |
Builds the log/sql panel. More... | |
static | _buildTimerPanel () |
Builds the timer panel. More... | |
static | _buildAnalysisPanel () |
Builds the Analysis panel for code coverage analysis. More... | |
static | _buildCoverageData () |
Builds the html data for the code coverage analysis. More... | |
static | _buildTraceData () |
Builds the html data for the function calls trace. More... | |
static | _buildVarsPanel () |
Builds the vars panel. More... | |
static | _buildInnerVars ($panelId, $linkTitle, $array) |
Builds the inner vars div. More... | |
static | _buildW3cPanel () |
Builds the W3C panel. More... | |
static | _buildPhpInfo () |
Formats phpinfo() function. More... | |
static | _includeCss () |
Includes the css for the interface. More... | |
static | _includeJs () |
Includes the javascript for the interface. More... | |
static | _compressHtml ($html) |
Compresses the html before render. More... | |
static | _phpInfoArray () |
Formats phpinfo() into an array. More... | |
static | _disableOpcodeCache () |
Attempts to disable any detetected opcode caches / optimizers. More... | |
static | _traceFunctionCalls ($trace=null) |
Function calls trace engine. More... | |
static | _cleanBuffer ($var) |
Removes html entities from the buffer. More... | |
static | _getSessionVars ($var=null) |
Retrieves the session var for the ptcdebug class. More... | |
Static Protected Attributes | |
static | $_defaultOptions |
Default options for the debug class. More... | |
static | $_excludeMethods =array( ) |
Array of methods excluded from the backtrace. More... | |
static | $_coverageData = null |
Code coverage analysis storage. More... | |
static | $_finalCoverageData = array( ) |
Final data array for the code coveage. More... | |
static | $_traceData = null |
Function calls tracing storage property. More... | |
static | $_finalTraceData = array( ) |
Final data array for the function calls trace. More... | |
static | $_options = array( ) |
Array with all options. More... | |
static | $_buffer = array( ) |
The debug buffer. More... | |
static | $_startTime = null |
Application start time. More... | |
static | $_endTime = null |
Application end time. More... | |
static | $_consoleStarted = false |
Decides if we should send the buffer to the PhpConsole class. More... | |
static | $_watchedVars = array() |
Array of watched variables declared. More... | |
static | $_tickTime = 0 |
Tick execution time property. More... | |
static | $_countTime = true |
Exclude PtcDebug::$_buildBuffer from execution timing property. More... | |
static | $_codeCoverage = false |
Code coverage analysis property to start coverage. More... | |
static | $_functionTrace = false |
Function calls trace property to start the analysis. More... | |
static | $_disableOpcode = true |
Controlls when to disable opcode cache. More... | |
static | $_excludeFromTrace = array( ) |
Exclude functions from the function calls trace array. More... | |
static | $_panelCss |
Property that holds the css for the floating panel. More... | |
|
staticprotected |
Builds the Analysis panel for code coverage analysis.
Definition at line 1650 of file PtcDebug.php.
|
staticprotected |
Builds the buffer.
string | $type | log/sql |
mixed | $string | the string to pass |
mixed | $statement | some statement preceding the string |
string | $category | a category for the message |
Definition at line 859 of file PtcDebug.php.
|
staticprotected |
Builds the html data for the code coverage analysis.
Definition at line 1679 of file PtcDebug.php.
|
staticprotected |
Builds the html log and sql tables.
string | $type | sql|log |
Definition at line 1463 of file PtcDebug.php.
|
staticprotected |
Builds the inner vars div.
string | $panelId | the id of the panel to show/hide |
string | $linkTitle | the title of the link |
string | $array | array of parameters |
Definition at line 1831 of file PtcDebug.php.
|
staticprotected |
Builds the debug interface.
Definition at line 1364 of file PtcDebug.php.
|
staticprotected |
Builds the debug menu.
Definition at line 1387 of file PtcDebug.php.
|
staticprotected |
Builds the log/sql panel.
$type | log or sql |
$panelId | ome id for the panel |
Definition at line 1622 of file PtcDebug.php.
|
staticprotected |
Formats phpinfo() function.
Definition at line 1874 of file PtcDebug.php.
|
staticprotected |
Builds the timer panel.
Definition at line 1637 of file PtcDebug.php.
|
staticprotected |
Builds the html data for the function calls trace.
Definition at line 1712 of file PtcDebug.php.
|
staticprotected |
Builds the link for the code highlighter popup.
string | $file | the full path to the file |
string | $line | the line to be highlighted |
Definition at line 1574 of file PtcDebug.php.
|
staticprotected |
Builds the tree for the links in the vars & config panel.
mixed | $var | the variable |
string | $className | a css class |
string | $styleColor | the color for |
Definition at line 1596 of file PtcDebug.php.
|
staticprotected |
Builds the vars panel.
Definition at line 1781 of file PtcDebug.php.
|
staticprotected |
Builds the W3C panel.
Definition at line 1841 of file PtcDebug.php.
|
staticprotected |
Checks if a given ip has access.
string | array | $allowedIps | the ip's that are allowed |
Definition at line 793 of file PtcDebug.php.
|
staticprotected |
Removes html entities from the buffer.
string | $var | some string |
Definition at line 2179 of file PtcDebug.php.
|
staticprotected |
Collect data for code coverage analysis.
array | $backtrace | the debug_backtrace( ) |
Definition at line 975 of file PtcDebug.php.
|
staticprotected |
Compresses the html before render.
string | $html | some html code |
Definition at line 2070 of file PtcDebug.php.
|
staticprotected |
Sends the buffer to the PhpConsole class.
See Ajax Debugging
Definition at line 726 of file PtcDebug.php.
|
staticprotected |
Trace php as best as we can.
int | $depth | the maximum trace depth |
Definition at line 1307 of file PtcDebug.php.
|
staticprotected |
Attempts to disable any detetected opcode caches / optimizers.
Definition at line 2107 of file PtcDebug.php.
|
staticprotected |
Controls which panels will be shown with $_GET variable "hidepanels".
Definition at line 818 of file PtcDebug.php.
|
staticprotected |
Custom dump to properly format a given variable and make it more friendly to read.
mixed | $var | the string to pass |
mixed | $varName | some statement preceding the variable |
string | $indent | uses "|" as indents by default |
string | $reference | a reference to prevent recursion |
int | $depth | maximun depth |
Definition at line 1083 of file PtcDebug.php.
|
staticprotected |
Finds a value in the buffer based on a reference (the "$statement")
string | $reference | the reference to look for |
numeric | $type | "1" to time execution, "2" to attach data to a message |
Definition at line 1048 of file PtcDebug.php.
|
staticprotected |
Retrieves the variable to watch from the "$GLOBALS".
string | $variableName | the name of the variable to find |
Definition at line 1019 of file PtcDebug.php.
|
staticprotected |
Evaluates the type of variable for output.
mixed | $var | the variable to pass |
Definition at line 1000 of file PtcDebug.php.
|
staticprotected |
Retrieves the session var for the ptcdebug class.
string | $var | the session var to retrieve |
Definition at line 2187 of file PtcDebug.php.
|
staticprotected |
Includes the css for the interface.
Definition at line 1886 of file PtcDebug.php.
|
staticprotected |
Includes the javascript for the interface.
Definition at line 1895 of file PtcDebug.php.
|
staticprotected |
Gets the fatal error on shutdown.
Definition at line 1347 of file PtcDebug.php.
|
staticprotected |
Builds the menu links.
string | $id | the panel id |
string | $title | the panel title |
string | $text | the text for the link |
Definition at line 1415 of file PtcDebug.php.
|
staticprotected |
Checks message types.
string | numeric | $msg | php standards |
Definition at line 1428 of file PtcDebug.php.
|
staticprotected |
Formats phpinfo() into an array.
Definition at line 2082 of file PtcDebug.php.
|
staticprotected |
Sets session vars to control which panels will be shown.
Definition at line 808 of file PtcDebug.php.
|
staticprotected |
|
staticprotected |
Function calls trace engine.
array | $trace | the php debug_backtrace( ) result |
Definition at line 2138 of file PtcDebug.php.
|
staticprotected |
Callback function that checks if a given variable has changed.
Definition at line 928 of file PtcDebug.php.
|
static |
Adds style properties to the floating panel styles array.
string | $css | some css to add |
Definition at line 32 of file PtcDebug.php.
|
static |
Attaches a message to the end of the buffer array to add data based on a reference.
See Attaching Data To Messages
string | $reference | a reference to look for ("$statement") |
mixed | $string | the message to show |
string | $statement | a new statement if required |
Definition at line 405 of file PtcDebug.php.
|
static |
Writes data to the messages panel.
See Logging Data
mixed | $string | the string to pass |
mixed | $statement | some statement if required |
string | $category | a category for the messages panel |
Definition at line 314 of file PtcDebug.php.
|
static |
Writes data to the sql panel.
mixed | $string | the string to pass |
mixed | $statement | some statement if required |
string | $category | a category for the sql panel |
Definition at line 324 of file PtcDebug.php.
|
static |
Checks if the debug "url_key" and "url_pass" are set on the referer url.
See check_referer
Definition at line 37 of file PtcDebug.php.
|
static |
Convert memory_usage( ) into a readable format.
float | $val | The value to convert |
int | $precision | the decimal points |
Definition at line 364 of file PtcDebug.php.
|
static |
Handles php errors.
string | $errno | error number (php standards) |
string | $errstr | error string |
string | $errfile | error file |
string | $errline | error line |
Definition at line 378 of file PtcDebug.php.
|
static |
Exception handler, catches exceptions that are not in a try/catch block.
object | $exception | the exception object |
Definition at line 392 of file PtcDebug.php.
|
static |
Excludes functions from the function calls tracing engine.
array | string | $functions | the function the exclude by their name |
Definition at line 280 of file PtcDebug.php.
|
static |
Searches files for a string inside a given folder recursively.
See Searching For A String Recursively
string | $query | the string to lok for |
string | $path | a starting path to search recursively |
int | $last | check last result |
Definition at line 461 of file PtcDebug.php.
|
static |
|
static |
Retrieves the code coverage analysis data stored in the PtcDebug::$_finalCoverageData property.
Definition at line 27 of file PtcDebug.php.
|
static |
File highlighter that opens a popup window inspect source code.
string | $file | the full path for the file |
string | $line | the line to be highlighted |
Definition at line 523 of file PtcDebug.php.
|
static |
Loads the debug interface and/or the console class if requested.
See Getting Started
array | $options | array of options, see PtcDebug::$ _defaultOptions |
Definition at line 73 of file PtcDebug.php.
|
static |
Processes the buffer to show the interface and/or the console messages.
Definition at line 427 of file PtcDebug.php.
|
static |
Sets the error handler to be the debug class.
good for production with "$dieOnFatal" set to false. See Replacing Error Handler
string | $dieOnFatal | die if fatal error occurs |
Definition at line 57 of file PtcDebug.php.
|
static |
Shows the search popup window with the result.
string | $string | a search string to search for |
string | $path | a start path where to search for a string recursively |
Definition at line 2196 of file PtcDebug.php.
|
static |
Starts the code coverage analysis utility to find executed lines.
Definition at line 217 of file PtcDebug.php.
|
static |
Starts the function calls trace utility.
Definition at line 248 of file PtcDebug.php.
|
static |
Stops the code coverage analysis utility.
Definition at line 233 of file PtcDebug.php.
|
static |
Monitors the execution of php code, or sql queries based on a reference.
See Execution Timing
string | $reference | a reference to look for ("$statement") |
string | numeric | $precision | sec/ms |
Definition at line 334 of file PtcDebug.php.
|
static |
Stops the function calls trace utility.
Definition at line 264 of file PtcDebug.php.
|
static |
The ticks handler to execute all tickable functions.
Definition at line 194 of file PtcDebug.php.
|
static |
Watches a variable that is in a declare(ticks=n); code block, for changes.
See Inspecting Variable Changes
string | $variableName | the name of the variable to watch |
string | $callback | a callback function that retrieves the variable |
Definition at line 290 of file PtcDebug.php.
|
staticprotected |
The debug buffer.
Definition at line 625 of file PtcDebug.php.
|
staticprotected |
Code coverage analysis property to start coverage.
Definition at line 653 of file PtcDebug.php.
|
staticprotected |
Decides if we should send the buffer to the PhpConsole class.
Definition at line 637 of file PtcDebug.php.
|
staticprotected |
Exclude PtcDebug::$_buildBuffer from execution timing property.
Definition at line 649 of file PtcDebug.php.
|
staticprotected |
Code coverage analysis storage.
Definition at line 605 of file PtcDebug.php.
|
staticprotected |
Default options for the debug class.
See Class Options
Definition at line 568 of file PtcDebug.php.
|
staticprotected |
Controlls when to disable opcode cache.
Definition at line 661 of file PtcDebug.php.
|
staticprotected |
Application end time.
Definition at line 633 of file PtcDebug.php.
|
staticprotected |
Exclude functions from the function calls trace array.
Definition at line 665 of file PtcDebug.php.
|
staticprotected |
Array of methods excluded from the backtrace.
Definition at line 601 of file PtcDebug.php.
|
staticprotected |
Final data array for the code coveage.
Definition at line 609 of file PtcDebug.php.
|
staticprotected |
Final data array for the function calls trace.
Definition at line 617 of file PtcDebug.php.
|
staticprotected |
Function calls trace property to start the analysis.
Definition at line 657 of file PtcDebug.php.
|
staticprotected |
Array with all options.
Definition at line 621 of file PtcDebug.php.
|
staticprotected |
Property that holds the css for the floating panel.
Definition at line 669 of file PtcDebug.php.
|
staticprotected |
Application start time.
Definition at line 629 of file PtcDebug.php.
|
staticprotected |
Tick execution time property.
Definition at line 645 of file PtcDebug.php.
|
staticprotected |
Function calls tracing storage property.
Definition at line 613 of file PtcDebug.php.
|
staticprotected |
Array of watched variables declared.
Definition at line 641 of file PtcDebug.php.