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

Class: PHP_Debug

Source Location: /PHP_Debug-1.0.3/PHP/Debug.php

Class Overview




Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 71]


[ Top ]


Class Variables

$debugLineBuffer = array()

[line 200]

This is the array where the debug lines are collected.
  • See: DebugLine
  • Since: V2.0.0 - 11 apr 2006
  • Access: protected

Type:   array


[ Top ]

$defaultOptions = array(
        'render_mode'          => 'Div',              // Renderer mode
        'render_type'          => 'HTML',             // Renderer type
        'restrict_access'      => false,              // Restrict or not the access
        'allowed_ip'           => array('127.0.0.1'),// Authorized IP to view the debug when restrict_access is true
'allow_url_access'=>false,// Allow to access the debug with a special parameter in the url
'url_key'=>'debug',// Key for url instant access
'url_pass'=>'true',// Password for url instant access
'enable_watch'=>false,// Enable the watch function
'replace_errorhandler'=>true,// Replace or no the PHP errorhandler
'lang'=>'EN',// Language
)

[line 122]

Default configuration options
  • See: setOptions()
  • Since: V2.0.0 - 16 apr 2006
  • Access: protected

Type:   array


[ Top ]

$endTime =

[line 237]

Exection end time
  • See: render()
  • Since: V2.0.0 - 11 apr 2006
  • Access: protected

Type:   float


[ Top ]

$excludedBackTraceFunctions = array(
        'add', 
        'dump',
        'error', 
        'query', 
        'addDebug', 
        'setAction', 
        'addDebugFirst',
        'watchesCallback',
        'errorHandlerCallback'
    )

[line 155]

Functions from this class that must be excluded in order to have the correct backtrace information
  • See: PHP_DebugLine::setTraceback()
  • Since: V2.0.0 - 13 apr 2006
  • Access: public

Type:   array


[ Top ]

$globalEnvConstantsCorresp = array(  
        self::GLOBAL_GET    => '_GET',
        self::GLOBAL_POST   => '_POST',
        self::GLOBAL_FILES  => '_FILES',
        self::GLOBAL_COOKIE => '_COOKIE',
        self::GLOBAL_REQUEST=> '_REQUEST',
        self::GLOBAL_SESSION=> '_SESSION',
        self::GLOBAL_GLOBALS=> 'GLOBALS'
    )

[line 174]

Correspondance between super array constant and variable name Used by renderers
  • Since: V2.0.0 - 18 apr 2006
  • Access: public

Type:   array


[ Top ]

$options = array()

[line 191]

Default configuration options
  • See: setOptions()
  • Since: V2.0.0 - 13 apr 2006
  • Access: protected

Type:   array


[ Top ]

$queryCount =  0

[line 245]

Number of queries executed during script
  • Since: V2.0.0 - 19 apr 2006
  • Access: protected

Type:   integer


[ Top ]

$requiredFiles = array()

[line 210]

This is the array containing all the required/included files of the script
  • See: render(), PHP_DebugLine::TYPE_TEMPLATES
  • Since: V2.0.0 - 17 apr 2006
  • Access: protected

Type:   array


[ Top ]

$startTime =

[line 228]

Execution start time
  • See: __construct()
  • Since: V2.0.0 - 11 apr 2006
  • Access: protected

Type:   float


[ Top ]

$staticOptions = array(
        'dump_method'          => 'print_r',          // print_r or var_dump
        'pear_var_dump_method' => 'Var_Dump::display' // Var_Dump display funtion (not used for now)
    )

[line 142]

Default static options for static functions
  • See: dump()
  • Since: V2.0.0 - 16 apr 2006
  • Access: protected

Type:   array


[ Top ]

$watches = array()

[line 219]

This is the array containing all the watched variables
  • See: watch()
  • Since: V2.0.0 - 16 apr 2006
  • Access: protected

Type:   array


[ Top ]



Method Detail

add   [line 321]

void add( $info, [ $type = PHP_DebugLine::TYPE_STD])

This is an alias for the addDebug function
  • See: addDebug()
  • Since: V2.0.0 - 20 apr 2006
  • Access: public

Parameters:

   $info   — 
   $type   — 

[ Top ]

addDebug   [line 278]

void addDebug( string $info, [integer $type = PHP_DebugLine::TYPE_STD], [ $position = self::POSITIONLAST])

Add a debug information
  • See: Debug constants
  • Since: V1.0.0 - 07 Apr 2006
  • Access: public

Parameters:

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

[ Top ]

addDebugFirst   [line 310]

void addDebugFirst( $info, [ $type = PHP_DebugLine::TYPE_STD])

Add a debug info before all the existing other debug lines It is an alias for addDebug($info, self::POSITIONLAST)
  • See: addDebug
  • Since: V1.0.0 - 13 Apr 2006
  • Access: public

