Class debugHelper

Description

Class for displaying var info and taking time

  • access: public
  • version: 0.6 - 2003/07/07
  • copyright: Lennart Groetzbach <lennartg@web.de> - distributed under the LGPL
  • author: Lennart Groetzbach <lennartg@web.de>

Located in Program_Root/debugHelper.php (line 74)


	
			
Variable Summary
Array $options
Integer $_depth
String $_start
String $_stop
Method Summary
debugHelper debugHelper ([Integer $outputType = HTML], [Array $options = null])
void dump (mixed $thing, [mixed $options = null], Integer $column)
void getOptions (Integer $type, [Integer $additionalOptions = null])
Integer getTime ([String $id = 'default'])
void highlightFile (String $file, [mixed $from = 1], [mixed $count = EOF])
void message ([mixed $string = 'MESSAGE !!'], [Integer $options = null])
void startTimer ([String $id = 'default'])
Integer stopTimer ([String $id = 'default'])
void switchForType (mixed $thing, Array $functions, [Array $options = null])
void toTable (Array $array, [header $header = null], [Boolean $horizontal = true], [String $tagAddon = 'border=1'])
Integer _calculateTime (Integer $time, String $id)
void _callFunction (String $functionName, [Boolean $abortAmbiguous = false])
void _dumpArray (Array $array, Array $options)
void _dumpBoolean (Boolean $thing)
void _dumpComplete (String $res, Array $options)
void _dumpDouble (Double $thing)
void _dumpFloat (Float $thing)
void _dumpInteger (Integer $thing)
void _dumpLong (Long $thing)
void _dumpNull (mixed $thing)
void _dumpObject (Object $object, Integer $options)
void _dumpResource (Resource $thing)
void _dumpString (String $str, Array $options)
void _dumpUnknown (mixed $thing)
void _onedimhor (mixed &$array, mixed &$header)
void _onedimver (mixed &$array, mixed &$header)
void _twodimhor (mixed &$array, mixed &$headerArray)
void _twodimver (mixed &$array, mixed &$headerArray)
Variables
Array $options = null (line 131)

the option set, the debug class was created with

  • access: public
Integer $_depth (line 154)

dump depth

  • access: private
Array $_optionsHtml = array("type" => HTML,
"spacer" => "&nbsp;&nbsp;&nbsp;",
"lf" => "<br>\n",
"structOpen" => "<b>",
"structClose" => "</b>",
"specialOpen" => "<i>",
"specialClose" => "</i>",
"useErrorHandler" => true,
"echoResult" => true,
"returnResult" => false,
"convertHtml" => true,
"convertSpecial" => true,
"dumpObjectFunctions" => true,
"dumpObjectVars" => true,
"dumpObjectInheritance" => true
)
(line 83)

options for html

  • access: private
Array $_optionsPlain = array("type" => PLAIN_TEXT,
"spacer" => "",
"lf" => "\n",
"structOpen" => "",
"structClose" => "",
"specialOpen" => "",
"specialClose" => "",
"useErrorHandler" => false,
"echoResult" => false,
"returnResult" => true,
"convertHtml" => true,
"convertSpecial" => true,
"dumpObjectFunctions" => true,
"dumpObjectVars" => true,
"dumpObjectInheritance" => true
)
(line 107)

options for plain text

  • access: private
String $_start (line 139)

start time array

  • access: private
String $_stop (line 146)

stop time array

  • access: private
Methods
Constructor debugHelper (line 187)

Constructor

Defines which type of output is wanted. You can add your own options in an array

  • access: public
debugHelper debugHelper ([Integer $outputType = HTML], [Array $options = null])
  • Integer $outputType
  • Array $options:

    array( "type" => one of the constants "spacer" => spacing for one depth level "lf" => linefeed character "structOpen" => opening tags for arrays or objects "structClose" => closing tags for arrays or objects "specialOpen" => opening tags for lf, tab, newline "specialClose" => closing tags for lf, tab, newline "useErrorHandler" => true, if the internal error handler be called "echoResult" => true, if the result of dump() should be echoed "returnResult" => true, if the result of dump() should be returned "convertHtml" => true, if the special html chars should be converted "convertSpecial" => true, if the /n, /t should be converted "dumpObjectFunctions" => true, if the obj. functions should be displayed "dumpObjectVars" => true, if the obj. vars should be displayed "dumpObjectInheritance" => true, if the obj. inheritance should be displayed );

dump (line 242)

Dumps content of a variable

Is able to dump all numeric values, Strings, Arrays, Objects and Resource Types

  • access: public
void dump (mixed $thing, [mixed $options = null], Integer $column)
  • mixed $thing: the variable
  • Integer $column: current depth
getOptions (line 470)

Returns the options for a certain type

Returns the type options plus additonal ones, you provided

  • access: public
void getOptions (Integer $type, [Integer $additionalOptions = null])
  • Integer $type: the option type
  • Integer $additionalOptions: to override options
getTime (line 397)

Returns the current time

