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

Class: Debug

Source Location: /sources/debug.php

Class Debug

Property Summary
array   $CellBoldStatus   Bold style for DebugType : $DebugType => Bold Style
array   $CellColors   Color for DebugType : $DebugType => Color Code of text
string   $DatabaseName   Name of database that we are working on
integer   $DebugMode   Debug Mode
mixed   $DebugObjectID   ID of debug object (0 = First object)
array   $DebugTypeLabel   Lables Color for DebugType : $DebugType => Color Code of text
integer   $DisableCredits   Enable or disable Credits in debug infos.
array   $DisplayTypeInSearch   Bold style for DebugType : $DebugType => Bold Style
boolean   $EnablePhpMyAdminLinks   Enable or not PhpMyAdmin direct links for queries
boolean   $EnableSearch   Enable or disable search in debug
mixed   $genXHTMLOutput   Variable to tell if we must generate a XHML 1.0 Strict output
string   $HtmlTableEnd   HTML end string to close HTML display for debug layout
string   $HtmlTableStart   HTML Start String
string   $maxQueryLineLength   Max Length of query to display on a single line
string   $PhpMyAdminUrl   Base URL of phpmyadmin
boolean   $RemoveTemplatesPattern   Enable or disable, pattern removing in included files
boolean   $ShowGlobals   Enable or disable $globals var in debug
boolean   $ShowTemplates   Enable or disable, included and required files
boolean   $UseRequestArr   Enable or disable the use of $_REQUEST array instead of $_POST + _$GET + $_COOKIE + $_FILES
string   $ViewSourceScriptName   View Source script path
string   $ViewSourceScriptPath   View Source script path

[ Top ]
Method Summary
mixed   Debug()   Debug() : Constructor of Debug object
void   addDebug()   addDebug() : Build a new debug line info.
void   addRequiredFilesPattern()   addRequiredFilesPattern() : Add a remove pattern to remove pattern array.
void   CancelPerf()   CancelPerf() : Cancel a process time monitoring, error or misc exception
void   DebugDisplay()   DebugDisplay() : This is the function to display debug infos
void   DebugPerf()   DebugPerf() : Get process time and stats about database processing.
void   delRequiredFilesPattern()   delRequiredFilesPattern() : Del a remove pattern from remove pattern array.
mixed   DumpArr()   DumpArr() : Display all content of an array
mixed   DumpObj()   DumpObj() : Debug an object or array with Var_Dump pear package
void   generateStyleSheet()   generateStyleSheet()
boolean   getBoldCodeType()   getBoldCodeType() : Retrieve Bold cell status of the debug cell
string   getColorCodeClass()   getColorCodeClass() : Retrieve color code class from a color
string   getColorCodeType()   getColorCodeType() : Retrieve color code of the debug cell
void   getDatabaseName()   getDatabaseName() : Get the name of database
void   getDebugMode()   getDebugMode() : Return current debug mode
numeric   getElapsedTime()   getElapsedTime() : get elapsed time between 2 timestamp
void   getMaxQueryLineLength()   getMaxQueryLineLength() : Get max query line length
numeric   getMicroTime()   getMicroTime() : Return micotime from a timestamp
void   getPhpMyAdminStatus()   getPhpMyAdminStatus() : Get PhpmyAdmin status
void   getPhpMyAdminUrl()   getPhpMyAdminUrl() : Get the url of PhpmyAdmin
numeric   getProcessTime()   getProcessTime() : Get global process time
boolean   getTypeInSearch()   getTypeInSearch() : Retrieve if debug type is displayed in search mode
void   parseSQL()   parseSQL() : Function that parse a SQL String add a debug info if it is invalid
void   runUnitTests()   UniTtests() : Make the unit tests of the debug class
void   setBoldCodeType()   setBoldCodeType() : Set Bold cell status of a debug type
void   setColorCodeType()   setColorCodeType() : Set color code of the debug cell type
void   setDatabaseName()   setDatabaseName() : Set database name for phpmyadmin links
void   setDebugMode()   setDebugMode() : Set debug mode of Debug Object
void   setMaxQueryLineLength()   setMaxQueryLineLength() : Set max query line length
void   setPhpMyAdminStatus()   setPhpMyAdminStatus($status) : Set status of phpmyadmin
void   setPhpMyAdminUrl()   setPhpMyAdminUrl() : Set the url of PhpmyAdmin
void   setTypeInSearch()   setTypeInSearch() : Set if debug type is displayed in search mode

