Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
36834c11
Commit
36834c11
authored
Feb 16, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add database.profile config option.
parent
b29f8a88
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
database.php
application/config/database.php
+14
-0
connection.php
laravel/database/connection.php
+5
-2
No files found.
application/config/database.php
View file @
36834c11
...
@@ -2,6 +2,20 @@
...
@@ -2,6 +2,20 @@
return
array
(
return
array
(
/*
|--------------------------------------------------------------------------
| Database Query Logging
|--------------------------------------------------------------------------
|
| By default, the SQL, bindings, and execution time are logged in an array
| for you to review. They can be retrieved via the DB::profile() method.
| However, in some situations, you may want to disable logging for
| ultra high-volume database work. You can do so here.
|
*/
'profile'
=>
true
,
/*
/*
|--------------------------------------------------------------------------
|--------------------------------------------------------------------------
| Default Database Connection
| Default Database Connection
...
...
laravel/database/connection.php
View file @
36834c11
<?php
namespace
Laravel\Database
;
use
PDO
,
PDOStatement
,
Laravel\Event
;
<?php
namespace
Laravel\Database
;
use
PDO
,
PDOStatement
,
Laravel\
Config
,
Laravel\
Event
;
class
Connection
{
class
Connection
{
...
@@ -222,7 +222,10 @@ class Connection {
...
@@ -222,7 +222,10 @@ class Connection {
// Once we have execute the query, we log the SQL, bindings, and
// Once we have execute the query, we log the SQL, bindings, and
// execution time in a static array that is accessed by all of
// execution time in a static array that is accessed by all of
// the connections used by the application.
// the connections used by the application.
if
(
Config
::
get
(
'database.profile'
))
{
$this
->
log
(
$sql
,
$bindings
,
$time
);
$this
->
log
(
$sql
,
$bindings
,
$time
);
}
return
array
(
$statement
,
$result
);
return
array
(
$statement
,
$result
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment