Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Zend_Wildfire_Plugin_FirePhp Class Reference

Public Member Functions

 setEnabled ($enabled)
 Enable or disable sending of messages to user-agent.
 
 getEnabled ()
 Determine if logging to user-agent is enabled.
 
 setOption ($key, $value)
 Set a single option.
 
 getOption ($key)
 Retrieve a single option.
 
 getOptions ()
 Retrieve all options.
 
 setObjectFilter ($class, $filter)
 Specify a filter to be used when encoding an object.
 
 getUri ()
 Get the unique indentifier for this plugin.
 
 flushMessages ($protocolUri)
 Flush any buffered data.
 

Static Public Member Functions

static init ($class=null)
 Create singleton instance.
 
static getInstance ($skipCreate=false)
 Get or create singleton instance.
 
static destroyInstance ()
 Destroys the singleton instance.
 
static group ($title, $options=array())
 Starts a group in the Firebug Console.
 
static groupEnd ()
 Ends a group in the Firebug Console.
 
static send ($var, $label=null, $style=null, $options=array())
 Logs variables to the Firebug Console via HTTP response headers and the FirePHP Firefox Extension.
 

Public Attributes

const LOG = 'LOG'
 Plain log style.
 
const INFO = 'INFO'
 Information style.
 
const WARN = 'WARN'
 Warning style.
 
const ERROR = 'ERROR'
 Error style that increments Firebug's error counter.
 
const TRACE = 'TRACE'
 Trace style showing message and expandable full stack trace.
 
const EXCEPTION = 'EXCEPTION'
 Exception style showing message and expandable full stack trace.
 
const TABLE = 'TABLE'
 Table style showing summary line and expandable table.
 
const DUMP = 'DUMP'
 Dump variable to Server panel in Firebug Request Inspector.
 
const GROUP_START = 'GROUP_START'
 Start a group in the Firebug Console.
 
const GROUP_END = 'GROUP_END'
 End a group in the Firebug Console.
 
const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/ZendFramework/FirePHP/1.6.2'
 The plugin URI for this plugin.
 
const PROTOCOL_URI = Zend_Wildfire_Protocol_JsonStream::PROTOCOL_URI
 The protocol URI for this plugin.
 
const STRUCTURE_URI_DUMP = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/Dump/0.1'
 The structure URI for the Dump structure.
 
const STRUCTURE_URI_FIREBUGCONSOLE = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'
 The structure URI for the Firebug Console structure.
 

Protected Member Functions

 __construct ()
 Constructor.
 
 _getStackTrace ($options)
 Gets a stack trace.
 
 _recordMessage ($structure, $data, $skipEncode=false)
 Record a message with the given data in the given structure.
 
 _encodeTable ($table)
 Encodes a table by encoding each row and column with _encodeObject()
 
 _encodeTrace ($trace)
 Encodes a trace by encoding all "args" with _encodeObject()
 
 _encodeObject ($object, $objectDepth=1, $arrayDepth=1)
 Encode an object by generating an array containing all object members.
 

Protected Attributes

 $_enabled = true
 
 $_channel = null
 
 $_messages = array()
 
 $_options
 
 $_objectFilters = array()
 
 $_objectStack = array()
 

Static Protected Attributes

static $_instance = null
 

Constructor & Destructor Documentation

__construct ( )
protected

Constructor.

Returns
void

Member Function Documentation

_encodeObject (   $object,
  $objectDepth = 1,
  $arrayDepth = 1 
)
protected

Encode an object by generating an array containing all object members.

All private and protected members are included. Some meta info about the object class is added.

Parameters
mixed$objectThe object/array/value to be encoded
Returns
array The encoded object
_encodeTable (   $table)
protected

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

Parameters
array$TableThe table to be encoded
Returns
array
_encodeTrace (   $trace)
protected

Encodes a trace by encoding all "args" with _encodeObject()

Parameters
array$TraceThe trace to be encoded
Returns
array The encoded trace
_getStackTrace (   $options)
protected

Gets a stack trace.

Parameters
array$optionsOptions to change how the stack trace is returned
Returns
array The stack trace
_recordMessage (   $structure,
  $data,
  $skipEncode = false 
)
protected

Record a message with the given data in the given structure.

Parameters
string$structureThe structure to be used for the data
array$dataThe data to be recorded
boolean$skipEncodeTRUE if variable encoding should be skipped
Returns
boolean Returns TRUE if message was recorded
Exceptions
Zend_Wildfire_Exception
static destroyInstance ( )
static

Destroys the singleton instance.

Primarily used for testing.

Returns
void
flushMessages (   $protocolUri)

Flush any buffered data.

Parameters
string$protocolUriThe URI of the protocol that should be flushed to
Returns
void

Implements Zend_Wildfire_Plugin_Interface.

getEnabled ( )

Determine if logging to user-agent is enabled.

Returns
boolean Returns TRUE if logging is enabled.
static getInstance (   $skipCreate = false)
static

Get or create singleton instance.

Parameters
bool$skipCreateTrue if an instance should not be created
Returns
Zend_Wildfire_Plugin_FirePhp
getOption (   $key)

Retrieve a single option.

Parameters
string$keyThe name of the option
Returns
mixed The value of the option
getOptions ( )

Retrieve all options.

Returns
array All options
getUri ( )

Get the unique indentifier for this plugin.

Returns
string Returns the URI of the plugin.

Implements Zend_Wildfire_Plugin_Interface.

static group (   $title,
  $options = array() 
)
static

Starts a group in the Firebug Console.

Parameters
string$titleThe title of the group
array$optionsOPTIONAL Setting 'Collapsed' to true will initialize group collapsed instead of expanded
Returns
TRUE if the group instruction was added to the response headers or buffered.
static groupEnd ( )
static

Ends a group in the Firebug Console.

Returns
TRUE if the group instruction was added to the response headers or buffered.
static init (   $class = null)
static

Create singleton instance.

Parameters
string$classOPTIONAL Subclass of Zend_Wildfire_Plugin_FirePhp
Returns
Zend_Wildfire_Plugin_FirePhp Returns the singleton Zend_Wildfire_Plugin_FirePhp instance
Exceptions
Zend_Wildfire_Exception
static send (   $var,
  $label = null,
  $style = null,
  $options = array() 
)
static

Logs variables to the Firebug Console via HTTP response headers and the FirePHP Firefox Extension.

Parameters
mixed$varThe variable to log.
string$labelOPTIONAL Label to prepend to the log event.
string$styleOPTIONAL Style of the log event.
array$optionsOPTIONAL Options to change how messages are processed and sent
Returns
boolean Returns TRUE if the variable was added to the response headers or buffered.
Exceptions
Zend_Wildfire_Exception
setEnabled (   $enabled)

Enable or disable sending of messages to user-agent.

If disabled all headers to be sent will be removed.

Parameters
boolean$enabledSet to TRUE to enable sending of messages.
Returns
boolean The previous value.
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 of members to exclude
Returns
void
setOption (   $key,
  $value 
)

Set a single option.

Parameters
string$keyThe name of the option
mixed$valueThe value of the option
Returns
mixed The previous value of the option

Member Data Documentation

$_channel = null
protected
$_enabled = true
protected
$_instance = null
staticprotected
$_messages = array()
protected
$_objectFilters = array()
protected
$_objectStack = array()
protected
$_options
protected
Initial value:
= array(
'traceOffset' => 1,
'maxTraceDepth' => 99,
'maxObjectDepth' => 10,
'maxArrayDepth' => 20,
'includeLineNumbers' => true
)
const DUMP = 'DUMP'

Dump variable to Server panel in Firebug Request Inspector.

const ERROR = 'ERROR'

Error style that increments Firebug's error counter.

const EXCEPTION = 'EXCEPTION'

Exception style showing message and expandable full stack trace.

Also increments Firebug's error counter.

const GROUP_END = 'GROUP_END'

End a group in the Firebug Console.

const GROUP_START = 'GROUP_START'

Start a group in the Firebug Console.

const INFO = 'INFO'

Information style.

const LOG = 'LOG'

Plain log style.

const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/ZendFramework/FirePHP/1.6.2'

The plugin URI for this plugin.

const PROTOCOL_URI = Zend_Wildfire_Protocol_JsonStream::PROTOCOL_URI

The protocol URI for this plugin.

const STRUCTURE_URI_DUMP = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/Dump/0.1'

The structure URI for the Dump structure.

const STRUCTURE_URI_FIREBUGCONSOLE = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'

The structure URI for the Firebug Console structure.

const TABLE = 'TABLE'

Table style showing summary line and expandable table.

const TRACE = 'TRACE'

Trace style showing message and expandable full stack trace.

const WARN = 'WARN'

Warning style.