linea21-externals
[ class tree: linea21-externals ] [ index: linea21-externals ] [ all elements ]

Class: PHP_Debug

Source Location: /class/system/PHP_Debug/PHP/Debug.php

Class Overview




Variables

Constants

Methods



Class Details

[line 70]


[ Top ]


Class Variables

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

[line 154]

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



Tags:

see:  PHP_DebugLine::setTraceback()
since:  V2.0.0 - 13 apr 2006
access:  public

Type:   array


[ Top ]

static $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 173]

Correspondance between super array constant and variable name Used by renderers



Tags:

since:  V2.0.0 - 18 apr 2006
access:  public

Type:   array


[ Top ]

static $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 141]

Default static options for static functions



Tags:

see:  PHP_Debug::dump()
since:  V2.0.0 - 16 apr 2006
access:  protected

Type:   array


[ Top ]

$debugLineBuffer = array()

[line 199]

This is the array where the debug lines are collected.



Tags:

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

Default configuration options



Tags:

see:  setOptions()
since:  V2.0.0 - 16 apr 2006
access:  protected

Type:   array


[ Top ]

$endTime =

[line 236]

Exection end time



Tags:

see:  PHP_Debug::render()
since:  V2.0.0 - 11 apr 2006
access:  protected

Type:   float


[ Top ]

$options = array()

[line 190]

Default configuration options



Tags:

see:  setOptions()
since:  V2.0.0 - 13 apr 2006
access:  protected

Type:   array


[ Top ]

$queryCount =  0

[line 244]

Number of queries executed during script



Tags:

since:  V2.0.0 - 19 apr 2006
access:  protected

Type:   integer


[ Top ]

$requiredFiles = array()

[line 209]

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



Tags:

see:  PHP_Debug::render(), PHP_DebugLine::TYPE_TEMPLATES
since:  V2.0.0 - 17 apr 2006
access:  protected

Type:   array


[ Top ]

$startTime =

[line 227]

Execution start time



Tags:

see:  PHP_Debug::__construct()
since:  V2.0.0 - 11 apr 2006
access:  protected

Type:   float


[ Top ]

$watches = array()

[line 218]

This is the array containing all the watched variables



Tags:

see:  PHP_Debug::watch()
since:  V2.0.0 - 16 apr 2006
access:  protected

Type:   array


[ Top ]



Class Methods


static method dumpVar [line 841]

static 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




Tags:

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 ]

static method getElapsedTime [line 734]

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

Get elapsed time between 2 timestamp



Tags:

return:  Numeric difference between the two times ref in format 00.0000 sec
see:  PHP_Debug::getMicroTime()
since:  V1.0.0 - 20 Oct 2003
access:  public


Parameters:

float   $timeStart   Start time
float   $timeEnd   End time

[ Top ]

static method getHost [line 775]

static void getHost( )

Returns current host name.



Tags:

since:  V2.1.1 - 23 avr. 2007
access:  public


[ Top ]

static method getMicroTime [line 706]

static numeric getMicroTime( $time $time)

Return microtime from a timestamp



Tags:

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 ]

static method getMicroTimeNow [line 718]

static void getMicroTimeNow( )

Alias for getMicroTime(microtime()



Tags:

see:  PHP_Debug::getMicroTime()
since:  V2.0.0 - 19 apr 2006
access:  public


[ Top ]

static method getQueryString [line 799]

static void getQueryString( )

Return the query string



Tags:

author:  Vernet Loic
since:  2.1.1 - 23 avr. 2007
access:  public


[ Top ]

static method getScriptName [line 787]

static string getScriptName( )

Returns current script name.



Tags:

since:  V2.1.1 - 23 avr. 2007
access:  public


[ Top ]

static method getUriPrefix [line 744]

static string getUriPrefix( )

Returns Uri prefix, including protocol, hostname and server port.



Tags:

return:  Uniform resource identifier prefix
access:  public


[ Top ]

static method getUrl [line 810]

static void getUrl( )

Return the full url



Tags:

author:  Vernet Loi
since:  2.1.1 - 23 avr. 2007
access:  public


[ Top ]

static method isSecure [line 765]

static void isSecure( )

Test if url is secured



Tags:

since:  V2.1.1 - 23 avr. 2007
access:  public


[ Top ]

method add [line 320]

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

This is an alias for the addDebug function



Tags:

see:  PHP_Debug::addDebug()
since:  V2.0.0 - 20 apr 2006
access:  public


Parameters:

   $info  
   $type  

[ Top ]

method addDebug [line 277]

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

Add a debug information



Tags:

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 ]

