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
dcc59843
Commit
dcc59843
authored
Nov 01, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Firebird, mssql, mysql, oracle and pgsql connection drivers updated
parent
87f9122f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
14 deletions
+82
-14
Firebird.php
lib/Doctrine/Connection/Firebird.php
+5
-3
Mssql.php
lib/Doctrine/Connection/Mssql.php
+64
-5
Mysql.php
lib/Doctrine/Connection/Mysql.php
+4
-1
Oracle.php
lib/Doctrine/Connection/Oracle.php
+4
-3
Pgsql.php
lib/Doctrine/Connection/Pgsql.php
+5
-2
Exception.php
lib/Doctrine/Connection/Sqlite/Exception.php
+0
-0
No files found.
lib/Doctrine/Connection/Firebird.php
View file @
dcc59843
...
...
@@ -24,8 +24,11 @@ Doctrine::autoload('Doctrine_Connection');
*
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 library)
* @license LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 library interbase driver)
* @version $Id$
*/
class
Doctrine_Connection_Firebird
extends
Doctrine_Connection
{
/**
...
...
@@ -129,7 +132,6 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection {
* Set the charset on the current connection
*
* @param string charset
* @param resource connection handle
*
* @return void
*/
...
...
lib/Doctrine/Connection/Mssql.php
View file @
dcc59843
...
...
@@ -24,7 +24,10 @@ Doctrine::autoload('Doctrine_Connection');
*
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @license LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Id$
*/
class
Doctrine_Connection_Mssql
extends
Doctrine_Connection
{
/**
...
...
@@ -39,16 +42,50 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection {
*/
public
function
__construct
(
Doctrine_Manager
$manager
,
PDO
$pdo
)
{
// initialize all driver options
$this
->
supported
=
array
(
'sequences'
=>
'emulated'
,
'indexes'
=>
true
,
'affected_rows'
=>
true
,
'transactions'
=>
true
,
'summary_functions'
=>
true
,
'order_by_text'
=>
true
,
'current_id'
=>
'emulated'
,
'limit_queries'
=>
'emulated'
,
'LOBs'
=>
true
,
'replace'
=>
'emulated'
,
'sub_selects'
=>
true
,
'auto_increment'
=>
true
,
'primary_key'
=>
true
,
'result_introspection'
=>
true
,
'prepared_statements'
=>
'emulated'
,
);
parent
::
__construct
(
$manager
,
$pdo
);
}
/**
* quoteIdentifier
* Quote a string so it can be safely used as a table / column name
*
* Quoting style depends on which database driver is being used.
*
* @param string $identifier identifier name to be quoted
* @param bool $checkOption check the 'quote_identifier' option
*
* @return string quoted identifier string
*/
public
function
quoteIdentifier
(
$identifier
,
$checkOption
=
false
)
{
if
(
$check_option
&&
!
$this
->
options
[
'quote_identifier'
])
{
return
$identifier
;
}
return
'['
.
str_replace
(
']'
,
']]'
,
$identifier
)
.
']'
;
}
/**
* returns the next value in the given sequence
*
* @param string $sequence name of the sequence
* @return integer the next value in the given sequence
*/
public
function
getNextID
(
$sequence
)
{
public
function
nextId
(
$sequence
)
{
$this
->
query
(
"INSERT INTO
$sequence
(vapor) VALUES (0)"
);
$stmt
=
$this
->
query
(
"SELECT @@IDENTITY FROM
$sequence
"
);
$data
=
$stmt
->
fetch
(
PDO
::
FETCH_NUM
);
...
...
@@ -64,8 +101,8 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection {
* @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html
* @return string
*/
public
function
modifyLimitQuery
(
$query
,
$limit
,
$offset
)
{
if
(
$limit
)
{
public
function
modifyLimitQuery
(
$query
,
$limit
,
$offset
,
$isManip
=
false
)
{
if
(
$limit
>
0
)
{
// we need the starting SELECT clause for later
$select
=
'SELECT '
;
...
...
@@ -77,7 +114,7 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection {
// is there an offset?
if
(
!
$offset
)
{
// no offset, it's a simple TOP count
return
"
$select
TOP
$count
"
.
substr
(
$query
,
$length
);
return
$select
.
' TOP '
.
$count
.
substr
(
$query
,
$length
);
}
// the total of the count **and** the offset, combined.
...
...
@@ -108,5 +145,27 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection {
return
$query
;
}
/**
* Returns the autoincrement ID if supported or $id or fetches the current
* ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
*
* @param string $table name of the table into which a new row was inserted
* @param string $field name of the field into which a new row was inserted
* @return mixed MDB2 Error Object or id
* @access public
*/
function
lastInsertID
(
$table
=
null
,
$field
=
null
)
{
$server_info
=
$this
->
getServerVersion
();
if
(
is_array
(
$server_info
)
&&
!
is_null
(
$server_info
[
'major'
])
&&
$server_info
[
'major'
]
>=
8
)
{
$query
=
"SELECT SCOPE_IDENTITY()"
;
}
else
{
$query
=
"SELECT @@IDENTITY"
;
}
return
$this
->
queryOne
(
$query
,
'integer'
);
}
}
lib/Doctrine/Connection/Mysql.php
View file @
dcc59843
...
...
@@ -24,7 +24,10 @@ Doctrine::autoload('Doctrine_Connection_Common');
*
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @license LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Id$
*/
class
Doctrine_Connection_Mysql
extends
Doctrine_Connection_Common
{
/**
...
...
lib/Doctrine/Connection/Oracle.php
View file @
dcc59843
...
...
@@ -115,14 +115,15 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection {
* @return void
*/
public
function
setTransactionIsolation
(
$isolation
)
{
switch
(
$isolation
)
{
switch
(
$isolation
)
{
case
'READ UNCOMMITTED'
:
$isolation
=
'READ COMMITTED'
;
break
;
case
'READ COMMITTED'
:
case
'REPEATABLE READ'
:
$isolation
=
'SERIALIZABLE'
;
case
'SERIALIZABLE'
:
break
;
$isolation
=
'SERIALIZABLE'
;
break
;
default
:
throw
new
Doctrine_Connection_Oracle_Exception
(
'Isolation level '
.
$isolation
.
' is not supported.'
);
}
...
...
lib/Doctrine/Connection/Pgsql.php
View file @
dcc59843
...
...
@@ -24,7 +24,10 @@ Doctrine::autoload("Doctrine_Connection_Common");
*
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @license LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Id$
*/
class
Doctrine_Connection_Pgsql
extends
Doctrine_Connection_Common
{
/**
...
...
@@ -59,7 +62,7 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common {
'identifier_quoting'
=>
true
,
'pattern_escaping'
=>
true
,
);
$this
->
options
[
'multi_query'
]
=
false
;
parent
::
__construct
(
$manager
,
$pdo
);
...
...
lib/Doctrine/Connection/Sqlite/
Sqlite
.php
→
lib/Doctrine/Connection/Sqlite/
Exception
.php
View file @
dcc59843
File moved
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