phpDocumentor PHP_Debug
[ class tree: PHP_Debug ] [ index: PHP_Debug ] [ all elements ]

Class: Debug

Source Location: /sources/Debug.php

Class Debug

Property Summary
static array   $excludedBackTraceFunctions   Functions from this class that must be excluded in order to have the
static array   $globalEnvConstantsCorresp   Correspondance between super array constant and variable name
static array   $staticOptions   Default static options for static functions
array   $debugLineBuffer   This is the array where the debug lines are collected.
array   $defaultOptions   Default configuration options
float   $endTime   Exection end time
array   $options   Default configuration options
integer   $queryCount   Number of queries executed during script
array   $requiredFiles   This is the array containing all the required/included files of the
float   $startTime   Execution start time
array   $watches   This is the array containing all the watched variables

[ Top ]
Method Summary
static mixed   dumpVar()   Display the content of any kind of variable
static float   getElapsedTime()   Get elapsed time between 2 timestamp
static numeric   getMicroTime()   Return microtime from a timestamp
static void   getMicroTimeNow()   Alias for getMicroTime(microtime()
Debug   __construct()   PHP_Debug class constructor
void   __destruct()   Debug class destructor
void   add()   This is an alias for the addDebug function
void   addDebug()   Add a debug information
void   addDebugFirst()   Add a debug info before all the existing other debug lines
void   display()   Alias for the render function
void   dump()   This a method to dump the content of any variable and add the result in
void   error()   This is an alias for the addDebug function when wanting to add an
void   errorHandlerCallback()   Callback function for php error handling
void   getDebugBuffer()   Getter of debugString property
void   getDisplay()   Return the display
void   getOption()   Get one option
float   getProcessTime()   Get global process time
void   getQueryCount()   Getter of queryCount property
float   getQueryTime()   Get database related process time
array   getRequiredFiles()   Getter of requiredFiles property
string   getStyleSheet()   Return the style sheet of the HTML_TABLE debug object
void   isAllowed()   Test if the client is allowed to access the debug information
void   query()   This is an alias for the addDebug function when wanting to add a query
void   render()   PHP_Debug default output function, first we finish the processes and
void   restrictAcess()   Restrict access to a list of IP
void   setAction()   Set the main action of PHP script
void   setErrorHandler()   Set the callback function to process replace the php error handler,
void   setWatchCallback()   Set the callback fucntion to process the watches, enabled depending of
void   stopTimer()   Set the endtime for a Debug_Line in order to monitor the performance
void   watch()   Add a variable to the watchlist.
void   watchesCallback()   Watch callback function, process watches and add changes to the debug
void   __tostring()   Debug default output function, simply uses the static dump fonction

[ Top ]
Properties
static array   $excludedBackTraceFunctions = array(
'add',
'dump',
'error',
'query',
'addDebug',
'setAction',
'addDebugFirst',
'watchesCallback',
'errorHandlerCallback'
)
[line 108]

Functions from this class that must be excluded in order to have the

Functions from this class that must be excluded in order to have the correct backtrace information

API Tags:
See:  Debug_Line::setTraceback()

Information Tags:
Since:  V2.0.0 - 13 apr 2006

[ Top ]
static array   $globalEnvConstantsCorresp = array(
PHP_DEBUG_GLOBAL_GET => '_GET',
PHP_DEBUG_GLOBAL_POST => '_POST',
PHP_DEBUG_GLOBAL_FILES => '_FILES',
PHP_DEBUG_GLOBAL_COOKIE => '_COOKIE',
PHP_DEBUG_GLOBAL_REQUEST=> '_REQUEST',
PHP_DEBUG_GLOBAL_SESSION=> '_SESSION',
PHP_DEBUG_GLOBAL_GLOBALS=> 'GLOBALS'
)
[line 127]

Correspondance between super array constant and variable name

Correspondance between super array constant and variable name Used by renderers

Information Tags:
Since:  V2.0.0 - 18 apr 2006

[ Top ]
static array   $staticOptions = array(
'DEBUG_dump_method' => 'print_r', // print_r or var_dump
'DEBUG_pear_var_dump_method' => 'Var_Dump::display' // Var_Dump display funtion
)
[line 95]

Default static options for static functions

Default static options for static functions

API Tags:
See:  Debug::dump()

Information Tags:
Since:  V2.0.0 - 16 apr 2006

[ Top ]
array   $debugLineBuffer = array() [line 153]

This is the array where the debug lines are collected.

This is the array where the debug lines are collected.

API Tags:
Access:  protected
See:  Debug_Line

Information Tags:
Since:  V2.0.0 - 11 apr 2006

[ Top ]
array   $defaultOptions = array(
'DEBUG_render_mode' => 'HTML_Table', // Render mode
'DEBUG_restrict_access' => true, // Restrict or not the access
'DEBUG_allowed_ip' => array('127.0.0.1'),// Authorized IP to view the debug when restrcit_access is true 'DEBUG_allow_url_access'=>false,// Allow to access the debug with a special parameter in the url 'DEBUG_url_key'=>'debug',// Key for url instant access 'DEBUG_url_pass'=>'true',// Password for url instant access 'DEBUG_enable_watch'=>false,// Enable the watch function 'DEBUG_replace_errorhandler'=>true,// Replace or no the PHP errorhandler 'DEBUG_lang'=>'EN'// Language )
[line 76]

Default configuration options

Default configuration options

API Tags:
Access:  protected
See:  setOptions()

Information Tags:
Since:  V2.0.0 - 16 apr 2006

[ Top ]
float   $endTime [line 190]

Exection end time

Exection end time

API Tags:
Access:  private
See:  Debug::render()

Information Tags:
Since:  V2.0.0 - 11 apr 2006

[ Top ]
array   $options = array() [line 144]

Default configuration options

Default configuration options

API Tags:
Access:  protected
See:  setOptions()

Information Tags:
Since:  V2.0.0 - 13 apr 2006

[ Top ]
integer   $queryCount [line 198]

Number of queries executed during script

Number of queries executed during script

API Tags:
Access:  private

Information Tags:
Since:  V2.0.0 - 19 apr 2006

[ Top ]
array   $requiredFiles = array() [line 163]

This is the array containing all the required/included files of the

This is the array containing all the required/included files of the script

API Tags:
Access:  protected
See:  Debug::render(), PHP_DEBUGLINE_TEMPLATES

Information Tags:
Since:  V2.0.0 - 17 apr 2006

[ Top ]
float   $startTime [line 181]

Execution start time

Execution start time

API Tags:
Access:  private
See:  Debug::__construct()

Information Tags:
Since:  V2.0.0 - 11 apr 2006

[ Top ]
array   $watches = array() [line 172]

This is the array containing all the watched variables

This is the array containing all the watched variables

API Tags:
Access:  protected
See:  Debug::watch()

Information Tags:
Since:  V2.0.0 - 16 apr 2006

[ Top ]
Methods
static method dumpVar  [line 628]

  static mixed dumpVar( mixed $var, [ $varName = PHP_DEBUG_DUMP_VARNAME], [integer $mode = PHP_DEBUG_DUMP_DISP], string $varname  )

Display the content of any kind of variable

Display the content of any kind of variable

  • Mode PHP_DEBUG_DUMP_ARR_DISP display the array
  • Mode PHP_DEBUG_DUMP_ARR_STR return the infos as a string

Parameters:
mixed   $var:  Variable to dump
string   $varname:  Name of the variable
integer   $mode:  Mode of function
   $varName: 

API Tags:
Return:  Nothing or string depending on the mode

Information Tags:
Since:  V2.0.0 - 25 Apr 2006
Todo:  I don't know if it is a good practice to have static properties for static functions, to check

[ Top ]
static method getElapsedTime  [line 595]

  static float getElapsedTime( float $timeStart, float $timeEnd  )

Get elapsed time between 2 timestamp

Get elapsed time between 2 timestamp

Parameters:
float   $timeStart:  Start time
float   $timeEnd:  End time

API Tags:
Return:  Numeric difference between the two times ref in format 00.0000 sec
See:  Debug::getMicroTime()

Information Tags:
Since:  20 Oct 2003

[ Top ]
static method getMicroTime  [line 567]

  static numeric getMicroTime( $time $time  )

Return microtime from a timestamp

Return microtime from a timestamp

Parameters:
$time   $time:  Timestamp to retrieve micro time

API Tags:
Return:  Microtime of timestamp param
See:  $DebugMode

Information Tags:
Since:  V1.1.0 - 14 Nov 2003

[ Top ]
static method getMicroTimeNow  [line 579]

  static void getMicroTimeNow( )

Alias for getMicroTime(microtime()

Alias for getMicroTime(microtime()


API Tags:
See:  Debug::getMicroTime()

Information Tags:
Since:  V2.0.0 - 19 apr 2006

[ Top ]
Constructor __construct  [line 213]

  Debug __construct( [array $options = array()]  )

PHP_Debug class constructor

PHP_Debug class constructor Here we set :

  • the execution start time
  • the options
  • the error and watch call back functions

Parameters:
array   $options:  Array containing options to affect to Debug object and his childs

Information Tags:
Since:  V2.0.0 - 11 apr 2006

[ Top ]
Destructor __destruct  [line 765]

  void __destruct( )

Debug class destructor

Debug class destructor


Information Tags:
Since:  V2.0.0 - 11 apr 2006

[ Top ]
add  [line 269]

  void add( $info, [ $type = PHP_DEBUGLINE_STD]  )

This is an alias for the addDebug function

This is an alias for the addDebug function

Parameters:
   $info: 
   $type: 

API Tags:
Access:  public
See:  Debug::addDebug()

Information Tags:
Since:  V2.0.0 - 20 apr 2006

[ Top ]
addDebug  [line 231]

  void addDebug( string $info, [integer $type = PHP_DEBUGLINE_STD], [ $position = PHP_DEBUG_POSITIONLAST]  )

Add a debug information

Add a debug information

Parameters:
string   $info:  The main debug information (may be empty for some debug line types)
integer   $type:  Type of the Debug_Line
   $position: 

API Tags:
Access:  public
See:  Debug constants

Information Tags:
Since:  07 Apr 2006

[ Top ]
addDebugFirst  [line 258]

  void addDebugFirst( $info, [ $type = PHP_DEBUGLINE_STD]  )

Add a debug info before all the existing other debug lines

Add a debug info before all the existing other debug lines It is an alias for addDebug($info, PHP_DEBUG_POSITIONLAST)

Parameters:
   $info: 
   $type: 

API Tags:
Access:  public
See:  Debug::addDebug()

Information Tags:
Since:  13 Apr 2006

[ Top ]
display  [line 481]

  void display( )

Alias for the render function

Alias for the render function


API Tags:
Access:  public
See:  Debug::render()

Information Tags:
Since:  V2.0.0 - 17 apr 2006

[ Top ]
dump  [line 673]

  void dump( $obj, [ $varName = STR_N], mixed $var, string $varname  )

This a method to dump the content of any variable and add the result in

This a method to dump the content of any variable and add the result in the debug information

Parameters:
mixed   $var:  Variable to dump
string   $varname:  Name of the variable
   $obj: 
   $varName: 

API Tags:
Access:  public

Information Tags:
Since:  V2.0.0 - 25 Apr 2006

[ Top ]
error  [line 293]

  void error( $info  )

This is an alias for the addDebug function when wanting to add an

This is an alias for the addDebug function when wanting to add an application error

Parameters:
   $info: 

API Tags:
Access:  public
See:  Debug::addDebug(), PHP_DEBUGLINE_APPERROR

Information Tags:
Since:  V2.0.0 - 21 Apr 2006

[ Top ]
errorHandlerCallback  [line 344]

  void errorHandlerCallback( )

Callback function for php error handling

Callback function for php error handling Warning : the only PHP error codes that are processed by this user handler are : E_WARNING, E_NOTICE, E_USER_ERROR For the other error codes the standart php handler will be used


API Tags:
Access:  public
See:  Debug::$options, Debug::setErrorHandler()

Information Tags:
Since:  V2.0.0 - 17 apr 2006

[ Top ]
getDebugBuffer  [line 732]

  void getDebugBuffer( )

Getter of debugString property

Getter of debugString property


API Tags:
Access:  public
See:  Debug::$debugLineBuffer

Information Tags:
Since:  V2.0.0 - 13 apr 2006

[ Top ]
getDisplay  [line 492]

  void getDisplay( )

Return the display

Return the display


API Tags:
Access:  public
See:  Debug::render()

Information Tags:
Since:  V2.0.1 - 17 apr 2006

[ Top ]
getOption  [line 699]

  void getOption( $optionIdx, string $optionsIdx  )

Get one option

Get one option

Parameters:
string   $optionsIdx:  Name of the option to get
   $optionIdx: 

API Tags:
Access:  public

Information Tags:
Since:  V2.0.0 - 13 apr 2006

[ Top ]
getProcessTime  [line 416]

  float getProcessTime( )

Get global process time

Get global process time


API Tags:
Return:  Execution process time of the script
Access:  public
See:  Debug::getElapsedTime()

Information Tags:
Since:  V2.0.0 - 21 Apr 2006

[ Top ]
getQueryCount  [line 743]

  void getQueryCount( )

Getter of queryCount property

Getter of queryCount property


API Tags:
Access:  public
See:  Debug::$queryCount

Information Tags:
Since:  @since V2.0.0 - 21 Apr 2006

[ Top ]
getQueryTime  [line 430]

  float getQueryTime( )

Get database related process time

Get database related process time


API Tags:
Return:  Execection process time of the script for all database specific tasks
Access:  public
See:  PHP_DEBUGLINE_QUERY, PHP_DEBUGLINE_QUERYREL

Information Tags:
Since:  V2.0.0 - 21 Apr 2006

[ Top ]
getRequiredFiles  [line 721]

  array getRequiredFiles( )

Getter of requiredFiles property

Getter of requiredFiles property


API Tags:
Return:  Array with the included/required files
Access:  public
See:  Debug::$requiredFiles

Information Tags:
Since:  V2.0.0 - 13 apr 2006

[ Top ]
getStyleSheet  [line 709]

  string getStyleSheet( )

Return the style sheet of the HTML_TABLE debug object

Return the style sheet of the HTML_TABLE debug object


API Tags:
Return:  The stylesheet
Access:  public


[ Top ]
isAllowed  [line 526]

  void isAllowed( )

Test if the client is allowed to access the debug information

Test if the client is allowed to access the debug information There are several possibilities :

  • 'DEBUG_restrict_access' flag is set to false
  • 'DEBUG_restrict_access' flag is set to true and client IP is the
allowed ip in the options 'DEBUG_allowed_ip'
  • Access by url is allowed with flag 'DEBUG_allow_url_access' then
the client must enter the good key and password in the url


API Tags:
Access:  private
See:  Debug::$options, Debug::restrictAcess()

Information Tags:
Since:  V2.0.0 - 20 apr 2006

[ Top ]
query  [line 281]

  void query( $qry  )

This is an alias for the addDebug function when wanting to add a query

This is an alias for the addDebug function when wanting to add a query debug information

Parameters:
   $qry: 

API Tags:
Access:  public
See:  Debug::addDebug(), PHP_DEBUGLINE_QUERY

Information Tags:
Since:  V2.0.0 - 21 Apr 2006

[ Top ]
render  [line 456]

  void render( )

PHP_Debug default output function, first we finish the processes and

PHP_Debug default output function, first we finish the processes and then a render object is created and its render method is invoked The renderer used is set with the options, all the possible renderer are in the directory Debug/Renderer/*.php (not the files ending by '_Config.php')


API Tags:
Access:  public
See:  Debug_Renderer

Information Tags:
Since:  V2.0.0 - 13 apr 2006

[ Top ]
restrictAcess  [line 509]

  void restrictAcess( array $ip  )

Restrict access to a list of IP

Restrict access to a list of IP

Parameters:
array   $ip:  Array with IP to allow access

API Tags:
See:  Debug::$options, Debug::isAllowed()

Information Tags:
Since:  11 Apr 2006

[ Top ]
setAction  [line 688]

  void setAction( string $action  )

Set the main action of PHP script

Set the main action of PHP script

Parameters:
string   $action:  Name of the main action of the file

API Tags:
Access:  public
See:  PHP_DEBUGLINE_CURRENTFILE

Information Tags:
Since:  V2.0.0 - 25 Apr 2006

[ Top ]
setErrorHandler  [line 322]

  void setErrorHandler( )

Set the callback function to process replace the php error handler,

Set the callback function to process replace the php error handler, enabled depending of the options flag 'DEBUG_replace_errorhandler'


API Tags:
Access:  private
See:  Debug::$options, Debug::errorHandlerCallback()

Information Tags:
Since:  V2.0.0 - 16 apr 2006

[ Top ]
setWatchCallback  [line 305]

  void setWatchCallback( )

Set the callback fucntion to process the watches, enabled depending of

Set the callback fucntion to process the watches, enabled depending of the options flag 'DEBUG_enable_watch'


API Tags:
Access:  private
See:  Debug::$options, Debug::$watches, Debug::watchesCallback()

Information Tags:
Since:  V2.0.0 - 16 apr 2006

[ Top ]
stopTimer  [line 607]

  void stopTimer( )

Set the endtime for a Debug_Line in order to monitor the performance

Set the endtime for a Debug_Line in order to monitor the performance of a part of script


API Tags:
Access:  public
See:  Debug_Line::endTime

Information Tags:
Since:  V2.0.0 - 19 apr 2006

[ Top ]
watch  [line 368]

  void watch( string $variableName  )

Add a variable to the watchlist.

Add a variable to the watchlist. Watched variables must be in a declare (ticks=n) block so that every n ticks the watched variables are checked for changes. If any changes were made, the new value of the variable is recorded

Parameters:
string   $variableName:  Variable to watch

API Tags:
Access:  public
See:  Debug::watchesCallback()

Information Tags:
Since:  V2.0.0 - 17 apr 2006

[ Top ]
watchesCallback  [line 388]

  void watchesCallback( )

Watch callback function, process watches and add changes to the debug

Watch callback function, process watches and add changes to the debug information


API Tags:
Access:  public
See:  Debug::watch()

Information Tags:
Since:  V2.0.0 - 17 apr 2006

[ Top ]
__tostring  [line 755]

  void __tostring( )

Debug default output function, simply uses the static dump fonction

Debug default output function, simply uses the static dump fonction of this class


API Tags:
Access:  public
See:  Debug::dump()

Information Tags:
Since:  V2.0.0 - 11 apr 2006

[ Top ]

Documentation generated on Thu, 07 Sep 2006 00:36:16 +0200 by phpDocumentor 1.3.0