method addDebugFirst [line 309]

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)



Tags:

see:  PHP_Debug::addDebug()
since:  V1.0.0 - 13 Apr 2006
access:  public


Parameters:

   $info  
   $type  

[ Top ]

method addProcessPerf [line 367]

void addProcessPerf( )

This is an alias for adding the monitoring of processtime



Tags:

see:  PHP_Debug::addDebug(), PHP_DebugLine::TYPE_PROCESSPERF
since:  V2.1.0 - 21 Apr 2006
access:  public


[ Top ]

method addSetting [line 409]

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

Add an application setting



Tags:

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 ]

method addSettings [line 422]

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

Add a group of settings



Tags:

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 ]

method display [line 622]

void display( )

Alias for the render function



Tags:

see:  PHP_Debug::render()
since:  V2.0.0 - 17 apr 2006
access:  public


[ Top ]

method dump [line 381]

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



Tags:

since:  V2.0.0 - 25 Apr 2006
access:  public


Parameters:

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

[ Top ]

method error [line 356]

void error( $info)

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



Tags:

see:  PHP_Debug::addDebug(), PHP_DebugLine::TYPE_APPERROR
since:  V2.0.0 - 21 Apr 2006
access:  public


Parameters:

   $info  

[ Top ]

method errorHandlerCallback [line 481]

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




Tags:

see:  PHP_Debug::$options, PHP_Debug::setErrorHandler()
since:  V2.0.0 - 17 apr 2006
access:  public


[ Top ]

method getDebugBuffer [line 922]

void getDebugBuffer( )

Getter of debugString property



Tags:

see:  PHP_Debug::$debugLineBuffer
since:  V2.0.0 - 13 apr 2006
access:  public


[ Top ]

method getOption [line 899]

void getOption( $optionIdx, string $optionsIdx)

Get one option



Tags:

since:  V2.0.0 - 13 apr 2006
access:  public


Parameters:

string   $optionsIdx   Name of the option to get
   $optionIdx  

[ Top ]

method getOutput [line 633]

void getOutput( )

Return the output without displaying it



Tags:

see:  PHP_Debug::render()
since:  V2.0.1 - 17 apr 2006
access:  public


[ Top ]

method getProcessTime [line 553]

float getProcessTime( )

Get global process time



Tags:

return:  Execution process time of the script
see:  PHP_Debug::getElapsedTime()
since:  V2.0.0 - 21 Apr 2006
access:  public


[ Top ]

method getQueryCount [line 933]

void getQueryCount( )

Getter of queryCount property



Tags:

see:  PHP_Debug::$queryCount
since:  V2.0.0 - 21 Apr 2006
access:  public


[ Top ]

method getQueryTime [line 567]

float getQueryTime( )

Get database related process time



Tags:

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 ]

method getRequiredFiles [line 911]

array getRequiredFiles( )

Getter of requiredFiles property



Tags:

return:  Array with the included/required files
see:  PHP_Debug::$requiredFiles
since:  V2.0.0 - 13 apr 2006
access:  public


[ Top ]

constructor __construct [line 259]

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




Tags:

since:  V2.0.0 - 11 apr 2006


Parameters:

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

[ Top ]

method isAllowed [line 662]

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




Tags:

see:  PHP_Debug::$options, restrictAcess()
since:  V2.0.0 - 20 apr 2006
access:  protected


[ Top ]

method query [line 332]

void query( $qry)

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



Tags:

see:  PHP_Debug::addDebug(), PHP_DebugLine::TYPE_QUERY
since:  V2.0.0 - 21 Apr 2006
access:  public


Parameters:

   $qry  