[ Top ]
Properties
array   $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 => false,
DBGLINE_OBJECT => false,
DBGLINE_PROCESSPERF => false,
DBGLINE_TEMPLATES => false,
DBGLINE_PAGEACTION => true,
DBGLINE_ARRAY => false,
DBGLINE_SQLPARSE => true)
[line 410]

Bold style for DebugType : $DebugType => Bold Style

API Tags:
Access:  public


[ Top ]
array   $CellColors = array(DBGLINE_STD => '#000000',
DBGLINE_QUERY => '#FF8C00',
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 => '#000080',
DBGLINE_PAGEACTION => '#708090',
DBGLINE_ARRAY => '#000000',
DBGLINE_SQLPARSE => '#228B22')
[line 343]

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

API Tags:
Access:  public


[ Top ]
string   $DatabaseName = 'mysql' [line 468]

Name of database that we are working on

API Tags:
Access:  public


[ Top ]
integer   $DebugMode = DBG_MODE_DEFAULT [line 182]

Debug Mode

API Tags:
See:  DBG_MODE constants.
Access:  public


[ Top ]
mixed   $DebugObjectID = null [line 173]

ID of debug object (0 = First object)

API Tags:
Access:  public
See:  $DEBUG_OBJECT

Information Tags:
Since:  24 Dec 2003

[ Top ]
array   $DebugTypeLabel = array(DBGLINE_ANY => 'ALL',
DBGLINE_STD => 'Standart',
DBGLINE_QUERY => 'Query',
DBGLINE_QUERY_REL => 'Database Related',
DBGLINE_ENV => 'Environment',
DBGLINE_CURRENTFILE => 'Current File',
DBGLINE_APPERROR => 'Application Error',
DBGLINE_CREDITS => 'Credits',
DBGLINE_SEARCH => 'Search mode',
DBGLINE_OBJECT => 'Object Debug',
DBGLINE_PROCESSPERF => 'Performance analysis',
DBGLINE_TEMPLATES => 'Included and required files',
DBGLINE_PAGEACTION => 'Page main action',
DBGLINE_ARRAY => 'Array Debug',
DBGLINE_SQLPARSE => 'SQL Parse error')
[line 321]

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

API Tags:
Access:  public


[ Top ]
integer   $DisableCredits = false [line 200]

Enable or disable Credits in debug infos.

API Tags:
See:  DebugLine
Access:  public


[ Top ]
array   $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,
DBGLINE_SQLPARSE => false)
[line 431]

Bold style for DebugType : $DebugType => Bold Style

API Tags:
Access:  public


[ Top ]
boolean   $EnablePhpMyAdminLinks = true [line 452]

Enable or not PhpMyAdmin direct links for queries

API Tags:
Access:  public


[ Top ]
boolean   $EnableSearch = true [line 288]

Enable or disable search in debug

API Tags:
Access:  public


[ Top ]
mixed   $genXHTMLOutput = false [line 402]

Variable to tell if we must generate a XHML 1.0 Strict output

Information Tags:
Since:  13 May 2005

[ Top ]
string   $HtmlTableEnd = '
</table>
</div>'
[line 383]

HTML end string to close HTML display for debug layout

API Tags:
Access:  public


[ Top ]
string   $HtmlTableStart = '
<div>
<br /><br />
<a name="debug" id="debug" />
<table cellspacing="0" cellpadding="1" width="100%" class="dbgMainTable">'
[line 375]

HTML Start String

Start string of HTML layout

API Tags:
Access:  public


[ Top ]
string   $maxQueryLineLength = 120 [line 476]

Max Length of query to display on a single line

API Tags:
Access:  public


[ Top ]
string   $PhpMyAdminUrl = 'http://127.0.0.1/mysql' [line 460]

Base URL of phpmyadmin

API Tags:
Access:  public


[ Top ]
boolean   $RemoveTemplatesPattern = false [line 264]

Enable or disable, pattern removing in included files

API Tags:
Access:  public


[ Top ]
boolean   $ShowGlobals = false [line 280]

Enable or disable $globals var in debug

