Development

Changeset 12698

You must first sign up to be able to contribute.

Changeset 12698

Show
Ignore:
Timestamp:
11/06/08 19:28:19 (1 year ago)
Author:
fabien
Message:

[1.2] reverted usage of REQUEST_TIME? (closes #4797)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/config/sfApplicationConfiguration.class.php

    r12503 r12698  
    9797    $configCache = $this->getConfigCache(); 
    9898 
     99    // in debug mode, start global timer 
     100    if ($this->isDebug() && !sfWebDebugPanelTimer::isStarted()) 
     101    { 
     102      sfWebDebugPanelTimer::startTime(); 
     103    } 
     104 
    99105    // required core classes for the framework 
    100106    if (!sfConfig::get('sf_debug') && !sfConfig::get('sf_test') && !self::$coreLoaded) 
  • branches/1.2/lib/debug/sfWebDebugPanelTimer.class.php

    r11164 r12698  
    1919class sfWebDebugPanelTimer extends sfWebDebugPanel 
    2020{ 
     21  static protected 
     22    $startTime = null; 
     23 
    2124  /** 
    2225   * Constructor. 
     
    7174  } 
    7275 
     76  static public function startTime() 
     77  { 
     78    self::$startTime = microtime(true); 
     79  } 
     80 
     81  static public function isStarted() 
     82  { 
     83    return !is_null(self::$startTime); 
     84  } 
     85 
    7386  protected function getTotalTime() 
    7487  { 
    75     return isset($_SERVER['REQUEST_TIME']) ? sprintf('%.0f', (microtime(true) - $_SERVER['REQUEST_TIME']) * 1000) : 0; 
     88    return !is_null(self::$startTime) ? sprintf('%.0f', (microtime(true) - self::$startTime) * 1000) : 0; 
    7689  } 
    7790} 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.