protected function getSqlQueries() { $withDatabase = $this->withDatabase(); if (!$withDatabase) { return 0; } // Calculate and return the total SQL Queries. $connection = DB::connection(); $queries = $connection->getQueryLog(); return count($queries); }
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'); }