add database.profile config option.

This commit is contained in:
Taylor Otwell
2012-02-16 08:46:48 -06:00
parent b29f8a88fe
commit 36834c1118
2 changed files with 19 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
<?php namespace Laravel\Database; use PDO, PDOStatement, Laravel\Event;
<?php namespace Laravel\Database; use PDO, PDOStatement, Laravel\Config, Laravel\Event;
class Connection {
@@ -222,7 +222,10 @@ class Connection {
// Once we have execute the query, we log the SQL, bindings, and
// execution time in a static array that is accessed by all of
// the connections used by the application.
$this->log($sql, $bindings, $time);
if (Config::get('database.profile'))
{
$this->log($sql, $bindings, $time);
}
return array($statement, $result);
}