Moodle  2.2.1
http://www.collinsharper.com
FirePHP Class Reference

Public Member Functions

 __construct ()
 __sleep ()
 setEnabled ($Enabled)
 getEnabled ()
 setObjectFilter ($Class, $Filter)
 setOptions ($Options)
 registerErrorHandler ()
 errorHandler ($errno, $errstr, $errfile, $errline, $errcontext)
 registerExceptionHandler ()
 exceptionHandler ($Exception)
 setProcessorUrl ($URL)
 setRendererUrl ($URL)
 group ($Name)
 groupEnd ()
 log ($Object, $Label=null)
 info ($Object, $Label=null)
 warn ($Object, $Label=null)
 error ($Object, $Label=null)
 dump ($Key, $Variable)
 trace ($Label)
 table ($Label, $Table)
 detectClientExtension ()
 fb ($Object)

Static Public Member Functions

static getInstance ($AutoCreate=false)
static init ()

Data Fields

const VERSION = '0.2.0'
const LOG = 'LOG'
const INFO = 'INFO'
const WARN = 'WARN'
const ERROR = 'ERROR'
const DUMP = 'DUMP'
const TRACE = 'TRACE'
const EXCEPTION = 'EXCEPTION'
const TABLE = 'TABLE'
const GROUP_START = 'GROUP_START'
const GROUP_END = 'GROUP_END'

Protected Member Functions

 _standardizePath ($Path)
 _escapeTrace ($Trace)
 _escapeTraceFile ($File)
 setHeader ($Name, $Value)
 getUserAgent ()
 newException ($Message)
 jsonEncode ($Object, $skipObjectEncode=false)
 encodeTable ($Table)
 encodeObject ($Object, $ObjectDepth=1, $ArrayDepth=1)

Static Protected Member Functions

static is_utf8 ($str)

Protected Attributes

 $messageIndex = 1
 $options = array()
 $objectFilters = array()
 $objectStack = array()
 $enabled = true

Static Protected Attributes

static $instance = null

Detailed Description

Definition at line 58 of file FirePHP.php.


Constructor & Destructor Documentation

The object constructor

Definition at line 192 of file FirePHP.php.


Member Function Documentation

__sleep ( )

When the object gets serialized only include specific object members.

Returns:
array

Definition at line 204 of file FirePHP.php.

_escapeTrace ( Trace) [protected]

Escape trace path for windows systems

Parameters:
array$Trace
Returns:
array

Definition at line 748 of file FirePHP.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_escapeTraceFile ( File) [protected]

Escape file information of trace for windows systems

Parameters:
string$File
Returns:
string

Definition at line 767 of file FirePHP.php.

Here is the caller graph for this function:

_standardizePath ( Path) [protected]

Standardizes path for windows systems.

Parameters:
string$Path
Returns:
string

Definition at line 738 of file FirePHP.php.

Here is the caller graph for this function:

Check if FirePHP is installed on client

Returns:
boolean

Definition at line 472 of file FirePHP.php.

Here is the call graph for this function:

Here is the caller graph for this function:

dump ( Key,
Variable 
)

Dumps key and variable to firebug server panel

See also:
FirePHP::DUMP
Parameters:
string$Key
mixed$Variable
Returns:
true
Exceptions:
Exception

Definition at line 438 of file FirePHP.php.

Here is the call graph for this function:

encodeObject ( Object,
ObjectDepth = 1,
ArrayDepth = 1 
) [protected]

Encodes an object including members with protected and private visibility

Parameters:
Object$ObjectThe object to be encoded
int$DepthThe current traversal depth
Returns:
array All members of the object

Definition at line 858 of file FirePHP.php.

Here is the caller graph for this function:

encodeTable ( Table) [protected]

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

Parameters:
array$TableThe table to be encoded
Returns:
array

Definition at line 838 of file FirePHP.php.

Here is the call graph for this function:

Here is the caller graph for this function:

error ( Object,
Label = null 
)

Log object with label to firebug console

See also:
FirePHP::ERROR
Parameters:
mixes$Object
string$Label
Returns:
true
Exceptions:
Exception

Definition at line 425 of file FirePHP.php.

Here is the call graph for this function:

errorHandler ( errno,
errstr,
errfile,
errline,
errcontext 
)

FirePHP's error handler

Throws exception for each php error that will occur.

Parameters:
int$errno
string$errstr
string$errfile
int$errline
array$errcontext

Definition at line 304 of file FirePHP.php.

exceptionHandler ( Exception)

FirePHP's exception handler

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

Parameters:
Exception$Exception
Exceptions:
Exception

Definition at line 332 of file FirePHP.php.

Here is the call graph for this function:

fb ( Object)

Log varible to Firebug

See also:
http://www.firephp.org/Wiki/Reference/Fb
Parameters:
mixed$ObjectThe variable to be logged
Returns:
true Return TRUE if message was added to headers, FALSE otherwise
Exceptions:
Exception

Definition at line 489 of file FirePHP.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Check if logging is enabled

Returns:
boolean TRUE if enabled

Definition at line 245 of file FirePHP.php.

static getInstance ( AutoCreate = false) [static]

Gets singleton instance of FirePHP

Parameters:
boolean$AutoCreate
Returns:
FirePHP

Definition at line 214 of file FirePHP.php.

Here is the call graph for this function:

getUserAgent ( ) [protected]

Get user agent

Returns:
string|false

Definition at line 794 of file FirePHP.php.

Here is the caller graph for this function:

group ( Name)

Start a group for following messages

