Example #1
0
 /**
  * Gathers the script output from the buffer, replaces some execution
  * time tag in the output and displays the debug toolbar, if required.
  */
 protected function gatherOutput()
 {
     $this->output = ob_get_contents();
     ob_end_clean();
     $totalTime = $this->benchmark->getElapsedTime('total_execution');
     $this->output = str_replace('{elapsed_time}', $totalTime, $this->output);
     //--------------------------------------------------------------------
     // Display the Debug Toolbar?
     //--------------------------------------------------------------------
     if (!is_cli() && ENVIRONMENT != 'production' && $this->config->toolbarEnabled) {
         $toolbar = Services::toolbar($this->config);
         $this->output .= $toolbar->run($this->startTime, $totalTime, $this->startMemory, $this->request, $this->response);
     }
 }