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
dea4968a
Commit
dea4968a
authored
Jun 25, 2007
by
subzero2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completes deprecation of Doctrine_Db. Fixes #362.
parent
fb46481a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
42 additions
and
40 deletions
+42
-40
Mock.php
lib/Doctrine/Adapter/Mock.php
+1
-1
Cache.php
lib/Doctrine/Cache.php
+10
-10
Configurable.php
lib/Doctrine/Configurable.php
+9
-5
Profiler.php
lib/Doctrine/Connection/Profiler.php
+5
-5
Statement.php
lib/Doctrine/Connection/Statement.php
+2
-2
Db.php
lib/Doctrine/Db.php
+1
-1
Event.php
lib/Doctrine/Event.php
+6
-4
Hydrate.php
lib/Doctrine/Hydrate.php
+1
-1
Lib.php
lib/Doctrine/Lib.php
+1
-1
Manager.php
lib/Doctrine/Manager.php
+0
-4
Query.php
lib/Doctrine/Query.php
+1
-1
Record.php
lib/Doctrine/Record.php
+5
-5
No files found.
lib/Doctrine/Adapter/Mock.php
View file @
dea4968a
...
...
@@ -150,7 +150,7 @@ class Doctrine_Adapter_Mock implements Doctrine_Adapter_Interface, Countable
{
}
public
function
getAttribute
(
$attribute
)
{
if
(
$attribute
==
PDO
::
ATTR_DRIVER_NAME
)
if
(
$attribute
==
Doctrine
::
ATTR_DRIVER_NAME
)
return
strtolower
(
$this
->
name
);
}
public
function
setAttribute
(
$attribute
,
$value
)
...
...
lib/Doctrine/Cache.php
View file @
dea4968a
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine
::
autoload
(
'Doctrine_
Db_
EventListener'
);
Doctrine
::
autoload
(
'Doctrine_EventListener'
);
/**
* Doctrine_Cache
*
...
...
@@ -31,7 +31,7 @@ Doctrine::autoload('Doctrine_Db_EventListener');
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Cache
extends
Doctrine_
Db_
EventListener
implements
Countable
,
IteratorAggregate
class
Doctrine_Cache
extends
Doctrine_EventListener
implements
Countable
,
IteratorAggregate
{
/**
* @var array $_options an array of general caching options
...
...
@@ -281,14 +281,14 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
}
/**
* onPreQuery
* listens
the onPreQuery event of Doctrine_Db
* listens
on the Doctrine_Event onPreQuery event
*
* adds the issued query to internal query stack
* and checks if cached element exists
*
* @return boolean
*/
public
function
onPreQuery
(
Doctrine_
Db_
Event
$event
)
public
function
onPreQuery
(
Doctrine_Event
$event
)
{
$query
=
$event
->
getQuery
();
...
...
@@ -325,14 +325,14 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
}
/**
* onPreFetch
* listens the onPreFetch event of Doctrine_
Db
_Statement
* listens the onPreFetch event of Doctrine_
Connection
_Statement
*
* advances the internal pointer of cached data and returns
* the current element
*
* @return array
*/
public
function
onPreFetch
(
Doctrine_
Db_
Event
$event
)
public
function
onPreFetch
(
Doctrine_Event
$event
)
{
$ret
=
current
(
$this
->
_data
);
next
(
$this
->
_data
);
...
...
@@ -340,26 +340,26 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
}
/**
* onPreFetch
* listens the onPreFetchAll event of Doctrine_
Db
_Statement
* listens the onPreFetchAll event of Doctrine_
Connection
_Statement
*
* returns the current cache data array
*
* @return array
*/
public
function
onPreFetchAll
(
Doctrine_
Db_
Event
$event
)
public
function
onPreFetchAll
(
Doctrine_Event
$event
)
{
return
$this
->
_data
;
}
/**
* onPreExecute
* listens the onPreExecute event of Doctrine_
Db
_Statement
* listens the onPreExecute event of Doctrine_
Connection
_Statement
*
* adds the issued query to internal query stack
* and checks if cached element exists
*
* @return boolean
*/
public
function
onPreExecute
(
Doctrine_
Db_
Event
$event
)
public
function
onPreExecute
(
Doctrine_Event
$event
)
{
$query
=
$event
->
getQuery
();
...
...
lib/Doctrine/Configurable.php
View file @
dea4968a
...
...
@@ -169,8 +169,10 @@ abstract class Doctrine_Configurable
/**
* addListener
*
* @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_Db
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_Connection_Informix|Doctrine_Connection_Mssql|Doctrine_Connection_Oracle|
* Doctrine_Connection_Db2|Doctrine_Connection_Firebird|Doctrine_Connection_Common|
* Doctrine_Manager|Doctrine_Connection|Doctrine_Table
*/
public
function
addListener
(
$listener
,
$name
=
null
)
{
...
...
@@ -186,7 +188,7 @@ abstract class Doctrine_Configurable
/**
* getListener
*
* @return Doctrine_
Db_
EventListener_Interface|Doctrine_Overloadable
* @return Doctrine_EventListener_Interface|Doctrine_Overloadable
*/
public
function
getListener
()
{
...
...
@@ -201,8 +203,10 @@ abstract class Doctrine_Configurable
/**
* setListener
*
* @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_Db
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_Connection_Informix|Doctrine_Connection_Mssql|Doctrine_Connection_Oracle|
* Doctrine_Connection_Db2|Doctrine_Connection_Firebird|Doctrine_Connection_Common|
* Doctrine_Manager|Doctrine_Connection|Doctrine_Table
*/
public
function
setListener
(
$listener
)
{
...
...
lib/Doctrine/Connection/Profiler.php
View file @
dea4968a
...
...
@@ -66,11 +66,11 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
/**
* method overloader
* this method is used for invoking different listeners, for the full
* list of availible listeners, see Doctrine_
Db_
EventListener
* list of availible listeners, see Doctrine_EventListener
*
* @param string $m the name of the method
* @param array $a method arguments
* @see Doctrine_
Db_
EventListener
* @see Doctrine_EventListener
* @return boolean
*/
public
function
__call
(
$m
,
$a
)
...
...
@@ -150,17 +150,17 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
/**
* pop the last event from the event stack
*
* @return Doctrine_
Db_
Event
* @return Doctrine_Event
*/
public
function
pop
()
{
return
array_pop
(
$this
->
events
);
}
/**
* Get the Doctrine_
Db_
Event object for the last query that was run, regardless if it has
* Get the Doctrine_Event object for the last query that was run, regardless if it has
* ended or not. If the event has not ended, it's end time will be Null.
*
* @return Doctrine_
Db_
Event
* @return Doctrine_Event
*/
public
function
lastEvent
()
{
...
...
lib/Doctrine/Connection/Statement.php
View file @
dea4968a
...
...
@@ -257,7 +257,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
$cursorOrientation
=
Doctrine
::
FETCH_ORI_NEXT
,
$cursorOffset
=
null
)
{
$event
=
new
Doctrine_
Db_
Event
(
$this
,
Doctrine_Event
::
STMT_FETCH
,
$this
->
_stmt
->
getQuery
());
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
STMT_FETCH
,
$this
->
_stmt
->
getQuery
());
$event
->
fetchMode
=
$fetchMode
;
$event
->
cursorOrientation
=
$cursorOrientation
;
...
...
@@ -289,7 +289,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
public
function
fetchAll
(
$fetchMode
=
Doctrine
::
FETCH_BOTH
,
$columnIndex
=
null
)
{
$event
=
new
Doctrine_
Db_
Event
(
$this
,
Doctrine_Event
::
STMT_FETCHALL
,
$this
->
_stmt
->
getQuery
());
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
STMT_FETCHALL
,
$this
->
_stmt
->
getQuery
());
$event
->
fetchMode
=
$fetchMode
;
$event
->
columnIndex
=
$columnIndex
;
...
...
lib/Doctrine/Db.php
View file @
dea4968a
...
...
@@ -33,6 +33,6 @@ class Doctrine_Db
{
public
function
__construct
()
{
throw
new
Exception
(
'Doctrine_Db has been deprecated. The functionality has been merged into Doctrine_Connection.'
);
throw
new
Doctrine_
Exception
(
'Doctrine_Db has been deprecated. The functionality has been merged into Doctrine_Connection.'
);
}
}
lib/Doctrine/Event.php
View file @
dea4968a
...
...
@@ -91,9 +91,10 @@ class Doctrine_Event
/**
* constructor
*
* @param Doctrine_Db $invoker the handler which invoked this event
* @param integer $code the event code
* @param string $query the sql query associated with this event (if any)
* @param Doctrine_Connection|Doctrine_Connection_Statement|
Doctrine_Connection_UnitOfWork|Doctrine_Transaction $invoker the handler which invoked this event
* @param integer $code the event code
* @param string $query the sql query associated with this event (if any)
*/
public
function
__construct
(
$invoker
,
$code
,
$query
=
null
,
$params
=
array
())
{
...
...
@@ -225,7 +226,8 @@ class Doctrine_Event
* getInvoker
* returns the handler that invoked this event
*
* @return Doctrine_Db the handler that invoked this event
* @return Doctrine_Connection|Doctrine_Connection_Statement|
* Doctrine_Connection_UnitOfWork|Doctrine_Transaction the handler that invoked this event
*/
public
function
getInvoker
()
{
...
...
lib/Doctrine/Hydrate.php
View file @
dea4968a
...
...
@@ -653,7 +653,7 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
if
(
$this
->
isLimitSubqueryUsed
()
&&
$this
->
_conn
->
get
DBH
()
->
get
Attribute
(
Doctrine
::
ATTR_DRIVER_NAME
)
!==
'mysql'
)
{
$this
->
_conn
->
getAttribute
(
Doctrine
::
ATTR_DRIVER_NAME
)
!==
'mysql'
)
{
$params
=
array_merge
(
$params
,
$params
);
}
...
...
lib/Doctrine/Lib.php
View file @
dea4968a
...
...
@@ -190,7 +190,7 @@ class Doctrine_Lib
$r
[]
=
'State : '
.
Doctrine_Lib
::
getConnectionStateAsString
(
$connection
->
transaction
->
getState
());
$r
[]
=
'Open Transactions : '
.
$connection
->
transaction
->
getTransactionLevel
();
$r
[]
=
'Table in memory : '
.
$connection
->
count
();
$r
[]
=
'Driver name : '
.
$connection
->
get
Dbh
()
->
get
Attribute
(
Doctrine
::
ATTR_DRIVER_NAME
);
$r
[]
=
'Driver name : '
.
$connection
->
getAttribute
(
Doctrine
::
ATTR_DRIVER_NAME
);
$r
[]
=
"</pre>"
;
return
implode
(
"
\n
"
,
$r
)
.
"<br>"
;
...
...
lib/Doctrine/Manager.php
View file @
dea4968a
...
...
@@ -211,10 +211,6 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
if
(
!
(
$adapter
instanceof
PDO
)
&&
!
in_array
(
'Doctrine_Adapter_Interface'
,
class_implements
(
$adapter
)))
{
throw
new
Doctrine_Manager_Exception
(
"First argument should be an instance of PDO or implement Doctrine_Adapter_Interface"
);
}
if
(
$adapter
instanceof
Doctrine_Db
)
{
$adapter
->
setName
(
$name
);
}
$driverName
=
$adapter
->
getAttribute
(
Doctrine
::
ATTR_DRIVER_NAME
);
}
elseif
(
is_array
(
$adapter
))
{
...
...
lib/Doctrine/Query.php
View file @
dea4968a
...
...
@@ -840,7 +840,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
// initialize the base of the subquery
$subquery
=
'SELECT DISTINCT '
.
$primaryKey
;
if
(
$this
->
_conn
->
get
DBH
()
->
getAttribute
(
PDO
::
ATTR_DRIVER_NAME
)
==
'pgsql'
)
{
if
(
$this
->
_conn
->
get
Attribute
(
Doctrine
::
ATTR_DRIVER_NAME
)
==
'pgsql'
)
{
// pgsql needs the order by fields to be preserved in select clause
foreach
(
$this
->
parts
[
'orderby'
]
as
$part
)
{
...
...
lib/Doctrine/Record.php
View file @
dea4968a
...
...
@@ -1548,8 +1548,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
/**
* addListener
*
* @param Doctrine_
Db_
EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_
Db
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_
Record
*/
public
function
addListener
(
$listener
,
$name
=
null
)
{
...
...
@@ -1559,7 +1559,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
/**
* getListener
*
* @return Doctrine_
Db_
EventListener_Interface|Doctrine_Overloadable
* @return Doctrine_EventListener_Interface|Doctrine_Overloadable
*/
public
function
getListener
()
{
...
...
@@ -1568,8 +1568,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
/**
* setListener
*
* @param Doctrine_
Db_
EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_
Db
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener
* @return Doctrine_
Record
*/
public
function
setListener
(
$listener
)
{
...
...
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