[ Top ]

method queryRel [line 344]

void queryRel( $info)

This is an alias for the addDebug function when wanting to add a database related debug info



Tags:

see:  PHP_Debug::addDebug(), PHP_DebugLine::TYPE_QUERYREL
since:  V2.1.0 - 3 apr 2007
access:  public


Parameters:

   $info  

[ Top ]

method render [line 597]

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




Tags:

see:  Debug_Renderer
since:  V2.0.0 - 13 apr 2006
access:  public


[ Top ]

method restrictAccess [line 645]

void restrictAccess( array $ip)

Restrict access to a list of IP



Tags:

see:  PHP_Debug::$options, PHP_Debug::isAllowed()
since:  V2.0.0 - 11 Apr 2006


Parameters:

array   $ip   Array with IP to allow access

[ Top ]

method setAction [line 396]

void setAction( string $action)

Set the main action of PHP script



Tags:

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 ]

method setErrorHandler [line 459]

void setErrorHandler( )

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



Tags:

see:  PHP_Debug::$options, PHP_Debug::errorHandlerCallback()
since:  V2.0.0 - 16 apr 2006
access:  protected


[ Top ]

method setWatchCallback [line 442]

void setWatchCallback( )

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



Tags:

see:  PHP_Debug::$options, PHP_Debug::$watches, PHP_Debug::watchesCallback()
since:  V2.0.0 - 16 apr 2006
access:  protected


[ Top ]

method stopTimer [line 822]

void stopTimer( )

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



Tags:

see:  PHP_DebugLine::endTime
since:  V2.0.0 - 19 apr 2006
access:  public


[ Top ]

method watch [line 505]

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




Tags:

see:  PHP_Debug::watchesCallback()
since:  V2.0.0 - 17 apr 2006
access:  public


Parameters:

string   $variableName   Variable to watch

[ Top ]

method watchesCallback [line 525]

void watchesCallback( )

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



Tags:

see:  PHP_Debug::watch()
since:  V2.0.0 - 17 apr 2006
access:  public


[ Top ]

method __toString [line 945]

void __toString( )

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



Tags:

see:  PHP_Debug::dump()
since:  V2.0.0 - 11 apr 2006
access:  public


[ Top ]


Class Constants

DUMP_DISP =  1

[line 91]

These are constant for dump() and DumpObj() functions.

  • DUMP_DISP : Tell the function to display the debug info.
  • DUMP_STR : Tell the fonction to return the debug info as a string
  • DUMP_VARNAME : Default name of Array - DBG_ARR_OBJNAME : Default name
of Object



[ Top ]

DUMP_STR =  2

[line 92]


[ Top ]

DUMP_VARNAME =  'Variable'

[line 93]


[ Top ]

GLOBAL_COOKIE =  3

[line 109]


[ Top ]

GLOBAL_FILES =  2

[line 108]


[ Top ]

GLOBAL_GET =  0

[line 106]

These are constants to define Super array environment variables


[ Top ]

GLOBAL_GLOBALS =  6

[line 112]


[ Top ]

GLOBAL_POST =  1

[line 107]


[ Top ]

GLOBAL_REQUEST =  4

[line 110]


[ Top ]

GLOBAL_SESSION =  5

[line 111]


[ Top ]

PEAR_RELEASE =  'V1.0.3'

[line 81]


[ Top ]

POSITIONFIRST =  1

[line 101]


[ Top ]

POSITIONLAST =   0

[line 100]

These are constant for addDebug functions, they set the behaviour where

the function should add the debug information in first or in last position



[ Top ]

RELEASE =  'V2.1.5'

[line 80]


[ Top ]

VERSION =  self::VERSION_STANDALONE

[line 79]


[ Top ]

VERSION_DEFAULT =  self::VERSION_STANDALONE

[line 78]


[ Top ]

VERSION_PEAR =  1

[line 77]


[ Top ]

VERSION_STANDALONE =  0

[line 76]

Possible version of class Debug


[ Top ]



Documentation generated on Thu, 03 May 2012 15:03:35 +0200 by phpDocumentor 1.4.1