Development

Changeset 3096

You must first sign up to be able to contribute.

Changeset 3096

Show
Ignore:
Timestamp:
12/19/06 22:37:26 (2 years ago)
Author:
fabien
Message:

removed context storage in sfWebDebug to make it work within functional tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/debug/sfWebDebug.class.php

    r2808 r3096  
    2424    $max_priority    = 1000, 
    2525    $types           = array(), 
    26     $last_time_log   = -1, 
    27     $context         = null; 
     26    $last_time_log   = -1; 
    2827 
    2928  protected static 
     
    5352  public function registerAssets() 
    5453  { 
    55     if (!$this->context) 
    56     { 
    57       $this->context = sfContext::getInstance(); 
    58     } 
     54    $response = sfContext::getInstance()->getResponse(); 
    5955 
    6056    // register our css and js 
    61     $this->context->getResponse()->addJavascript(sfConfig::get('sf_web_debug_web_dir').'/js/main'); 
    62     $this->context->getResponse()->addStylesheet(sfConfig::get('sf_web_debug_web_dir').'/css/main'); 
     57    $response->addJavascript(sfConfig::get('sf_web_debug_web_dir').'/js/main'); 
     58    $response->addStylesheet(sfConfig::get('sf_web_debug_web_dir').'/css/main'); 
    6359  } 
    6460 
     
    365361  public function decorateContentWithDebug($internalUri, $content, $new = false) 
    366362  { 
     363    $context = sfContext::getInstance(); 
     364 
    367365    // don't decorate if not html or if content is null 
    368     if (!sfConfig::get('sf_web_debug') || !$content || false === strpos($this->context->getResponse()->getContentType(), 'html')) 
     366    if (!sfConfig::get('sf_web_debug') || !$content || false === strpos($context->getResponse()->getContentType(), 'html')) 
    369367    { 
    370368      return $content; 
    371369    } 
    372370 
    373     $bg_color     = $new ? '#9ff' : '#ff9'; 
    374  
    375     $cache = $this->context->getViewCacheManager(); 
     371    $cache = $context->getViewCacheManager(); 
    376372    $this->loadHelpers(); 
    377373 
     374    $bg_color      = $new ? '#9ff' : '#ff9'; 
    378375    $last_modified = $cache->lastModified($internalUri); 
    379376    $id            = md5($internalUri);