Parameters:

   $info   — 
   $type   — 

[ Top ]

addProcessPerf   [line 368]

void addProcessPerf( )

This is an alias for adding the monitoring of processtime
  • See: addDebug(), PHP_DebugLine::TYPE_PROCESSPERF
  • Since: V2.1.0 - 21 Apr 2006
  • Access: public

[ Top ]

addSetting   [line 410]

void addSetting( $value, $name, string $action)

Add an application setting
  • See: PHP_DebugLine::TYPE_ENV
  • Since: V2.1.0 - 02 Apr 2007
  • Access: public

Parameters:

string   $action   —  Name of the main action of the file
   $value   — 
   $name   — 

[ Top ]

addSettings   [line 423]

void addSettings( $values, $name, string $action)

Add a group of settings
  • See: PHP_DebugLine::TYPE_ENV
  • Since: V2.1.0 - 2 Apr 2007
  • Access: public

Parameters:

string   $action   —  Name of the main action of the file
   $values   — 
   $name   — 

[ Top ]

display   [line 623]

void display( )

Alias for the render function
  • See: render()
  • Since: V2.0.0 - 17 apr 2006
  • Access: public

[ Top ]

dump   [line 382]

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

This a method to dump the content of any variable and add the result in the debug information
  • Since: V2.0.0 - 25 Apr 2006
  • Access: public

Parameters:

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

[ Top ]

dumpVar   [line 842]

mixed dumpVar( mixed $var, [ $varName = self::DUMP_VARNAME], [boolean $stopExec = false], [integer $mode = self::DUMP_DISP], string $varname)

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

  • Return: Nothing or string depending on the mode
  • Since: V2.0.0 - 25 Apr 2006
  • Access: public

Parameters:

mixed   $var   —  Variable to dump
string   $varname   —  Name of the variable
integer   $mode   —  Mode of function
boolean   $stopExec   —  Stop the process after display of debug
   $varName   — 

[ Top ]

error   [line 357]

void error( $info)

This is an alias for the addDebug function when wanting to add an application error
  • See: addDebug(), PHP_DebugLine::TYPE_APPERROR
  • Since: V2.0.0 - 21 Apr 2006
  • Access: public

Parameters:

   $info   — 

[ Top ]

errorHandlerCallback   [line 482]

void errorHandlerCallback( )

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

  • See: options, setErrorHandler()
  • Since: V2.0.0 - 17 apr 2006
  • Access: public

[ Top ]

getDebugBuffer   [line 923]

void getDebugBuffer( )

Getter of debugString property
  • See: debugLineBuffer
  • Since: V2.0.0 - 13 apr 2006
  • Access: public

[ Top ]

getElapsedTime   [line 735]

float getElapsedTime( float $timeStart, float $timeEnd)

Get elapsed time between 2 timestamp
  • Return: Numeric difference between the two times ref in format 00.0000 sec
  • See: getMicroTime()
  • Since: V1.0.0 - 20 Oct 2003
  • Access: public

Parameters:

float   $timeStart   —  Start time
float   $timeEnd   —  End time

[ Top ]

getHost   [line 776]

void getHost( )

Returns current host name.
  • Since: V2.1.1 - 23 avr. 2007
  • Access: public

[ Top ]

getMicroTime   [line 707]

numeric getMicroTime( $time $time)

Return microtime from a timestamp
  • Return: Microtime of timestamp param
  • See: $DebugMode
  • Since: V1.1.0 - 14 Nov 2003
  • Access: public

Parameters:

$time   $time   —  Timestamp to retrieve micro time

[ Top ]

getMicroTimeNow   [line 719]

void getMicroTimeNow( )

Alias for getMicroTime(microtime()
  • See: getMicroTime()
  • Since: V2.0.0 - 19 apr 2006
  • Access: public

[ Top ]

getOption   [line 900]

void getOption( $optionIdx, string $optionsIdx)

Get one option
  • Since: V2.0.0 - 13 apr 2006
  • Access: public

Parameters:

string   $optionsIdx   —  Name of the option to get
   $optionIdx   — 

[ Top ]

getOutput   [line 634]

void getOutput( )

Return the output without displaying it
  • See: render()
  • Since: V2.0.1 - 17 apr 2006
  • Access: public

[ Top ]

getProcessTime   [line 554]

float getProcessTime( )

Get global process time
  • Return: Execution process time of the script
  • See: getElapsedTime()
  • Since: V2.0.0 - 21 Apr 2006
  • Access: public

[ Top ]

getQueryCount   [line 934]

void getQueryCount( )

Getter of queryCount property
  • See: queryCount
  • Since: V2.0.0 - 21 Apr 2006
  • Access: public

[ Top ]

getQueryString   [line 800]

void getQueryString( )

Return the query string
  • Author: Vernet Loic
  • Since: 2.1.1 - 23 avr. 2007
  • Access: public

[ Top ]

getQueryTime   [line 568]

float getQueryTime( )

Get database related process time
  • Return: Execection process time of the script for all database specific tasks
  • See: PHP_DebugLine::TYPE_QUERY, PHP_DebugLine::TYPE_QUERYREL
  • Since: V2.0.0 - 21 Apr 2006
  • Access: public

[ Top ]

getRequiredFiles   [line 912]

array getRequiredFiles( )

Getter of requiredFiles property
  • Return: Array with the included/required files
  • See: requiredFiles
  • Since: V2.0.0 - 13 apr 2006
  • Access: public

[ Top ]

getScriptName   [line 788]

string getScriptName( )

Returns current script name.
  • Since: V2.1.1 - 23 avr. 2007
  • Access: public

[ Top ]

getUriPrefix   [line 745]

string getUriPrefix( )

Returns Uri prefix, including protocol, hostname and server port.
  • Return: Uniform resource identifier prefix
  • Access: public

[ Top ]

getUrl   [line 811]

void getUrl( )

Return the full url
  • Author: Vernet Loi
  • Since: 2.1.1 - 23 avr. 2007
  • Access: public

[ Top ]

__construct (Constructor)   [line 260]

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

PHP_Debug class constructor

Here we set :

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

  • Since: V2.0.0 - 11 apr 2006

Parameters:

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

[ Top ]

isAllowed   [line 663]

void isAllowed( )

Test if the client is allowed to access the debug information

There are several possibilities :

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

  • See: $options, restrictAcess()
  • Since: V2.0.0 - 20 apr 2006
  • Access: protected

[ Top ]

isSecure   [line 766]

void isSecure( )

Test if url is secured
  • Since: V2.1.1 - 23 avr. 2007
  • Access: public

[ Top ]

query   [line 333]

void query( $qry)

This is an alias for the addDebug function when wanting to add a query debug information
  • See: addDebug(), PHP_DebugLine::TYPE_QUERY
  • Since: V2.0.0 - 21 Apr 2006
  • Access: public

Parameters:

   $qry   — 

[ Top ]

queryRel   [line 345]

void queryRel( $info)

This is an alias for the addDebug function when wanting to add a database related debug info
  • See: addDebug(), PHP_DebugLine::TYPE_QUERYREL
  • Since: V2.1.0 - 3 apr 2007
  • Access: public

Parameters:

   $info   — 

[ Top ]

render   [line 598]

void render( )

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')

  • See: Debug_Renderer
  • Since: V2.0.0 - 13 apr 2006
  • Access: public

[ Top ]

restrictAccess   [line 646]

void restrictAccess( array $ip)

Restrict access to a list of IP
  • See: $options, isAllowed()
  • Since: V2.0.0 - 11 Apr 2006

Parameters:

array   $ip   —  Array with IP to allow access

[ Top ]

setAction   [line 397]

void setAction( string $action)

Set the main action of PHP script
  • See: PHP_DebugLine::TYPE_CURRENTFILE
  • Since: V2.0.0 - 25 Apr 2006
  • Access: public

Parameters:

string   $action   —  Name of the main action of the file

[ Top ]

setErrorHandler   [line 460]

void setErrorHandler( )

Set the callback function to process replace the php error handler, enabled depending of the options flag 'replace_errorhandler'
  • See: options, errorHandlerCallback()
  • Since: V2.0.0 - 16 apr 2006
  • Access: protected

[ Top ]

setWatchCallback   [line 443]

void setWatchCallback( )

Set the callback fucntion to process the watches, enabled depending of the options flag 'enable_watch'
  • See: options, watches, watchesCallback()
  • Since: V2.0.0 - 16 apr 2006
  • Access: protected

[ Top ]

stopTimer   [line 823]

void stopTimer( )

Set the endtime for a DebugLine in order to monitor the performance of a part of script
  • See: PHP_DebugLine::endTime
  • Since: V2.0.0 - 19 apr 2006
  • Access: public

[ Top ]

watch   [line 506]

void watch( string $variableName)

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

  • See: watchesCallback()
  • Since: V2.0.0 - 17 apr 2006
  • Access: public

Parameters:

string   $variableName   —  Variable to watch

[ Top ]

watchesCallback   [line 526]

void watchesCallback( )

Watch callback function, process watches and add changes to the debug information
  • See: watch()
  • Since: V2.0.0 - 17 apr 2006
  • Access: public

[ Top ]

__toString   [line 946]

void __toString( )

Debug default output function, simply uses the static dump fonction of this class
  • See: dump
  • Since: V2.0.0 - 11 apr 2006
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:28:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.