Development

Changeset 6869

You must first sign up to be able to contribute.

Changeset 6869

Show
Ignore:
Timestamp:
01/01/08 02:52:18 (1 year ago)
Author:
dwhittle
Message:

1.1: made web debug class customizable in web debug logger

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/log/sfWebDebugLogger.class.php

    r6592 r6869  
    44 * This file is part of the symfony package. 
    55 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
    6  *  
     6 * 
    77 * For the full copyright and license information, please view the LICENSE 
    88 * file that was distributed with this source code. 
     
    3535  public function initialize(sfEventDispatcher $dispatcher, $options = array()) 
    3636  { 
    37     $this->webDebug   = new sfWebDebug(); 
    3837    $this->context    = sfContext::getInstance(); 
    3938    $this->dispatcher = $dispatcher; 
    4039 
    4140    $dispatcher->connect('response.filter_content', array($this, 'filterResponseContent')); 
     41 
     42    if(is_null($this->webDebug)) 
     43    { 
     44      $this->webDebug = $this->context->has('sf_web_debug') ? $this->context->get('sf_web_debug') : new sfWebDebug(); 
     45    } 
     46 
     47    $this->context->set('sf_web_debug', $this->webDebug); 
    4248 
    4349    if (isset($options['xdebug_logging'])) 
     
    9096 
    9197    // add needed assets for the web debug toolbar 
    92     $root = $this->context->getRequest()->getRelativeUrlRoot();  
     98    $root = $this->context->getRequest()->getRelativeUrlRoot(); 
    9399    $assets = sprintf(' 
    94100      <script type="text/javascript" src="%s"></script> 
     
    121127    // if we have xdebug and dev has not disabled the feature, add some stack information 
    122128    $debugStack = array(); 
    123     if (function_exists('xdebug_get_function_stack') && $this->xdebugLogging
     129    if ($this->xdebugLogging && function_exists('xdebug_get_function_stack')
    124130    { 
    125131      foreach (xdebug_get_function_stack() as $i => $stack)