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
fbc1d9c3
Commit
fbc1d9c3
authored
Jun 19, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
ad3f5bb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
16 deletions
+26
-16
Profiler.php
lib/Doctrine/Connection/Profiler.php
+6
-9
Statement.php
lib/Doctrine/Connection/Statement.php
+20
-7
No files found.
lib/Doctrine/Connection/Profiler.php
View file @
fbc1d9c3
...
@@ -75,9 +75,9 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
...
@@ -75,9 +75,9 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
*/
*/
public
function
__call
(
$m
,
$a
)
public
function
__call
(
$m
,
$a
)
{
{
// first argument should be an instance of Doctrine_
Db_
Event
// first argument should be an instance of Doctrine_Event
if
(
!
(
$a
[
0
]
instanceof
Doctrine_
Db_
Event
))
{
if
(
!
(
$a
[
0
]
instanceof
Doctrine_Event
))
{
throw
new
Doctrine_Connection_Profiler_Exception
(
"Couldn't listen event. Event should be an instance of Doctrine_
Db_
Event."
);
throw
new
Doctrine_Connection_Profiler_Exception
(
"Couldn't listen event. Event should be an instance of Doctrine_Event."
);
}
}
// event methods should start with 'on'
// event methods should start with 'on'
...
@@ -86,18 +86,13 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
...
@@ -86,18 +86,13 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
}
}
if
(
substr
(
$m
,
2
,
3
)
===
'Pre'
&&
substr
(
$m
,
2
,
7
)
!==
'Prepare'
)
{
if
(
substr
(
$m
,
2
,
3
)
===
'Pre'
&&
substr
(
$m
,
2
,
7
)
!==
'Prepare'
)
{
if
(
!
in_array
(
strtolower
(
substr
(
$m
,
5
)),
$this
->
listeners
))
{
throw
new
Doctrine_Connection_Profiler_Exception
(
"Couldn't invoke listener :"
.
$m
);
}
// pre-event listener found
// pre-event listener found
$a
[
0
]
->
start
();
$a
[
0
]
->
start
();
if
(
!
in_array
(
$a
[
0
],
$this
->
events
,
true
))
{
if
(
!
in_array
(
$a
[
0
],
$this
->
events
,
true
))
{
$this
->
events
[]
=
$a
[
0
];
$this
->
events
[]
=
$a
[
0
];
}
}
}
else
{
}
else
{
if
(
!
in_array
(
strtolower
(
substr
(
$m
,
2
)),
$this
->
listeners
))
{
throw
new
Doctrine_Connection_Profiler_Exception
(
"Couldn't invoke listener :"
.
$m
);
}
// after-event listener found
// after-event listener found
$a
[
0
]
->
end
();
$a
[
0
]
->
end
();
}
}
...
@@ -105,11 +100,13 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
...
@@ -105,11 +100,13 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
* If filtering by query type is enabled, only keep the query if
* If filtering by query type is enabled, only keep the query if
* it was one of the allowed types.
* it was one of the allowed types.
*/
*/
/**
if ( ! is_null($this->filterTypes)) {
if ( ! is_null($this->filterTypes)) {
if ( ! ($a[0]->getQueryType() & $this->_filterTypes)) {
if ( ! ($a[0]->getQueryType() & $this->_filterTypes)) {
}
}
}
}
*/
}
}
/**
/**
...
...
lib/Doctrine/Connection/Statement.php
View file @
fbc1d9c3
?
php
<
?php
/*
/*
* $Id: Statement.php 1532 2007-05-31 17:45:07Z zYne $
* $Id: Statement.php 1532 2007-05-31 17:45:07Z zYne $
*
*
...
@@ -32,15 +32,25 @@ Doctrine::autoload('Doctrine_Adapter_Statement_Interface');
...
@@ -32,15 +32,25 @@ Doctrine::autoload('Doctrine_Adapter_Statement_Interface');
*/
*/
class
Doctrine_Connection_Statement
implements
Doctrine_Adapter_Statement_Interface
class
Doctrine_Connection_Statement
implements
Doctrine_Adapter_Statement_Interface
{
{
protected
$_adapter
;
/**
* @var Doctrine_Connection $conn Doctrine_Connection object, every connection
* statement holds an instance of Doctrine_Connection
*/
protected
$_conn
;
protected
$_stmt
;
protected
$_stmt
;
protected
$_executed
=
false
;
protected
$_executed
=
false
;
/**
public
function
__construct
(
$adapter
,
$stmt
)
* constructor
*
* @param Doctrine_Connection $conn Doctrine_Connection object, every connection
* statement holds an instance of Doctrine_Connection
* @param mixed $stmt
*/
public
function
__construct
(
Doctrine_Connection
$conn
,
$stmt
)
{
{
$this
->
_
adapter
=
$adapter
;
$this
->
_
conn
=
$conn
;
$this
->
_stmt
=
$stmt
;
$this
->
_stmt
=
$stmt
;
if
(
$stmt
===
false
)
{
if
(
$stmt
===
false
)
{
...
@@ -48,9 +58,12 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
...
@@ -48,9 +58,12 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
}
}
}
}
/**
/**
* getConnection
* returns the connection object this statement uses
*
*
* @return Doctrine_Connection
*/
*/
public
function
get
Dbh
()
public
function
get
Connection
()
{
{
return
$this
->
_adapter
;
return
$this
->
_adapter
;
}
}
...
@@ -200,7 +213,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
...
@@ -200,7 +213,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
*/
*/
public
function
execute
(
$params
=
null
)
public
function
execute
(
$params
=
null
)
{
{
$event
=
new
Doctrine_
Db_Event
(
$this
,
Doctrine_Db
_Event
::
EXECUTE
,
$this
->
_stmt
->
queryString
,
$params
);
$event
=
new
Doctrine_
Event
(
$this
,
Doctrine
_Event
::
EXECUTE
,
$this
->
_stmt
->
queryString
,
$params
);
// print $this->_stmt->queryString . print_r($params, true) . "<br>";
// print $this->_stmt->queryString . print_r($params, true) . "<br>";
$skip
=
$this
->
_adapter
->
getListener
()
->
onPreExecute
(
$event
);
$skip
=
$this
->
_adapter
->
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