Wildfire/Plugin/FirePhp.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Wildfire  
Subpackage
Plugin  
Version
$Id$  

\Zend_Wildfire_Plugin_FirePhp

Package: Zend_Wildfire\Plugin
Primary class for communicating with the FirePHP Firefox Extension.
Implements
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

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

Properties

>VPropertyprotected\Zend_Wildfire_Channel_Interface $_channel = null
The channel via which to send the encoded messages.
Default valuenullDetails
Type
\Zend_Wildfire_Channel_Interface
>VPropertyprotectedboolean $_enabled = true
Flag indicating whether FirePHP should send messages to the user-agent.
Default valuetrueDetails
Type
boolean
>VPropertyprotected\Zend_Wildfire_Plugin_FirePhp $_instance = null
static
Singleton instance
Default valuenullDetails
Type
\Zend_Wildfire_Plugin_FirePhp
>VPropertyprotectedarray $_messages = array()
Messages that are buffered to be sent when protocol flushes
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_objectFilters = array()
Filters used to exclude object members when encoding
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_objectStack = array()
A stack of objects used during encoding to detect recursion
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_options = array('traceOffset' => 1, 'maxTraceDepth' => 99, 'maxObjectDepth' => 10, 'maxArrayDepth' => 20, 'includeLineNumbers' => true)
Options for the object
Default valuearray('traceOffset' => 1, 'maxTraceDepth' => 99, 'maxObjectDepth' => 10, 'maxArrayDepth' => 20, 'includeLineNumbers' => true)Details
Type
array

Methods

methodprotected__construct() : void

Constructor

methodprotected_encodeObject(mixed $object,  $objectDepth = 1,  $arrayDepth = 1) : array

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
NameTypeDescription
$objectmixed

The object/array/value to be encoded

$objectDepth
$arrayDepth
Returns
TypeDescription
arrayThe encoded object
methodprotected_encodeTable( $table) : array

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

Parameters
NameTypeDescription
$table
Returns
TypeDescription
array
methodprotected_encodeTrace( $trace) : array

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

Parameters
NameTypeDescription
$trace
Returns
TypeDescription
arrayThe encoded trace
methodprotected_getStackTrace(array $options) : array

Gets a stack trace

Parameters
NameTypeDescription
$optionsarray

Options to change how the stack trace is returned

Returns
TypeDescription
arrayThe stack trace
methodprotected_recordMessage(string $structure, array $data, boolean $skipEncode = false) : boolean

Record a message with the given data in the given structure

Parameters
NameTypeDescription
$structurestring

The structure to be used for the data

$dataarray

The data to be recorded

$skipEncodeboolean

TRUE if variable encoding should be skipped

Returns
TypeDescription
booleanReturns TRUE if message was recorded
Throws
ExceptionDescription
\Zend_Wildfire_Exception
methodpublicdestroyInstance() : void
static

Destroys the singleton instance

Primarily used for testing.
methodpublicflushMessages(string $protocolUri) : void

Flush any buffered data.

Parameters
NameTypeDescription
$protocolUristring

The URI of the protocol that should be flushed to

methodpublicgetEnabled() : boolean

Determine if logging to user-agent is enabled.

Returns
TypeDescription
booleanReturns TRUE if logging is enabled.
methodpublicgetInstance(bool $skipCreate = false) : \Zend_Wildfire_Plugin_FirePhp
static

Get or create singleton instance

Parameters
NameTypeDescription
$skipCreatebool

True if an instance should not be created

Returns
TypeDescription
\Zend_Wildfire_Plugin_FirePhp
methodpublicgetOption(string $key) : mixed

Retrieve a single option

Parameters
NameTypeDescription
$keystring

The name of the option

Returns
TypeDescription
mixedThe value of the option
methodpublicgetOptions() : array

Retrieve all options

Returns
TypeDescription
arrayAll options
methodpublicgetUri() : string

Get the unique indentifier for this plugin.

Returns
TypeDescription
stringReturns the URI of the plugin.
methodpublicgroup(string $title, array $options = array()) : TRUE
static

Starts a group in the Firebug Console

Parameters
NameTypeDescription
$titlestring

The title of the group

$optionsarray

OPTIONAL Setting 'Collapsed' to true will initialize group collapsed instead of expanded

Returns
TypeDescription
TRUEif the group instruction was added to the response headers or buffered.
methodpublicgroupEnd() : TRUE
static

Ends a group in the Firebug Console

Returns
TypeDescription
TRUEif the group instruction was added to the response headers or buffered.
methodpublicinit(string $class = null) : \Zend_Wildfire_Plugin_FirePhp
static

Create singleton instance.

Parameters
NameTypeDescription
$classstring

OPTIONAL Subclass of Zend_Wildfire_Plugin_FirePhp

Returns
TypeDescription
\Zend_Wildfire_Plugin_FirePhpReturns the singleton Zend_Wildfire_Plugin_FirePhp instance
Throws
ExceptionDescription
\Zend_Wildfire_Exception
methodpublicsend(mixed $var, string $label = null, string $style = null, array $options = array()) : boolean
static

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

Parameters
NameTypeDescription
$varmixed

The variable to log.

$labelstring

OPTIONAL Label to prepend to the log event.

$stylestring

OPTIONAL Style of the log event.

$optionsarray

OPTIONAL Options to change how messages are processed and sent

Returns
TypeDescription
booleanReturns TRUE if the variable was added to the response headers or buffered.
Throws
ExceptionDescription
\Zend_Wildfire_Exception
methodpublicsetEnabled(boolean $enabled) : boolean

Enable or disable sending of messages to user-agent.

If disabled all headers to be sent will be removed.
Parameters
NameTypeDescription
$enabledboolean

Set to TRUE to enable sending of messages.

Returns
TypeDescription
booleanThe previous value.
methodpublicsetObjectFilter( $class,  $filter) : void

Specify a filter to be used when encoding an object

Filters are used to exclude object members.
Parameters
NameTypeDescription
$class
$filter
methodpublicsetOption(string $key, mixed $value) : mixed

Set a single option

Parameters
NameTypeDescription
$keystring

The name of the option

$valuemixed

The value of the option

Returns
TypeDescription
mixedThe previous value of the option
Documentation was generated by phpDocumentor 2.2.0 .