Changeset 3096
- Timestamp:
- 12/19/06 22:37:26 (2 years ago)
- Files:
-
- trunk/lib/debug/sfWebDebug.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/debug/sfWebDebug.class.php
r2808 r3096 24 24 $max_priority = 1000, 25 25 $types = array(), 26 $last_time_log = -1, 27 $context = null; 26 $last_time_log = -1; 28 27 29 28 protected static … … 53 52 public function registerAssets() 54 53 { 55 if (!$this->context) 56 { 57 $this->context = sfContext::getInstance(); 58 } 54 $response = sfContext::getInstance()->getResponse(); 59 55 60 56 // 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'); 63 59 } 64 60 … … 365 361 public function decorateContentWithDebug($internalUri, $content, $new = false) 366 362 { 363 $context = sfContext::getInstance(); 364 367 365 // 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')) 369 367 { 370 368 return $content; 371 369 } 372 370 373 $bg_color = $new ? '#9ff' : '#ff9'; 374 375 $cache = $this->context->getViewCacheManager(); 371 $cache = $context->getViewCacheManager(); 376 372 $this->loadHelpers(); 377 373 374 $bg_color = $new ? '#9ff' : '#ff9'; 378 375 $last_modified = $cache->lastModified($internalUri); 379 376 $id = md5($internalUri);