PhpToolCase
[ class tree: PhpToolCase ] [ index: PhpToolCase ] [ all elements ]

Class: PtcDebug

Source Location: /workshop/PhpToolCase/current/PtcDebug.php

Class PtcDebug

Property Summary
static array   $_buffer   the debug buffer
static array   $_defaultOptions   default options for the debug class
static time   $_endTime   application end time
static array   $_excludeTrace   Exclude functions in this array from the backtrace
static array   $_options   array with all options
static time   $_startTime   application start time

[ Top ]
Method Summary
static void   addToBuffer()   Attach message to the end of buffer array
static void   bufferLog()   Write messsage to log panel
static void   bufferSql()   Write message to sql panel
static void   checkReferer()   Check if debug parameters are set on referer url
static void   debugLoader()   Load the debug interface if requested
static void   errorHandler()   Handle php errors
static void   log()   Alias of PtcDebug::bufferLog()
static void   logSql()   Alias of PtcDebug::bufferSql()
static void   setErrorHandler()   Set the error handler to be the debug class. good for production if param is set to false
static void   showInterface()   Show the debug interface
static void   stopTimer()   Monitor the execution of something
static void   _buildBuffer()   Build the buffer
static void   _buildHtmlTable()   Build the html log and sql tables
static void   _buildInnerVars()   Build the inner vars div
static void   _buildInterface()   Build the debug interface
static void   _buildMenu()   Build the debug menu
static void   _buildMsgPanel()   Build the log panel
static void   _buildPhpInfo()   Format phpinfo() function
static void   _buildQueriesPanel()   Build the sql panel
static void   _buildTimerPanel()   Build the timer panel
static void   _buildVarsPanel()   Build the vars panel
static void   _buildW3cPanel()   Build the W3C panel
static void   _checkAccess()   Check if ip has access
static void   _cleanBuffer()   Remove html entities from the buffer
static void   _compressHtml()   Compress the html before render
static void   _debugTrace()   Trace php as best as we can
static void   _includeCss()   Include the css for the debug interface
static void   _includeJs()   Include the javascript for the debug interface
static void   _lastError()   Get fatal error on shutdown
static void   _menuLinks()   Build the debug menu links
static void   _msgType()   Check message types
static void   _phpInfoArray()   Format phpinfo() into an array
static void   _sortBuffer()   Sort the buffer
void   load()   Alias of PtcDebug::debugLoader()

[ Top ]
Properties
static array   $_buffer = array() [line 825]

the debug buffer

API Tags:
Access:  private


[ Top ]
static array   $_defaultOptions = array
(
'url_key' => 'debug',# the key to pass to turn on debug
'url_pass' => 'true',# the pass to turn on debug
'replace_error_handler' => true,# replace default php error handler
'check_referer' => false,# check referer for key and pass(good for ajax debugging)
'die_on_error' => true,# die if fatal error occurs(with class error handler)
'debug_console' => false,# only for Chrome,show messages in console(phpConsole needed)
'allowed_ips' => null,# restrict access with ip's
'session_start' => false,# start session for persistent debugging
'show_interface' => true # show the interface(false to debug in console only)
)
[line 239]

default options for the debug class

API Tags:
Access:  protected

Information Tags:
Tutorial:  Class Options

[ Top ]
static time   $_endTime = null [line 837]

application end time

API Tags:
See:  PtcDebug::stopTimer()
Access:  private


[ Top ]
static array   $_excludeTrace = array("require","require_once","include") [line 842]

Exclude functions in this array from the backtrace

API Tags:
Access:  private


[ Top ]
static array   $_options = array() [line 820]

array with all options

API Tags:
Access:  private


[ Top ]
static time   $_startTime = null [line 831]

application start time

API Tags:
See:  PtcDebug::stopTimer()
Access:  private


[ Top ]
Methods
static method addToBuffer  [line 199]

  static void addToBuffer( string $string, [ $statement = null], [string $type = "errstr"]  )

Attach message to the end of buffer array

Parameters:
string   $string:  the message to show
string   $type:  the array key in the buffer
   $statement: 

API Tags:
Access:  public


[ Top ]
static method bufferLog  [line 137]

  static void bufferLog( mixed $string, [mixed $statement = null], [string $function = null], [string $class = null]  )

Write messsage to log panel

Parameters:
mixed   $string:  the string to pass
mixed   $statement:  some statement if required
string   $function:  the name of the function
string   $class:  the name of the class

API Tags:
Access:  public

Information Tags:
Tutorial:  Logging Messages

[ Top ]
static method bufferSql  [line 149]

  static void bufferSql( mixed $string, [mixed $statement = null], [string $function = null], [string $class = null]  )

Write message to sql panel

Parameters:
mixed   $string:  the string to pass
mixed   $statement:  some statement if required
string   $function:  the name of the function
string   $class:  the name of the class

API Tags:
Access:  public

Information Tags:
Tutorial:  Logging Sql Queries

[ Top ]
static method checkReferer  [line 37]

  static void checkReferer( )

Check if debug parameters are set on referer url


API Tags:
Access:  public


[ Top ]
static method debugLoader  [line 68]

  static void debugLoader( [array $options = null]  )

Load the debug interface if requested

Parameters:
array   $options:  array of options _defaultOptions

API Tags:
Access:  public

Information Tags:
Tutorial:  Getting Started

[ Top ]
static method errorHandler  [line 184]

  static void errorHandler( string $errno, string $errstr, string $errfile, string $errline  )

Handle php errors

Parameters:
string   $errno:  error number (php standards)
string   $errstr:  error string
string   $errfile:  error file
string   $errline:  error line

API Tags:
See:  PtcDebug::setErrorHandler()
Access:  public