Parameters:
string$Name
Returns:
true
Exceptions:
Exception

Definition at line 363 of file FirePHP.php.

Here is the call graph for this function:

groupEnd ( )

Ends a group you have started before

Returns:
true
Exceptions:
Exception

Definition at line 373 of file FirePHP.php.

Here is the call graph for this function:

info ( Object,
Label = null 
)

Log object with label to firebug console

See also:
FirePHP::INFO
Parameters:
mixes$Object
string$Label
Returns:
true
Exceptions:
Exception

Definition at line 399 of file FirePHP.php.

Here is the call graph for this function:

static init ( ) [static]

Creates FirePHP object and stores it for singleton access

Returns:
FirePHP

Definition at line 226 of file FirePHP.php.

Here is the caller graph for this function:

static is_utf8 ( str) [static, protected]

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

Parameters:
mixed$strString to be tested
Returns:
boolean

Definition at line 991 of file FirePHP.php.

jsonEncode ( Object,
skipObjectEncode = false 
) [protected]

Encode an object into a JSON string

Uses PHP's jeson_encode() if available

Parameters:
object$ObjectThe object to be encoded
Returns:
string The JSON string

Definition at line 817 of file FirePHP.php.

Here is the call graph for this function:

Here is the caller graph for this function:

log ( Object,
Label = null 
)

Log object with label to firebug console

See also:
FirePHP::LOG
Parameters:
mixes$Object
string$Label
Returns:
true
Exceptions:
Exception

Definition at line 386 of file FirePHP.php.

Here is the call graph for this function:

newException ( Message) [protected]

Returns a new exception

Parameters:
string$Message
Returns:
Exception

Definition at line 805 of file FirePHP.php.

Here is the caller graph for this function:

Register FirePHP as your error handler

Will throw exceptions for each php error.

Definition at line 283 of file FirePHP.php.

Register FirePHP as your exception handler

Definition at line 319 of file FirePHP.php.

setEnabled ( Enabled)

Enable and disable logging to Firebug

Parameters:
boolean$EnabledTRUE to enable, FALSE to disable
Returns:
void

Definition at line 236 of file FirePHP.php.

setHeader ( Name,
Value 
) [protected]

Send header

Parameters:
string$Name
string_type$Value

Definition at line 785 of file FirePHP.php.

Here is the caller graph for this function:

setObjectFilter ( Class,
Filter 
)

Specify a filter to be used when encoding an object

Filters are used to exclude object members.

Parameters:
string$ClassThe class name of the object
array$FilterAn array or members to exclude
Returns:
void

Definition at line 258 of file FirePHP.php.

setOptions ( Options)

Set some options for the library

Options:

  • maxObjectDepth: The maximum depth to traverse objects (default: 10)
  • maxArrayDepth: The maximum depth to traverse arrays (default: 20)
  • useNativeJsonEncode: If true will use json_encode() (default: true)
  • includeLineNumbers: If true will include line numbers and filenames (default: true)
Parameters:
array$OptionsThe options to be set
Returns:
void

Definition at line 274 of file FirePHP.php.

setProcessorUrl ( URL)

Set custom processor url for FirePHP

Parameters:
string$URL

Definition at line 341 of file FirePHP.php.

Here is the call graph for this function:

setRendererUrl ( URL)

Set custom renderer url for FirePHP

Parameters:
string$URL

Definition at line 351 of file FirePHP.php.

Here is the call graph for this function:

table ( Label,
Table 
)

Log a table in the firebug console

See also:
FirePHP::TABLE
Parameters:
string$Label
string$Table
Returns:
true
Exceptions:
Exception

Definition at line 463 of file FirePHP.php.

Here is the call graph for this function:

trace ( Label)

Log a trace in the firebug console

See also:
FirePHP::TRACE
Parameters:
string$Label
Returns:
true
Exceptions:
Exception

Definition at line 450 of file FirePHP.php.

Here is the call graph for this function:

warn ( Object,
Label = null 
)

Log object with label to firebug console

See also:
FirePHP::WARN
Parameters:
mixes$Object
string$Label
Returns:
true
Exceptions:
Exception

Definition at line 412 of file FirePHP.php.

Here is the call graph for this function:


Field Documentation

$enabled = true [protected]

Definition at line 187 of file FirePHP.php.

$instance = null [static, protected]

Definition at line 152 of file FirePHP.php.

$messageIndex = 1 [protected]

Definition at line 159 of file FirePHP.php.

$objectFilters = array() [protected]

Definition at line 173 of file FirePHP.php.

$objectStack = array() [protected]

Definition at line 180 of file FirePHP.php.

$options = array() [protected]

Definition at line 166 of file FirePHP.php.

const DUMP = 'DUMP'

Definition at line 108 of file FirePHP.php.

const ERROR = 'ERROR'

Definition at line 101 of file FirePHP.php.

const EXCEPTION = 'EXCEPTION'

Definition at line 124 of file FirePHP.php.

const GROUP_END = 'GROUP_END'

Definition at line 145 of file FirePHP.php.

Definition at line 138 of file FirePHP.php.

const INFO = 'INFO'

Definition at line 83 of file FirePHP.php.

const LOG = 'LOG'

Definition at line 74 of file FirePHP.php.

const TABLE = 'TABLE'

Definition at line 131 of file FirePHP.php.

const TRACE = 'TRACE'

Definition at line 115 of file FirePHP.php.

const VERSION = '0.2.0'

Definition at line 65 of file FirePHP.php.

const WARN = 'WARN'

Definition at line 92 of file FirePHP.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations