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
1bdd4ba7
Commit
1bdd4ba7
authored
Jan 27, 2007
by
chtito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allowing to log the parameters of prepared queries
parent
a39199f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
Event.php
lib/Doctrine/Db/Event.php
+17
-2
Statement.php
lib/Doctrine/Db/Statement.php
+1
-1
No files found.
lib/Doctrine/Db/Event.php
View file @
1bdd4ba7
...
@@ -50,6 +50,10 @@ class Doctrine_Db_Event
...
@@ -50,6 +50,10 @@ class Doctrine_Db_Event
* @var string $query the sql query associated with this event (if any)
* @var string $query the sql query associated with this event (if any)
*/
*/
protected
$query
;
protected
$query
;
/**
* @var string $params the parameters associated with the query (if any)
*/
protected
$params
;
/**
/**
* @see Doctrine_Db_Event constants
* @see Doctrine_Db_Event constants
* @var integer $code the event code
* @var integer $code the event code
...
@@ -70,11 +74,12 @@ class Doctrine_Db_Event
...
@@ -70,11 +74,12 @@ class Doctrine_Db_Event
* @param integer $code the event code
* @param integer $code the event code
* @param string $query the sql query associated with this event (if any)
* @param string $query the sql query associated with this event (if any)
*/
*/
public
function
__construct
(
$invoker
,
$code
,
$query
=
null
)
public
function
__construct
(
$invoker
,
$code
,
$query
=
null
,
$params
=
array
()
)
{
{
$this
->
invoker
=
$invoker
;
$this
->
invoker
=
$invoker
;
$this
->
code
=
$code
;
$this
->
code
=
$code
;
$this
->
query
=
$query
;
$this
->
query
=
$query
;
$this
->
params
=
$params
;
}
}
/**
/**
* getQuery
* getQuery
...
@@ -161,6 +166,16 @@ class Doctrine_Db_Event
...
@@ -161,6 +166,16 @@ class Doctrine_Db_Event
{
{
return
$this
->
invoker
;
return
$this
->
invoker
;
}
}
/**
* getParams
* returns the parameters of the query
*
* @return array parameters of the query
*/
public
function
getParams
()
{
return
$this
->
params
;
}
/**
/**
* Get the elapsed time (in microseconds) that the event ran. If the event has
* Get the elapsed time (in microseconds) that the event ran. If the event has
* not yet ended, return false.
* not yet ended, return false.
...
...
lib/Doctrine/Db/Statement.php
View file @
1bdd4ba7
...
@@ -67,7 +67,7 @@ class Doctrine_Db_Statement extends PDOStatement
...
@@ -67,7 +67,7 @@ class Doctrine_Db_Statement extends PDOStatement
public
function
execute
(
array
$params
=
null
)
public
function
execute
(
array
$params
=
null
)
{
{
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Db_Event
::
EXECUTE
,
$this
->
queryString
);
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Db_Event
::
EXECUTE
,
$this
->
queryString
,
$params
);
$this
->
dbh
->
getListener
()
->
onPreExecute
(
$event
);
$this
->
dbh
->
getListener
()
->
onPreExecute
(
$event
);
...
...
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