API Tags:
Access:  public


[ Top ]
boolean   $ShowTemplates = true [line 256]

Enable or disable, included and required files

API Tags:
Access:  public


[ Top ]
boolean   $UseRequestArr = false [line 297]

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

API Tags:
Access:  public


[ Top ]
string   $ViewSourceScriptName = 'source.php' [line 313]

View Source script path

API Tags:
Access:  public


[ Top ]
string   $ViewSourceScriptPath = '.' [line 305]

View Source script path

API Tags:
Access:  public


[ Top ]
Methods
Constructor Debug  [line 500]

  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.

Parameters:
integer   $debugmode : 

API Tags:
Return:  Debug Object
Access:  public
See:  Debug::Debug()

Information Tags:
Since:  17 Oct 2003

[ Top ]
addDebug  [line 931]

  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.

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 = "")

API Tags:
Access:  public

Information Tags:
Since:  10 Nov 2003

[ Top ]
addRequiredFilesPattern  [line 1124]

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

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

Parameters:
string   $pattern:  Pattern to add

API Tags:
Access:  public

Information Tags:
Since:  20 Oct 2003

[ Top ]
CancelPerf  [line 1035]

  void CancelPerf( Integer $processtype  )

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

Parameters:
Integer   $processtype:  Type of the process to cancel

API Tags:
Access:  public

Information Tags:
Since:  13 Dec 2003

[ Top ]
DebugDisplay  [line 1327]

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

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

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

API Tags:
Access:  public

Information Tags:
Since:  20 Oct 2003

[ Top ]
DebugPerf  [line 963]

  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.

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

API Tags:
Access:  public

Information Tags:
Since:  20 Oct 2003

[ Top ]
delRequiredFilesPattern  [line 1140]

  void delRequiredFilesPattern( string $pattern  )

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

Parameters:
string   $pattern:  Pattern to remove

API Tags:
Access:  public

Information Tags:
Since:  20 Oct 2003

[ Top ]
DumpArr  [line 842]

  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

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

API Tags:
Return:  Nothing or string depending on the mode
Access:  public
Static:  

Information Tags:
Since:  20 Oct 2003

[ Top ]
DumpObj  [line 881]

  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

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

API Tags:
Return:  Nothing or string depending on the mode
Access:  public
Static:  

Information Tags:
Since:  10 Nov 2003

[ Top ]
generateStyleSheet  [line 1300]

  void generateStyleSheet( )

generateStyleSheet()



[ Top ]
getBoldCodeType  [line 619]

  boolean getBoldCodeType( mixed $DebugLineType  )

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


API Tags:
Access:  public

Information Tags:
Since:  25 Oct 2003

[ Top ]
getColorCodeClass  [line 592]

  string getColorCodeClass( mixed $DebugLineType  )

getColorCodeClass() : Retrieve color code class from a color


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

Information Tags:
Since:  25 Oct 2003

[ Top ]
getColorCodeType  [line 578]

  string getColorCodeType( mixed $DebugLineType  )

getColorCodeType() : Retrieve color code of the debug cell


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

Information Tags:
Since:  25 Oct 2003

[ Top ]
getDatabaseName  [line 724]

  void getDatabaseName( )

getDatabaseName() : Get the name of database


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

Information Tags:
Since:  25 Dec 2003

[ Top ]
getDebugMode  [line 550]

  void getDebugMode( )

getDebugMode() : Return current debug mode


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

Information Tags:
Since:  14 Nov 2003

[ Top ]
getElapsedTime  [line 796]

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

getElapsedTime() : get elapsed time between 2 timestamp

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

API Tags:
Return:  difference between the two time ref
Access:  public
Static:  
See:  Debug::getProcessTime()

Information Tags:
Since:  20 Oct 2003

[ Top ]
getMaxQueryLineLength  [line 750]

  void getMaxQueryLineLength( )

getMaxQueryLineLength() : Get max query line length


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

Information Tags:
Since:  26 Dec 2003

[ Top ]
getMicroTime  [line 778]

  numeric getMicroTime( $time $time  )

getMicroTime() : Return micotime from a timestamp

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

API Tags:
Return:  Micotime of timestamp param
Access:  public
Static:  
See:  Debug::$DebugMode

Information Tags:
Since:  14 Nov 2003

