Class FirePHP

Description

Sends the given data to the FirePHP Firefox Extension.

The data can be displayed in the Firebug Console or in the "Server" request tab.

For more information see: http://www.firephp.org/

Located in /debug/FirePHPCore/FirePHP.class.php (line 73)


	
			
Class Constant Summary
 DUMP = 'DUMP'
 ERROR = 'ERROR'
 EXCEPTION = 'EXCEPTION'
 GROUP_END = 'GROUP_END'
 GROUP_START = 'GROUP_START'
 INFO = 'INFO'
 LOG = 'LOG'
 TABLE = 'TABLE'
 TRACE = 'TRACE'
 VERSION = '0.3'
 WARN = 'WARN'
Variable Summary
Method Summary
static array getAllRequestHeaders ()
static FirePHP getInstance ([boolean $AutoCreate = false])
static FirePHP init ()
static boolean is_utf8 (mixed $str)
static void plugin ()
static FirePHP setInstance (FirePHP $instance)
static void to ()
void assertionHandler (string $file, int $line, mixed $code)
true dump (string $Key, mixed $Variable, [ $Options = array()])
array encodeObject (Object $Object, [ $ObjectDepth = 1], [ $ArrayDepth = 1], [ $MaxDepth = 1], int $Depth)
array encodeTable (array $Table)
true error (mixes $Object, [string $Label = null], [ $Options = array()])
void errorHandler (int $errno, string $errstr, string $errfile, int $errline, array $errcontext)
void exceptionHandler (Exception $Exception)
true fb (mixed $Object)
boolean getEnabled ()
mixed getOption (string $Name)
array getOptions ()
string|false getRequestHeader ( $Name)
string|false getUserAgent ()
true group (string $Name, [array $Options = null])
true groupEnd ()
void headersSent ( &$Filename,  &$Linenum, string $Filename, integer $Linenum)
true info (mixes $Object, [string $Label = null], [ $Options = array()])
string jsonEncode (object $Object, [ $skipObjectEncode = false])
true log (mixes $Object, [string $Label = null], [ $Options = array()])
Exception newException (string $Message)
mixed registerAssertionHandler ([boolean $convertAssertionErrorsToExceptions = true], [boolean $throwAssertionExceptions = false])
mixed registerErrorHandler ([ $throwErrorExceptions = false])
void setEnabled (boolean $Enabled)
void setHeader (string $Name, string $Value)
void setLogToInsightConsole (object $console)
void setObjectFilter (string $Class, array $Filter)
void setOption (string $Name, mixed $Value)
void setOptions (array $Options)
void setProcessorUrl ( $URL)
void setRendererUrl ( $URL)
true table (string $Label, string $Table, [ $Options = array()])
true trace (string $Label)
true warn (mixes $Object, [string $Label = null], [ $Options = array()])
array _escapeTrace (array $Trace)
string _escapeTraceFile (string $File)
string _standardizePath (string $Path)
array __sleep ()
Variables
static FirePHP $instance = null (line 167)

Singleton instance of FirePHP

  • access: protected
boolean $convertAssertionErrorsToExceptions = true (line 188)

Flag whether to convert PHP assertion errors to Exceptions

  • access: protected
boolean $enabled = true (line 237)

Flag to enable/disable logging

  • access: protected
boolean $inExceptionHandler = false (line 174)

Flag whether we are logging from within the exception handler

  • access: protected
object $logToInsightConsole = null (line 244)

The insight console to log to if applicable

  • access: protected
int $messageIndex = 1 (line 202)

Wildfire protocol message index

  • access: protected
array $objectFilters = array(
'firephp' => array('objectStack', 'instance', 'json_objectStack'),'firephp_test_class'=>array('objectStack','instance','json_objectStack'))
(line 220)

Filters used to exclude object members when encoding

  • access: protected
object $objectStack = array() (line 230)

A stack of objects used to detect recursion during object encoding

  • access: protected
array $options = array('maxDepth' => 10,
'maxObjectDepth' => 5,
'maxArrayDepth' => 5,
'useNativeJsonEncode' => true,
'includeLineNumbers' => true)
(line 209)

Options for the library

  • access: protected
boolean $throwAssertionExceptions = false (line 195)

Flag whether to throw PHP assertion errors that have been converted to Exceptions

  • access: protected
boolean $throwErrorExceptions = true (line 181)

Flag whether to throw PHP errors that have been converted to ErrorExceptions

  • access: protected
Methods
static method getAllRequestHeaders (line 1136)

Get all request headers

  • access: public
static array getAllRequestHeaders ()
static method getInstance (line 262)

Gets singleton instance of FirePHP

  • access: public
static FirePHP getInstance ([boolean $AutoCreate = false])
  • boolean $AutoCreate
