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

Class: Debug

Source Location: /sources/debug.php

Class Overview


Debug : Class that provide a simple and fast way to debug a php application.


Author(s):

Version:

  • BETA 1.0

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 131]
Debug : Class that provide a simple and fast way to debug a php application.

Debug class allows you to debug all you need about your application Debug queries, process time, dump variable and much more...




Tags:

since:  17 oct 2003
version:  BETA 1.0
author:  COil, Loic Vernet <mailto:coil@strangebuzz.com>


[ Top ]


Class Variables

$CellBoldStatus = array (    DBGLINE_STD => false,
                           DBGLINE_QUERY => true,
                           DBGLINE_QUERY_REL => false,
                           DBGLINE_ENV => false,
                           DBGLINE_CURRENTFILE => true,
                           DBGLINE_APPERROR => true,
                           DBGLINE_CREDITS => true,
                           DBGLINE_SEARCH => true,
                           DBGLINE_OBJECT => false,
                           DBGLINE_PROCESSPERF => false,
                           DBGLINE_TEMPLATES => false,
                           DBGLINE_PAGEACTION => true,
                           DBGLINE_ARRAY => false )

[line 316]

Bold style for DebugType : $DebugType => Bold Style



Tags:

access:  public

Type:   array


[ Top ]

$CellColors = array (   DBGLINE_STD => '#000000', 
                        DBGLINE_QUERY => '#FFA500', 
                        DBGLINE_QUERY_REL => '#228B22',
                        DBGLINE_ENV => '#FF0000',
                        DBGLINE_CURRENTFILE => '#000000',
                        DBGLINE_APPERROR => '#FF0000',
                        DBGLINE_CREDITS => '#000000',
                        DBGLINE_SEARCH => '#000000',
                        DBGLINE_OBJECT => '#000000',
                        DBGLINE_PROCESSPERF => '#000000',
                        DBGLINE_TEMPLATES => '#000000',
                        DBGLINE_PAGEACTION => '#708090',
                        DBGLINE_ARRAY => '#000000' )

[line 296]

Color for DebugType : $DebugType => Color Code of text



Tags:

access:  public

Type:   array


[ Top ]

$DatabaseName =  'mysql'

[line 364]

Name of database that we are working on



Tags:

access:  public

Type:   string


[ Top ]

$DebugMode =  DBG_MODE_USERPERF

[line 140]

Debug Mode



Tags:

see:  DBG_MODE constants.
access:  public

Type:   integer


[ Top ]

$DisableCredits =  false

[line 158]

Enable or disable Credits in debug infos.



Tags:

see:  DebugLine
access:  public

Type:   integer


[ Top ]

$DisplayTypeInSearch = array (    DBGLINE_STD => false ,
                              DBGLINE_QUERY => false ,
                              DBGLINE_QUERY_REL => false ,
                              DBGLINE_ENV => false ,
                              DBGLINE_CURRENTFILE => true ,
                              DBGLINE_APPERROR => false ,
                              DBGLINE_CREDITS => true ,
                              DBGLINE_SEARCH => true ,
                              DBGLINE_OBJECT => false ,
                              DBGLINE_PROCESSPERF => true ,
                              DBGLINE_TEMPLATES => false ,
                              DBGLINE_PAGEACTION => false ,
                              DBGLINE_ARRAY => false )

[line 336]

Bold style for DebugType : $DebugType => Bold Style



Tags:

access:  public

Type:   array


[ Top ]

$EnableSearch =  true

[line 264]

Enable or disable search in debug



Tags:

access:  public

Type:   boolean


[ Top ]

$HtmlTableEnd =  '</table>'

[line 176]

HTML end string to close HTML display for debug layout



Tags:

access:  public

Type:   string


[ Top ]

$HtmlTableStart =  '<br><table cellspacing="0" cellpading="0" border="1" width="100%">'

[line 168]

HTML Start String

Start string of HTML layout




Tags:

access:  public

Type:   string


[ Top ]

$PhpMyAdminUrl =  'http://127.0.0.1/mysql'

[line 356]

Base URL of phpmyadmin



Tags:

access:  public

Type:   string


[ Top ]

$RemoveTemplatesPattern =  false

[line 240]

Enable or disable, pattern removing in included files



Tags:

access:  public

Type:   boolean


[ Top ]

$ShowGlobals =  false

[line 256]

Enable or disable $globals var in debug



Tags:

access:  public

Type:   boolean


[ Top ]

$ShowTemplates =  true

[line 232]

Enable or disable, included and required files



Tags:

access:  public

Type:   boolean


[ Top ]

$UseRequestArr =  false

[line 272]

Enable or disable the use of $_REQUEST array instead of $_POST + _$GET + $_COOKIE + $_FILES



Tags:

access:  public

Type:   boolean