[ Top ]
static method log  [line 23]

  static void log( $string, [ $statement = null], [ $function = null], [ $class = null]  )

Alias of PtcDebug::bufferLog()

Parameters:
   $string: 
   $statement: 
   $function: 
   $class: 

API Tags:
Access:  public


[ Top ]
static method logSql  [line 30]

  static void logSql( $string, [ $statement = null], [ $function = null], [ $class = null]  )

Alias of PtcDebug::bufferSql()

Parameters:
   $string: 
   $statement: 
   $function: 
   $class: 

API Tags:
Access:  public


[ Top ]
static method setErrorHandler  [line 55]

  static void setErrorHandler( [string $dieIfFatalError = true]  )

Set the error handler to be the debug class. good for production if param is set to false

Parameters:
string   $dieIfFatalError:  die if fatal error occurs

API Tags:
Access:  public

Information Tags:
Tutorial:  Replace Error Handler

[ Top ]
static method showInterface  [line 227]

  static void showInterface( )

Show the debug interface


API Tags:
See:  PtcDebug::debugLoader()
Access:  public


[ Top ]
static method stopTimer  [line 158]

  static void stopTimer( [string|numeric $precision = 1]  )

Monitor the execution of something

Parameters:
string|numeric   $precision:  sec/ms

API Tags:
Access:  public

Information Tags:
Tutorial:  Execution Timing

[ Top ]
static method _buildBuffer  [line 275]

  static void _buildBuffer( string $type, mixed $string, [mixed $statement = null], [string $function = null], [string $class = null]  )

Build the buffer

Parameters:
string   $type:  log/sql
mixed   $string:  the string to pass
mixed   $statement:  some statement preceding the string
string   $function:  the name of the function
string   $class:  the name of the class

API Tags:
Access:  protected


[ Top ]
static method _buildHtmlTable  [line 497]

  static void _buildHtmlTable( string $type  )

Build the html log and sql tables

Parameters:
string   $type:  sql|log

API Tags:
Access:  protected


[ Top ]
static method _buildInnerVars  [line 604]

  static void _buildInnerVars( string $panelId, string $linkTitle, string $array  )

Build the inner vars div

Parameters:
string   $panelId:  the id of the panel to show/hide
string   $linkTitle:  the title orf the link
string   $array:  array of parameters

API Tags:
Access:  protected


[ Top ]
static method _buildInterface  [line 414]

  static void _buildInterface( )

Build the debug interface


API Tags:
Access:  protected


[ Top ]
static method _buildMenu  [line 435]

  static void _buildMenu( )

Build the debug menu


API Tags:
Access:  protected


[ Top ]
static method _buildMsgPanel  [line 533]

  static void _buildMsgPanel( )

Build the log panel


API Tags:
Access:  protected


[ Top ]
static method _buildPhpInfo  [line 631]

  static void _buildPhpInfo( )

Format phpinfo() function


API Tags:
Access:  protected


[ Top ]
static method _buildQueriesPanel  [line 543]

  static void _buildQueriesPanel( )

Build the sql panel


API Tags:
Access:  protected


[ Top ]
static method _buildTimerPanel  [line 552]

  static void _buildTimerPanel( )

Build the timer panel


API Tags:
Access:  protected


[ Top ]
static method _buildVarsPanel  [line 563]

  static void _buildVarsPanel( )

Build the vars panel


API Tags:
Access:  protected


[ Top ]
static method _buildW3cPanel  [line 616]

  static void _buildW3cPanel( )

Build the W3C panel


API Tags:
Access:  protected


[ Top ]
static method _checkAccess  [line 255]

  static void _checkAccess( [string|array $allowedIps = null]  )

Check if ip has access

Parameters:
string|array   $allowedIps:  the ip's that are allowed

API Tags:
Access:  protected


[ Top ]
static method _cleanBuffer  [line 847]

  static void _cleanBuffer( string $var  )

Remove html entities from the buffer

Parameters:
string   $var:  some string

API Tags:
Access:  private


[ Top ]
static method _compressHtml  [line 785]

  static void _compressHtml( $html  )

Compress the html before render

Parameters:
   $html: 

API Tags:
Access:  protected


[ Top ]
static method _debugTrace  [line 356]

  static void _debugTrace( )

Trace php as best as we can


API Tags:
Access:  protected


[ Top ]
static method _includeCss  [line 644]

  static void _includeCss( )

Include the css for the debug interface


API Tags:
Access:  protected


[ Top ]
static method _includeJs  [line 691]

  static void _includeJs( )

Include the javascript for the debug interface


API Tags:
Access:  protected


[ Top ]
static method _lastError  [line 398]

  static void _lastError( )

Get fatal error on shutdown


API Tags:
Access:  protected


[ Top ]
static method _menuLinks  [line 454]

  static void _menuLinks( string $Id, string $title, string $text  )

Build the debug menu links

Parameters:
string   $Id:  the panel id
string   $title:  the panel title
string   $text:  the text for the link

API Tags:
Access:  protected


[ Top ]
static method _msgType  [line 465]

  static void _msgType( [string|numeric $msg = NULL]  )

Check message types

Parameters:
string|numeric   $msg:  php standards

API Tags:
Access:  protected


[ Top ]
static method _phpInfoArray  [line 794]

  static void _phpInfoArray( )

Format phpinfo() into an array


API Tags:
Access:  protected


[ Top ]
static method _sortBuffer  [line 340]

  static void _sortBuffer( )

Sort the buffer


API Tags:
Access:  protected


[ Top ]
load  [line 19]

  void load( [ $options = null]  )

Alias of PtcDebug::debugLoader()

Parameters:
   $options: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Wed, 06 Mar 2013 23:45:44 +0100 by phpDocumentor 1.4.3