示例#1
0
 public function __construct($connection = null)
 {
     $config = Config::get('profiler');
     if ($config['useForensics'] != true) {
         return;
     }
     if ($connection instanceof Connection) {
         $this->connection = $connection;
     } else {
         if ($config['withDatabase'] == true) {
             $this->connection = DB::connection();
         }
     }
     // Setup the View path.
     $this->viewPath = realpath(__DIR__) . DS . 'Views' . DS . 'Profiler.php';
     // Setup the Start Time.
     $this->startTime = Request::server('REQUEST_TIME_FLOAT');
 }
示例#2
0
 protected function getElapsedTime()
 {
     $timestamp = microtime(true);
     $requestTime = Request::server('REQUEST_TIME_FLOAT');
     return $timestamp - $requestTime;
 }