static method init (line 275)

Creates FirePHP object and stores it for singleton access

  • access: public
static FirePHP init ()
static method is_utf8 (line 1385)

Returns true if $string is valid UTF-8 and false otherwise.

  • access: protected
static boolean is_utf8 (mixed $str)
  • mixed $str: String to be tested
static method plugin (line 699)

Insight API wrapper

  • see: Insight_Helper::plugin()
  • access: public
static void plugin ()
static method setInstance (line 286)

Set the instance of the FirePHP singleton

  • access: public
static FirePHP setInstance (FirePHP $instance)
  • FirePHP $instance: The FirePHP object instance
static method to (line 684)

Insight API wrapper

  • see: Insight_Helper::to()
  • access: public
static void to ()
assertionHandler (line 514)

FirePHP's assertion handler

Logs all assertions to your firebug console and then stops the script.

  • access: public
void assertionHandler (string $file, int $line, mixed $code)
  • string $file: File source of assertion
  • int $line: Line source of assertion
  • mixed $code: Assertion code
detectClientExtension (line 714)

Check if FirePHP is installed on client

  • access: public
boolean detectClientExtension ()
dump (line 638)

Dumps key and variable to firebug server panel

true dump (string $Key, mixed $Variable, [ $Options = array()])
  • string $Key
  • mixed $Variable
  • $Options
encodeObject (line 1240)

Encodes an object including members with protected and private visibility

  • return: All members of the object
  • access: protected
array encodeObject (Object $Object, [ $ObjectDepth = 1], [ $ArrayDepth = 1], [ $MaxDepth = 1], int $Depth)
  • Object $Object: The object to be encoded
  • int $Depth: The current traversal depth
  • $ObjectDepth
  • $ArrayDepth
  • $MaxDepth
encodeTable (line 1210)

Encodes a table by encoding each row and column with encodeObject()

  • access: protected
array encodeTable (array $Table)
  • array $Table: The table to be encoded
error (line 624)

Log object with label to firebug console

true error (mixes $Object, [string $Label = null], [ $Options = array()])
  • mixes $Object
  • string $Label
  • $Options
errorHandler (line 433)

FirePHP's error handler

Throws exception for each php error that will occur.

  • access: public
void errorHandler (int $errno, string $errstr, string $errfile, int $errline, array $errcontext)
  • int $errno
  • string $errstr
  • string $errfile
  • int $errline
  • array $errcontext
exceptionHandler (line 471)

FirePHP's exception handler

Logs all exceptions to your firebug console and then stops the script.

  • throws: Exception
void exceptionHandler (Exception $Exception)
  • Exception $Exception
fb (line 737)

Log varible to Firebug

true fb (mixed $Object)
  • mixed $Object: The variable to be logged
getEnabled (line 325)

Check if logging is enabled

  • return: TRUE if enabled
  • access: public
boolean getEnabled ()
getOption (line 395)

Get an option from the library

  • throws: Exception
  • access: public
mixed getOption (string $Name)
  • string $Name
getOptions (line 367)

Get options from the library

  • return: The currently set options
  • access: public
array getOptions ()
getRequestHeader (line 1161)

Get a request header

  • access: protected
string|false getRequestHeader ( $Name)
  • $Name
getUserAgent (line 1125)

Get user agent

  • access: protected
string|false getUserAgent ()
group (line 543)

Start a group for following messages.

Options: Collapsed: [true|false] Color: [#RRGGBB|ColorName]

  • throws: Exception
  • access: public
true group (string $Name, [array $Options = null])
  • string $Name
  • array $Options: OPTIONAL Instructions on how to log the group
groupEnd (line 568)

Ends a group you have started before

  • throws: Exception
  • access: public
true groupEnd ()
headersSent (line 1104)

Check if headers have already been sent

  • access: protected
void headersSent ( &$Filename,  &$Linenum, string $Filename, integer $Linenum)
  • string $Filename
  • integer $Linenum
  • &$Filename
  • &$Linenum
info (line 596)

Log object with label to firebug console

true info (mixes $Object, [string $Label = null], [ $Options = array()])
  • mixes $Object
  • string $Label
  • $Options
jsonEncode (line 1189)

Encode an object into a JSON string

Uses PHP's jeson_encode() if available

  • return: The JSON string
  • access: public
string jsonEncode (object $Object, [ $skipObjectEncode = false])
  • object $Object: The object to be encoded
  • $skipObjectEncode
log (line 582)

Log object with label to firebug console

true log (mixes $Object, [string $Label = null], [ $Options = array()])
  • mixes $Object
  • string $Label
  • $Options
newException (line 1176)

Returns a new exception

  • access: protected
Exception newException (string $Message)
  • string $Message
registerAssertionHandler (line 493)

Register FirePHP driver as your assert callback

  • return: Returns the original setting or FALSE on errors
  • access: public
mixed registerAssertionHandler ([boolean $convertAssertionErrorsToExceptions = true], [boolean $throwAssertionExceptions = false])
  • boolean $convertAssertionErrorsToExceptions
  • boolean $throwAssertionExceptions
registerErrorHandler (line 410)

Register FirePHP as your error handler

Will throw exceptions for each php error.

  • return: Returns a string containing the previously defined error handler (if any)
  • access: public
mixed registerErrorHandler ([ $throwErrorExceptions = false])
  • $throwErrorExceptions
registerExceptionHandler (line 458)

Register FirePHP as your exception handler

  • return: Returns the name of the previously defined exception handler, or NULL on error. If no previous handler was defined, NULL is also returned.
  • access: public
mixed registerExceptionHandler ()
setEnabled (line 315)

Enable and disable logging to Firebug

  • access: public
void setEnabled (boolean $Enabled)
  • boolean $Enabled: TRUE to enable, FALSE to disable
setHeader (line 1115)

Send header

  • access: protected
void setHeader (string $Name, string $Value)
  • string $Name
  • string $Value
setLogToInsightConsole (line 297)

Set an Insight console to direct all logging calls to

  • access: public
void setLogToInsightConsole (object $console)
  • object $console: The console object to log to
setObjectFilter (line 339)

Specify a filter to be used when encoding an object

Filters are used to exclude object members.

  • access: public
void setObjectFilter (string $Class, array $Filter)
  • string $Class: The class name of the object
  • array $Filter: An array of members to exclude
setOption (line 380)

Set an option for the library

  • throws: Exception
  • access: public
void setOption (string $Name, mixed $Value)
  • string $Name
  • mixed $Value
setOptions (line 357)

Set some options for the library

Options:

  • maxDepth: The maximum depth to traverse (default: 10)
  • maxObjectDepth: The maximum depth to traverse objects (default: 5)
  • maxArrayDepth: The maximum depth to traverse arrays (default: 5)
  • useNativeJsonEncode: If true will use json_encode() (default: true)
  • includeLineNumbers: If true will include line numbers and filenames (default: true)

  • access: public
void setOptions (array $Options)
  • array $Options: The options to be set
setProcessorUrl (line 1772)
  • deprecated:
  • access: public
void setProcessorUrl ( $URL)
  • $URL
setRendererUrl (line 1780)
  • deprecated:
  • access: public
void setRendererUrl ( $URL)
  • $URL
table (line 674)

Log a table in the firebug console

true table (string $Label, string $Table, [ $Options = array()])
  • string $Label
  • string $Table
  • $Options
trace (line 660)

Log a trace in the firebug console

true trace (string $Label)
  • string $Label
warn (line 610)

Log object with label to firebug console

true warn (mixes $Object, [string $Label = null], [ $Options = array()])
  • mixes $Object
  • string $Label
  • $Options
_escapeTrace (line 1065)

Escape trace path for windows systems

  • access: protected
array _escapeTrace (array $Trace)
  • array $Trace
_escapeTraceFile (line 1085)

Escape file information of trace for windows systems

  • access: protected
string _escapeTraceFile (string $File)
  • string $File
_standardizePath (line 1054)

Standardizes path for windows systems.

  • access: protected
string _standardizePath (string $Path)
  • string $Path
__sleep (line 251)

When the object gets serialized only include specific object members.

  • access: public
array __sleep ()
Class Constants
DUMP = 'DUMP' (line 123)

Dumps a variable to firebug's server panel

ERROR = 'ERROR' (line 116)

Firebug ERROR level

Logs a message to firebug console, displays an error icon before the message and colors the line yellow. Also increments the firebug error count.

EXCEPTION = 'EXCEPTION' (line 139)

Displays an exception in firebug console

Increments the firebug error count.

GROUP_END = 'GROUP_END' (line 160)

Ends a group in firebug console

GROUP_START = 'GROUP_START' (line 153)

Starts a group in firebug console

INFO = 'INFO' (line 98)

Firebug INFO level

Logs a message to firebug console and displays an info icon before the message.

LOG = 'LOG' (line 89)

Firebug LOG level

Logs a message to firebug console.

TABLE = 'TABLE' (line 146)

Displays an table in firebug console

TRACE = 'TRACE' (line 130)

Displays a stack trace in firebug console

VERSION = '0.3' (line 80)

FirePHP version

WARN = 'WARN' (line 107)

Firebug WARN level

Logs a message to firebug console, displays an warning icon before the message and colors the line turquoise.

Documentation generated on Tue, 09 Aug 2011 09:04:50 +0200 by phpDocumentor 1.4.3