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

Class: PtcDebug

Source Location: /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   $_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   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
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

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

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 203]

default options for the debug class

API Tags:
Access:  protected

Information Tags:
Tutorial:  Class Options

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

application end time

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


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

array with all options

API Tags:
Access:  private


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

application start time

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


[ Top ]
Methods
static method addToBuffer  [line 180]

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

Attach message to the end of buffer array

Parameters:
string   $type:  the array key in the buffer
   $string: 

API Tags:
Access:  public


[ Top ]
static method bufferLog  [line 119]

  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 131]

  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 19]

  static void checkReferer( )

Check if debug parameters are set on referer url


API Tags:
Access:  public


[ Top ]
static method debugLoader  [line 50]

  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 166]

  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 setErrorHandler  [line 37]

  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 191]

  static void showInterface( )

Show the debug interface


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


[ Top ]
static method stopTimer  [line 140]

  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 239]

  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 422]

  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 529]

  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 347]

  static void _buildInterface( )

Build the debug interface


API Tags:
Access:  protected


[ Top ]
static method _buildMenu  [line 368]

  static void _buildMenu( )

Build the debug menu


API Tags:
Access:  protected


[ Top ]
static method _buildMsgPanel  [line 458]

  static void _buildMsgPanel( )

Build the log panel


API Tags:
Access:  protected


[ Top ]
static method _buildPhpInfo  [line 556]

  static void _buildPhpInfo( )

Format phpinfo() function


API Tags:
Access:  protected


[ Top ]
static method _buildQueriesPanel  [line 468]

  static void _buildQueriesPanel( )

Build the sql panel


API Tags:
Access:  protected


[ Top ]
static method _buildTimerPanel  [line 477]

  static void _buildTimerPanel( )

Build the timer panel


API Tags:
Access:  protected


[ Top ]
static method _buildVarsPanel  [line 488]

  static void _buildVarsPanel( )

Build the vars panel


API Tags:
Access:  protected


[ Top ]
static method _buildW3cPanel  [line 541]

  static void _buildW3cPanel( )

Build the W3C panel


API Tags:
Access:  protected


[ Top ]
static method _checkAccess  [line 219]

  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 754]

  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 697]

  static void _compressHtml( $html  )

Compress the html before render

Parameters:
   $html: 

API Tags:
Access:  protected


[ Top ]
static method _debugTrace  [line 318]

  static void _debugTrace( )

Trace php


API Tags:
Access:  protected


[ Top ]
static method _includeCss  [line 569]

  static void _includeCss( )

Include the css for the debug interface


API Tags:
Access:  protected


[ Top ]
static method _includeJs  [line 616]

  static void _includeJs( )

Include the javascript for the debug interface


API Tags:
Access:  protected


[ Top ]
static method _lastError  [line 331]

  static void _lastError( )

Get fatal error on shutdown


API Tags:
Access:  protected


[ Top ]
static method _menuLinks  [line 387]

  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 398]

  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 706]

  static void _phpInfoArray( )

Format phpinfo() into an array


API Tags:
Access:  protected


[ Top ]
static method _sortBuffer  [line 302]

  static void _sortBuffer( )

Sort the buffer


API Tags:
Access:  protected


[ Top ]

Documentation generated on Sun, 27 Jan 2013 18:45:06 +0100 by phpDocumentor 1.4.3