Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
56f1f898
Commit
56f1f898
authored
Mar 24, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #117 from nicolas-grekas/logger
missing call to logger in Connection->exec(), cleanups
parents
b89d65c3
2a1e0701
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
17 deletions
+29
-17
Connection.php
lib/Doctrine/DBAL/Connection.php
+24
-12
Statement.php
lib/Doctrine/DBAL/Statement.php
+5
-5
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
56f1f898
...
...
@@ -614,9 +614,9 @@ class Connection implements DriverConnection
$this
->
connect
();
$
hasLogger
=
$this
->
_config
->
getSQLLogger
()
!==
null
;
if
(
$
hasL
ogger
)
{
$
this
->
_config
->
getSQLLogger
()
->
startQuery
(
$query
,
$params
,
$types
);
$
logger
=
$this
->
_config
->
getSQLLogger
()
;
if
(
$
l
ogger
)
{
$
logger
->
startQuery
(
$query
,
$params
,
$types
);
}
if
(
$params
)
{
...
...
@@ -633,8 +633,8 @@ class Connection implements DriverConnection
$stmt
=
$this
->
_conn
->
query
(
$query
);
}
if
(
$
hasL
ogger
)
{
$
this
->
_config
->
getSQLLogger
()
->
stopQuery
();
if
(
$
l
ogger
)
{
$
logger
->
stopQuery
();
}
return
$stmt
;
...
...
@@ -708,7 +708,7 @@ class Connection implements DriverConnection
$args
=
func_get_args
();
$logger
=
$this
->
getConfiguration
()
->
getSQLLogger
();
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$logger
)
{
$logger
->
startQuery
(
$args
[
0
]);
}
...
...
@@ -738,9 +738,9 @@ class Connection implements DriverConnection
{
$this
->
connect
();
$
hasLogger
=
$this
->
_config
->
getSQLLogger
()
!==
null
;
if
(
$
hasL
ogger
)
{
$
this
->
_config
->
getSQLLogger
()
->
startQuery
(
$query
,
$params
,
$types
);
$
logger
=
$this
->
_config
->
getSQLLogger
()
;
if
(
$
l
ogger
)
{
$
logger
->
startQuery
(
$query
,
$params
,
$types
);
}
if
(
$params
)
{
...
...
@@ -758,8 +758,8 @@ class Connection implements DriverConnection
$result
=
$this
->
_conn
->
exec
(
$query
);
}
if
(
$
hasL
ogger
)
{
$
this
->
_config
->
getSQLLogger
()
->
stopQuery
();
if
(
$
l
ogger
)
{
$
logger
->
stopQuery
();
}
return
$result
;
...
...
@@ -774,7 +774,19 @@ class Connection implements DriverConnection
public
function
exec
(
$statement
)
{
$this
->
connect
();
return
$this
->
_conn
->
exec
(
$statement
);
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$logger
)
{
$logger
->
startQuery
(
$statement
);
}
$result
=
$this
->
_conn
->
exec
(
$statement
);
if
(
$logger
)
{
$logger
->
stopQuery
();
}
return
$result
;
}
/**
...
...
lib/Doctrine/DBAL/Statement.php
View file @
56f1f898
...
...
@@ -123,15 +123,15 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
execute
(
$params
=
null
)
{
$
hasL
ogger
=
$this
->
conn
->
getConfiguration
()
->
getSQLLogger
();
if
(
$
hasL
ogger
)
{
$
this
->
conn
->
getConfiguration
()
->
getSQLLogger
()
->
startQuery
(
$this
->
sql
,
$this
->
params
);
$
l
ogger
=
$this
->
conn
->
getConfiguration
()
->
getSQLLogger
();
if
(
$
l
ogger
)
{
$
logger
->
startQuery
(
$this
->
sql
,
$this
->
params
);
}
$stmt
=
$this
->
stmt
->
execute
(
$params
);
if
(
$
hasL
ogger
)
{
$
this
->
conn
->
getConfiguration
()
->
getSQLLogger
()
->
stopQuery
();
if
(
$
l
ogger
)
{
$
logger
->
stopQuery
();
}
$this
->
params
=
array
();
return
$stmt
;
...
...
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