The object constructor
FirePHP
FirePHP
()
FirePHP's assertion handler
Logs all assertions to your firebug console and then stops the script.
void
assertionHandler
(string $file, int $line, mixed $code)
-
string
$file: File source of assertion
-
int
$line: Line source of assertion
-
mixed
$code: Assertion code
Check if FirePHP is installed on client
boolean
detectClientExtension
()
Dumps key and variable to firebug server panel
true
dump
(string $Key, mixed $Variable)
-
string
$Key
-
mixed
$Variable
Encodes an object
array
encodeObject
(Object $Object, [ $ObjectDepth = 1], [ $ArrayDepth = 1], int $Depth)
-
Object
$Object: The object to be encoded
-
int
$Depth: The current traversal depth
-
$ObjectDepth
-
$ArrayDepth
Encodes a table by encoding each row and column with encodeObject()
array
encodeTable
(array $Table)
-
array
$Table: The table to be encoded
Log object with label to firebug console
true
error
(mixes $Object, [string $Label = null])
-
mixes
$Object
-
string
$Label
FirePHP's error handler
Logs each php error that will occur.
void
errorHandler
(int $errno, string $errstr, string $errfile, int $errline, array $errcontext)
-
int
$errno
-
string
$errstr
-
string
$errfile
-
int
$errline
-
array
$errcontext
Log varible to Firebug
true
fb
(mixed $Object)
-
mixed
$Object: The variable to be logged
Check if logging is enabled
boolean
getEnabled
()
Gets singleton instance of FirePHP
FirePHP
&getInstance
([
boolean $AutoCreate =
false])
Get options from the library
array
getOptions
()
Get user agent
string|false
getUserAgent
()
Start a group for following messages.
Options: Collapsed: [true|false] Color: [#RRGGBB|ColorName]
true
group
(string $Name, [array $Options = null])
-
string
$Name
-
array
$Options: OPTIONAL Instructions on how to log the group
Ends a group you have started before
true
groupEnd
()
Log object with label to firebug console
true
info
(mixes $Object, [string $Label = null])
-
mixes
$Object
-
string
$Label
Returns true if $string is valid UTF-8 and false otherwise.
boolean
is_utf8
(mixed $str)
-
mixed
$str: String to be tested
Encode an object into a JSON string
Uses PHP's jeson_encode() if available
string
jsonEncode
(object $Object, [ $skipObjectEncode = false])
-
object
$Object: The object to be encoded
-
$skipObjectEncode
encodes an arbitrary variable into JSON format
mixed
json_encode
(mixed $var)
-
mixed
$var: any number, boolean, string, array, or object to be encoded. see argument 1 to Services_JSON() above for array-parsing behavior. if var is a strng, note that encode() always expects it to be in ASCII or UTF-8 format!
Log object with label to firebug console
true
log
(mixes $Object, [string $Label = null])
-
mixes
$Object
-
string
$Label
Register FirePHP driver as your assert callback
mixed
registerAssertionHandler
()
Register FirePHP as your error handler
Will use FirePHP to log each php error.
mixed
registerErrorHandler
()
Enable and disable logging to Firebug
void
setEnabled
(boolean $Enabled)
-
boolean
$Enabled: TRUE to enable, FALSE to disable
Send header
void
setHeader
(string $Name, string_type $Value)
-
string
$Name
-
string_type
$Value
Specify a filter to be used when encoding an object
Filters are used to exclude object members.
void
setObjectFilter
(string $Class, array $Filter)
-
string
$Class: The class name of the object
-
array
$Filter: An array of members to exclude
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)
void
setOptions
(array $Options)
-
array
$Options: The options to be set
Set custom processor url for FirePHP
void
setProcessorUrl
(string $URL)
Set custom renderer url for FirePHP
void
setRendererUrl
(string $URL)
Log a table in the firebug console
true
table
(string $Label, string $Table)
-
string
$Label
-
string
$Table
Log a trace in the firebug console
true
trace
(string $Label)
Log object with label to firebug console
true
warn
(mixes $Object, [string $Label = null])
-
mixes
$Object
-
string
$Label
Escape trace path for windows systems
array
_escapeTrace
(array $Trace)
Escape file information of trace for windows systems
string
_escapeTraceFile
(string $File)
Standardizes path for windows systems.
string
_standardizePath
(string $Path)
When the object gets serialized only include specific object members.
array
__sleep
()