web/lib/Zend/Wildfire/Plugin/FirePhp.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Wildfire
    16  * @package    Zend_Wildfire
    17  * @subpackage Plugin
    17  * @subpackage Plugin
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: FirePhp.php 23066 2010-10-09 23:29:20Z cadorn $
    20  * @version    $Id: FirePhp.php 24593 2012-01-05 20:35:02Z matthew $
    21  */
    21  */
    22 
    22 
    23 /** Zend_Controller_Request_Abstract */
    23 /** Zend_Controller_Request_Abstract */
    24 require_once('Zend/Controller/Request/Abstract.php');
    24 require_once('Zend/Controller/Request/Abstract.php');
    25 
    25 
    39  * Primary class for communicating with the FirePHP Firefox Extension.
    39  * Primary class for communicating with the FirePHP Firefox Extension.
    40  *
    40  *
    41  * @category   Zend
    41  * @category   Zend
    42  * @package    Zend_Wildfire
    42  * @package    Zend_Wildfire
    43  * @subpackage Plugin
    43  * @subpackage Plugin
    44  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    44  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    45  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    45  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    46  */
    46  */
    47 class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface
    47 class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface
    48 {
    48 {
    49     /**
    49     /**
   212     }
   212     }
   213 
   213 
   214     /**
   214     /**
   215      * Get or create singleton instance
   215      * Get or create singleton instance
   216      *
   216      *
   217      * @param $skipCreate boolean True if an instance should not be created
   217      * @param bool $skipCreate True if an instance should not be created
   218      * @return Zend_Wildfire_Plugin_FirePhp
   218      * @return Zend_Wildfire_Plugin_FirePhp
   219      */
   219      */
   220     public static function getInstance($skipCreate=false)
   220     public static function getInstance($skipCreate=false)
   221     {
   221     {
   222         if (self::$_instance===null && $skipCreate!==true) {
   222         if (self::$_instance===null && $skipCreate!==true) {
   321 
   321 
   322     /**
   322     /**
   323      * Starts a group in the Firebug Console
   323      * Starts a group in the Firebug Console
   324      *
   324      *
   325      * @param string $title The title of the group
   325      * @param string $title The title of the group
       
   326      * @param array $options OPTIONAL Setting 'Collapsed' to true will initialize group collapsed instead of expanded
   326      * @return TRUE if the group instruction was added to the response headers or buffered.
   327      * @return TRUE if the group instruction was added to the response headers or buffered.
   327      */
   328      */
   328     public static function group($title)
   329     public static function group($title, $options=array())
   329     {
   330     {
   330         return self::send(null, $title, self::GROUP_START);
   331         return self::send(null, $title, self::GROUP_START, $options);
   331     }
   332     }
   332 
   333 
   333     /**
   334     /**
   334      * Ends a group in the Firebug Console
   335      * Ends a group in the Firebug Console
   335      *
   336      *
   486         } else {
   487         } else {
   487             unset($meta['File']);
   488             unset($meta['File']);
   488             unset($meta['Line']);
   489             unset($meta['Line']);
   489         }
   490         }
   490 
   491 
       
   492         if ($meta['Type'] == self::GROUP_START) {
       
   493             if (isset($options['Collapsed'])) {
       
   494                 $meta['Collapsed'] = ($options['Collapsed'])?'true':'false';
       
   495             }
       
   496         }
       
   497 
   491         if ($meta['Type'] == self::DUMP) {
   498         if ($meta['Type'] == self::DUMP) {
   492 
   499 
   493           return $firephp->_recordMessage(self::STRUCTURE_URI_DUMP,
   500           return $firephp->_recordMessage(self::STRUCTURE_URI_DUMP,
   494                                           array('key'=>$meta['Label'],
   501                                           array('key'=>$meta['Label'],
   495                                                 'data'=>$var),
   502                                                 'data'=>$var),
   513     protected function _getStackTrace($options)
   520     protected function _getStackTrace($options)
   514     {
   521     {
   515         $trace = debug_backtrace();
   522         $trace = debug_backtrace();
   516 
   523 
   517         $trace = array_splice($trace, $options['traceOffset']);
   524         $trace = array_splice($trace, $options['traceOffset']);
   518         
   525 
   519         if (!count($trace)) {
   526         if (!count($trace)) {
   520             return $trace;
   527             return $trace;
   521         }
   528         }
   522 
   529 
   523         if (isset($options['fixZendLogOffsetIfApplicable']) && $options['fixZendLogOffsetIfApplicable']) {
   530         if (isset($options['fixZendLogOffsetIfApplicable']) && $options['fixZendLogOffsetIfApplicable']) {