[ Top ]
getPhpMyAdminStatus  [line 698]

  void getPhpMyAdminStatus( )

getPhpMyAdminStatus() : Get PhpmyAdmin status


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

Information Tags:
Since:  25 Dec 2003

[ Top ]
getPhpMyAdminUrl  [line 672]

  void getPhpMyAdminUrl( )

getPhpMyAdminUrl() : Get the url of PhpmyAdmin


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

Information Tags:
Since:  14 Nov 2003

[ Top ]
getProcessTime  [line 810]

  numeric getProcessTime( )

getProcessTime() : Get global process time


API Tags:
Return:  Elapsed time between the start and end time
Access:  public
See:  Debug::getElapsedTime()

Information Tags:
Since:  20 Oct 2003

[ Top ]
getTypeInSearch  [line 646]

  boolean getTypeInSearch( mixed $DebugLineType  )

getTypeInSearch() : Retrieve if debug type is displayed in search mode


API Tags:
Access:  public

Information Tags:
Since:  25 Oct 2003

[ Top ]
parseSQL  [line 1281]

  void parseSQL( string $sql  )

parseSQL() : Function that parse a SQL String add a debug info if it is invalid

Parameters:
string   $sql:  SQL Query to parse

API Tags:
Access:  public

Information Tags:
Since:  22 Dec 2003

[ Top ]
runUnitTests  [line 1507]

  void runUnitTests( [mixed $fullmode = false]  )

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


API Tags:
Access:  public

Information Tags:
Since:  22 Nov 2003

[ Top ]
setBoldCodeType  [line 633]

  void setBoldCodeType( Integer $DebugLineType, boolean $BoldStatus  )

setBoldCodeType() : Set Bold cell status of a debug type

Parameters:
Integer   $DebugLineType:  Type of debug line
boolean   $BoldStatus:  Status of cell true or false

API Tags:
Access:  public

Information Tags:
Since:  25 Oct 2003

[ Top ]
setColorCodeType  [line 606]

  void setColorCodeType( Integer $DebugLineType, mixed $color, String $Color  )

setColorCodeType() : Set color code of the debug cell type

Parameters:
Integer   $DebugLineType:  Type of debug line
String   $Color:  Color of cell

API Tags:
Access:  public

Information Tags:
Since:  18 Dec 2003

[ Top ]
setDatabaseName  [line 738]

  void setDatabaseName( string $DataBaseName  )

setDatabaseName() : Set database name for phpmyadmin links

Parameters:
string   $DataBaseName:  Name of database

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

Information Tags:
Since:  25 Dec 2003

[ Top ]
setDebugMode  [line 564]

  void setDebugMode( mixed $debugmode, integer $debugmode   )

setDebugMode() : Set debug mode of Debug Object

Parameters:
integer   $debugmode : 

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

Information Tags:
Since:  14 Nov 2003

[ Top ]
setMaxQueryLineLength  [line 762]

  void setMaxQueryLineLength( mixed $length  )

setMaxQueryLineLength() : Set max query line length


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

Information Tags:
Since:  26 Dec 2003

[ Top ]
setPhpMyAdminStatus  [line 712]

  void setPhpMyAdminStatus( boolean $status  )

setPhpMyAdminStatus($status) : Set status of phpmyadmin

Parameters:
boolean   $status:  True or false

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

Information Tags:
Since:  25 Dec 2003

[ Top ]
setPhpMyAdminUrl  [line 686]

  void setPhpMyAdminUrl( string $PhpMyadminUrl  )

setPhpMyAdminUrl() : Set the url of PhpmyAdmin

Parameters:
string   $PhpMyadminUrl:  URL OF phpmyadmin

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

Information Tags:
Since:  14 Nov 2003

[ Top ]
setTypeInSearch  [line 660]

  void setTypeInSearch( Integer $DebugLineType, mixed $Status, boolean $BoldStatus  )

setTypeInSearch() : Set if debug type is displayed in search mode

Parameters:
Integer   $DebugLineType:  Type of debug line
boolean   $BoldStatus:  Status of cell true or false

API Tags:
Access:  public

Information Tags:
Since:  25 Oct 2003

[ Top ]

Documentation generated on Sun, 12 Jun 2005 14:52:21 +0200 by phpDocumentor 1.3.0RC3