[ Top ]

$ViewSourceScriptName =  'source.php'

[line 288]

View Source script path



Tags:

access:  public

Type:   string


[ Top ]

$ViewSourceScriptPath =  '.'

[line 280]

View Source script path



Tags:

var:  default : Current directory
access:  public

Type:   string


[ Top ]

$_DataPerfQry =  0

[line 224]

Number of performed queries



Tags:

access:  private

Type:   integer


[ Top ]

$_DataPerfTotal =  0

[line 216]

Global database process time



Tags:

access:  private

Type:   integer


[ Top ]

$_DebugBuffer = array()

[line 149]

This is the array where debug line are.



Tags:

see:  DebugLine
access:  private

Type:   array


[ Top ]

$_ProcessPerfEnd =  0

[line 208]

Debug End time



Tags:

access:  private

Type:   integer


[ Top ]

$_ProcessPerfStart =  0

[line 200]

Debug Start time



Tags:

access:  private

Type:   integer


[ Top ]

$_ProcessPerfStartGen =  0

[line 192]

General debug start time



Tags:

access:  private

Type:   integer


[ Top ]

$_ProcessPerfStatus =  false

[line 184]

Process perf status, 1 = a process is being running, 0 = no activity



Tags:

access:  private

Type:   String


[ Top ]

$_TemplatesPattern = array()

[line 248]

Pattern list to remove in the display of included files



Tags:

access:  private

Type:   boolean


[ Top ]



Class Methods


constructor Debug [line 380]

mixed Debug( [mixed $debugmode = DBG_MODE_DEFAULT], integer $debugmode )

Debug() : Constructor of Debug object

Set debugmode, credits line and search line are added at creation if they are activated.




Tags:

return:  Debug Object
access:  public
since:  17 Oct 2003
see:  Debug::Debug()


Parameters:

integer   $debugmode   

[ Top ]

method addDebug [line 600]

void addDebug( string $str, [integer $typeDebug = DBGLINE_STD], [string $file = STR_N], [string $line = STR_N], [string $title = STR_N])

addDebug() : Build a new debug line info.

If $str is a String or an object we switch automatically to the corresponding debug info type. If debug mode is OFF does not do anything and return. Debug line is build, then it is added in the DebugLine array.




Tags:

access:  public
since:  10 Nov 2003


Parameters:

string   $str   debug string/object
integer   $typeDebug   Debug type of line ( Optional, Default = DBGLINE_STD )
string   $file   File of debug info ( Optional, Default = "" )
string   $line   Line of debug info ( Optional, Default = "" )
string   $title   Title of variable if applicable ( Optional, Default = "" )

[ Top ]

method addRequiredFilesPattern [line 784]

void addRequiredFilesPattern( string $pattern, [mixed $replace_str = STR_N])

addRequiredFilesPattern() : Add a remove pattern to remove pattern array.



Tags:

access:  public
since:  20 Oct 2003


Parameters:

string   $pattern   Pattern to add

[ Top ]

method CancelPerf [line 702]

void CancelPerf( Integer $processtype)

CancelPerf() : Cancel a process time monitoring, error or misc exception



Tags:

access:  public
since:  13 Dec 2003


Parameters:

Integer   $processtype   Type of the process to cancel

[ Top ]

method DebugDisplay [line 934]

void DebugDisplay( [mixed $SearchSTR = STR_N], [integer $display_mode = DBG_MODE_AUTO], string $search_str)

DebugDisplay() : This is the funtcion to display debug infos



Tags:

access:  public
since:  20 Oct 2003


Parameters:

string   $search_str   Search string ( Optional, default = "" )
integer   $display_mode   Mode of display ( DBG_MODE_AUTO )

[ Top ]

method DebugPerf [line 637]

void DebugPerf( [integer $processtype = DBGLINE_QUERY])

DebugPerf() : Get process time and stats about database processing.

If $processtype is DBG_PERF_QRY then a query has been run, otherwise it is another database process. The start and end time is computed, and the global time is updated.




Tags:

access:  public
since:  20 Oct 2003


Parameters:

integer   $processtype   Type of database debug query or database related.

[ Top ]

method delRequiredFilesPattern [line 797]

void delRequiredFilesPattern( string $pattern)

delRequiredFilesPattern() : Del a remove pattern from remove pattern array.



Tags:

access:  public
since:  20 Oct 2003


Parameters:

string   $pattern   Pattern to remove

[ Top ]

method DumpArr [line 521]

mixed DumpArr( array $arr, [string $varname = DUMP_ARR_TABNAME], [integer $mode = DUMP_ARR_DISP])

DumpArr() : Display all content of an array

Mode DUMP_ARR_DISP display the array Mode DUMP_ARR_STR return the infos as a string




Tags:

return:  Nothing or string depending on the mode
access:  public
static:  
since:  20 Oct 2003


Parameters:

array   $arr   array Array to debug
string   $varname   Name of the variable
integer   $mode   Mode of function

[ Top ]

method DumpObj [line 557]

mixed DumpObj( array $obj, [string $varname = DUMP_ARR_OBJNAME], [integer $mode = DUMP_ARR_DISP])

DumpObj() : Debug an object or array with Var_Dump pear package

( Not useable with standalone version ) Mode DUMP_ARR_DISP display the array Mode DUMP_ARR_STR return the infos as a string




Tags:

return:  Nothing or string depending on the mode
access:  public
static:  
since:  10 Nov 2003


Parameters:

array   $obj   Object to debug
string   $varname   Name of the variable
integer   $mode   Mode of function

[ Top ]

method getBoldCode [line 444]

string getBoldCode( mixed $DebugLineType)

getBoldCode() : Retrieve Bold cell status of the debug cell



Tags:

access:  public
since:  25 Oct 2003
see:  Debug::$CellBoldStatus


[ Top ]

method getColorCode [line 430]

string getColorCode( mixed $DebugLineType)

getColorCode() : Retrieve color code of the debug cell



Tags:

access:  public
since:  25 Oct 2003
see:  CellColor


[ Top ]

method getDebugMode [line 416]

void getDebugMode( )

getDebugMode() : Return current debug mode



Tags:

access:  public
since:  14 Nov 2003
see:  Debug::$DebugMode


[ Top ]

method getElapsedTime [line 476]

numeric getElapsedTime( $timeStart $timeStart, $timeEnd $timeEnd)

getElapsedTime() : get elapsed time between 2 timestamp



Tags:

return:  difference between the two time ref
access:  public
since:  20 Oct 2003
see:  Debug::getProcessTime()


Parameters:

$timeStart   $timeStart   Start time ref
$timeEnd   $timeEnd   End time ref

[ Top ]

method getMicroTime [line 459]

numeric getMicroTime( $time $time)

getMicroTime() : Return micotime from a timestamp



Tags:

return:  Micotime of timestamp param
access:  public
since:  14 Nov 2003
see:  Debug::$DebugMode


Parameters:

$time   $time   Timestamp to retrieve micro time

[ Top ]

method getProcessTime [line 490]

numeric getProcessTime( )

getProcessTime() : Get global process time



Tags:

return:  Elapsed time between the start and end time
access:  public
since:  20 Oct 2003
see:  Debug::getElapsedTime()


[ Top ]

method HighLightKeyWords [line 906]

void HighLightKeyWords( mixed $SearchStr)

HighLightKeyWords : Highligth a keyword in the debug info



[ Top ]

method setDebugMode [line 404]

void setDebugMode( mixed $debugmode, integer $debugmode )

setDebugMode() : Set debug mode of Debug Object



Tags:

access:  public
since:  14 Nov 2003
see:  Debug::$DebugMode


Parameters:

integer   $debugmode   

[ Top ]

method UnitTests [line 1036]

void UnitTests( [mixed $fullmode = false])

UniTtests() : Make the unit tests of the debug class



Tags:

access:  public
since:  22 Nov 2003


[ Top ]

method _addProcessTime [line 879]

void _addProcessTime( )

_addProcessTime() : Add the process time information to the debug infos



Tags:

access:  private
since:  12 Dec 2003
see:  DBG_GLOBAL, Debug::DebugDisplay()


[ Top ]

method _addSuperArray [line 809]

void _addSuperArray( mixed $SuperArrayType)

addSuperArray() : Add a super array to the debug informations



Tags:

access:  private
since:  12 Dec 2003
see:  DBG_GLOBAL, Debug::DebugDisplay()


[ Top ]

method _getLastDebugLineID [line 727]

void _getLastDebugLineID( integer $debugtype)

getLastDebugLineID : Retrieve the ID of last debugline type in _DebugBuffer array



Tags:

access:  private
since:  20 Nov 2003
see:  Debug::DebugPerf(), Debug::$_DebugBuffer


Parameters:

integer   $debugtype   Type of debug we want to get the last index

[ Top ]

method _IncludeRequiredFiles [line 749]

void _IncludeRequiredFiles( )

_IncludeRequiredFiles() : Build debug line with all included or required files for current file.

Use the get_required_files() function, then build the formatted string with links to edit and to view source of each files. Debug info line is added in current debug object.




Tags:

access:  private
since:  20 Oct 2003


[ Top ]

method _StopProcessTime [line 501]

void _StopProcessTime( )

_StopProcessTime() : Fix the end time of process



Tags:

access:  private
since:  17 Novt 2003


[ Top ]


Documentation generated on Mon, 15 Dec 2003 18:46:45 +0100 by phpDocumentor 1.2.3