Returns the current time or 0, if id does not exist.

  • return: current time
  • access: public
Integer getTime ([String $id = 'default'])
  • String $id: timer id
highlightFile (line 419)

Highlights a file

Highlights the file source and adds line numbers

  • access: public
void highlightFile (String $file, [mixed $from = 1], [mixed $count = EOF])
  • String $file
message (line 221)

Echos a message

Good for checking if a certain part of your source code is accessed

  • access: public
void message ([mixed $string = 'MESSAGE !!'], [Integer $options = null])
  • mixed $string: text to de echoed
  • Integer $options: current options
startTimer (line 363)

Starts timing

A unique id an be given for several timings.

  • access: public
void startTimer ([String $id = 'default'])
  • String $id: timer id
stopTimer (line 380)

Stops timing

Stops timing and returns current value.

  • return: current time
  • access: public
Integer stopTimer ([String $id = 'default'])
  • String $id: timer id
switchForType (line 312)

Calls function according to the variable type

Basically works like dump() but can call user defined functions

  • access: public
void switchForType (mixed $thing, Array $functions, [Array $options = null])
  • mixed $thing: the variable
  • Array $functions:

    function array array( "object" => "_dumpObject", "array" => "_dumpArray", "integer" => "_dumpInteger", "float" => "_dumpFloat", "double" => "_dumpDouble", "long" => "_dumpLong", "string" => "_dumpString", "bool" => "_dumpBoolean", "resource" => "_dumpResource", "null" => "_dumpNull", "unknown" => "_dumpUnknown", "i_am_done" => "_dumpComplete" );

  • Array $options: array with params
toTable (line 504)

Converts an array to html table data

Returns html data for a given 1 or 2 dimensional array

  • access: public
void toTable (Array $array, [header $header = null], [Boolean $horizontal = true], [String $tagAddon = 'border=1'])
  • Array $array: array
  • header $header: optional header
  • Boolean $horizontal: horizontal or vertical ordering
  • String $tagAddon: additional data for the table tag
_calculateTime (line 540)

Calculates the time from an timer id

Called by stopTimer() and getTime()

  • return: amount of time
  • access: private
Integer _calculateTime (Integer $time, String $id)
  • Integer $time: end time
  • String $id: timer id for the start time
_callFunction (line 810)

Calls the function with given parameters

Calls functions inside or outside the class

  • access: private
void _callFunction (String $functionName, [Boolean $abortAmbiguous = false])
  • String $functionName
  • Boolean $abortAmbiguous
_dumpArray (line 585)

Dumps an array

Is called by the dump() method.

  • access: private
void _dumpArray (Array $array, Array $options)
  • Array $array: the array
  • Array $options: display options
_dumpBoolean (line 724)

Dumps a boolean

Is called by the dump() method.

  • access: private
void _dumpBoolean (Boolean $thing)
  • Boolean $thing
_dumpComplete (line 784)

Is called when the dump is complete

Is called by the dump() method.

  • access: private
void _dumpComplete (String $res, Array $options)
  • String $res
  • Array $options
_dumpDouble (line 694)

Dumps a double

Is called by the dump() method.

  • access: private
void _dumpDouble (Double $thing)
  • Double $thing
_dumpFloat (line 679)

Dumps a float

Is called by the dump() method.

  • access: private
void _dumpFloat (Float $thing)
  • Float $thing
_dumpInteger (line 664)

Dumps an integer

Is called by the dump() method.

  • access: private
void _dumpInteger (Integer $thing)
  • Integer $thing
_dumpLong (line 709)

Dumps a long

Is called by the dump() method.

  • access: private
void _dumpLong (Long $thing)
  • Long $thing
_dumpNull (line 753)

Dumps null

Is called by the dump() method.

  • access: private
void _dumpNull (mixed $thing)
  • mixed $thing
_dumpObject (line 612)

Dumps an object

Is called by the dump() method.

  • access: private
void _dumpObject (Object $object, Integer $options)
  • Object $object: the object
  • Integer $options: display options
_dumpResource (line 738)

Dumps an Resource

Is called by the dump() method.

  • access: private
void _dumpResource (Resource $thing)
  • Resource $thing
_dumpString (line 558)

Dumps a string

Is called by the dump() method.

  • access: private
void _dumpString (String $str, Array $options)
  • String $str
  • Array $options: display options
_dumpUnknown (line 768)

Dumps unknown

Is called by the dump() method.

  • access: private
void _dumpUnknown (mixed $thing)
  • mixed $thing
_onedimhor (line 877)
void _onedimhor (mixed &$array, mixed &$header)
_onedimver (line 895)
void _onedimver (mixed &$array, mixed &$header)
_twodimhor (line 839)
void _twodimhor (mixed &$array, mixed &$headerArray)
_twodimver (line 858)
void _twodimver (mixed &$array, mixed &$headerArray)

Documention generated on Mon, 7 Jul 2003 22:40:54 +0200 by phpDocumentor 1.2.1