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
2ae15ea7
Unverified
Commit
2ae15ea7
authored
May 24, 2019
by
Sergei Morozov
Committed by
GitHub
May 24, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3558 from morozov/deprecate-driver-name
Deprecated Driver::getName()
parents
e07dad91
4074ae93
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
58 additions
and
17 deletions
+58
-17
UPGRADE.md
UPGRADE.md
+4
-0
Driver.php
lib/Doctrine/DBAL/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php
+2
-0
DB2Driver.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/OCI8/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
+2
-0
Driver.php
lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php
+2
-0
PDOConnectionTest.php
...ctrine/Tests/DBAL/Functional/Driver/PDOConnectionTest.php
+19
-13
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+13
-4
No files found.
UPGRADE.md
View file @
2ae15ea7
# Upgrade to 2.10
## Deprecated `Doctrine\DBAL\Driver::getName()`
Relying on the name of the driver is discouraged. For referencing the driver, use its class name.
## Deprecated usage of user-provided `PDO` instance
The usage of user-provided
`PDO`
instance is deprecated. The known use cases are:
...
...
lib/Doctrine/DBAL/Driver.php
View file @
2ae15ea7
...
...
@@ -42,6 +42,8 @@ interface Driver
/**
* Gets the name of the driver.
*
* @deprecated
*
* @return string The name of the driver.
*/
public
function
getName
();
...
...
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php
View file @
2ae15ea7
...
...
@@ -49,6 +49,8 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
View file @
2ae15ea7
...
...
@@ -39,6 +39,8 @@ class DB2Driver extends AbstractDB2Driver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/OCI8/Driver.php
View file @
2ae15ea7
...
...
@@ -44,6 +44,8 @@ class Driver extends AbstractOracleDriver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php
View file @
2ae15ea7
...
...
@@ -49,6 +49,8 @@ class Driver extends AbstractDB2Driver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
View file @
2ae15ea7
...
...
@@ -62,6 +62,8 @@ class Driver extends AbstractMySQLDriver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
View file @
2ae15ea7
...
...
@@ -108,6 +108,8 @@ class Driver extends AbstractPostgreSQLDriver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
View file @
2ae15ea7
...
...
@@ -73,6 +73,8 @@ class Driver extends AbstractSQLiteDriver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php
View file @
2ae15ea7
...
...
@@ -83,6 +83,8 @@ class Driver extends AbstractSQLServerDriver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
View file @
2ae15ea7
...
...
@@ -40,6 +40,8 @@ class Driver extends AbstractSQLAnywhereDriver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php
View file @
2ae15ea7
...
...
@@ -48,6 +48,8 @@ class Driver extends AbstractSQLServerDriver
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
...
...
tests/Doctrine/Tests/DBAL/Functional/Driver/PDOConnectionTest.php
View file @
2ae15ea7
...
...
@@ -4,9 +4,13 @@ namespace Doctrine\Tests\DBAL\Functional\Driver;
use
Doctrine\DBAL\Driver\PDOConnection
;
use
Doctrine\DBAL\Driver\PDOException
;
use
Doctrine\DBAL\Driver\PDOOracle\Driver
as
PDOOracleDriver
;
use
Doctrine\DBAL\Driver\PDOPgSql\Driver
as
PDOPgSQLDriver
;
use
Doctrine\DBAL\Driver\PDOSqlsrv\Driver
as
PDOSQLSRVDriver
;
use
Doctrine\Tests\DbalFunctionalTestCase
;
use
PDO
;
use
function
extension_loaded
;
use
function
get_class
;
use
function
sprintf
;
class
PDOConnectionTest
extends
DbalFunctionalTestCase
...
...
@@ -66,10 +70,24 @@ class PDOConnectionTest extends DbalFunctionalTestCase
public
function
testThrowsWrappedExceptionOnPrepare
()
{
if
(
$this
->
connection
->
getDriver
()
->
getName
()
===
'pdo_sqlsrv'
)
{
$driver
=
$this
->
connection
->
getDriver
();
if
(
$driver
instanceof
PDOSQLSRVDriver
)
{
$this
->
markTestSkipped
(
'pdo_sqlsrv does not allow setting PDO::ATTR_EMULATE_PREPARES at connection level.'
);
}
// Some PDO adapters do not check the query server-side
// even though emulated prepared statements are disabled,
// so an exception is thrown only eventually.
if
(
$driver
instanceof
PDOOracleDriver
||
$driver
instanceof
PDOPgSQLDriver
)
{
self
::
markTestSkipped
(
sprintf
(
'The underlying implementation of the %s driver does not check the query to be prepared server-side.'
,
get_class
(
$driver
)
));
}
// Emulated prepared statements have to be disabled for this test
// so that PDO actually communicates with the database server to check the query.
$this
->
driverConnection
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
false
);
...
...
@@ -77,18 +95,6 @@ class PDOConnectionTest extends DbalFunctionalTestCase
$this
->
expectException
(
PDOException
::
class
);
$this
->
driverConnection
->
prepare
(
'foo'
);
// Some PDO adapters like PostgreSQL do not check the query server-side
// even though emulated prepared statements are disabled,
// so an exception is thrown only eventually.
// Skip the test otherwise.
$this
->
markTestSkipped
(
sprintf
(
'The PDO adapter %s does not check the query to be prepared server-side, '
.
'so no assertions can be made.'
,
$this
->
connection
->
getDriver
()
->
getName
()
)
);
}
public
function
testThrowsWrappedExceptionOnQuery
()
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
2ae15ea7
...
...
@@ -40,6 +40,7 @@ use function current;
use
function
end
;
use
function
explode
;
use
function
in_array
;
use
function
sprintf
;
use
function
str_replace
;
use
function
strcasecmp
;
use
function
strlen
;
...
...
@@ -130,8 +131,12 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase
*/
public
function
testDropAndCreateSequence
()
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
supportsSequences
())
{
$this
->
markTestSkipped
(
$this
->
connection
->
getDriver
()
->
getName
()
.
' does not support sequences.'
);
$platform
=
$this
->
connection
->
getDatabasePlatform
();
if
(
!
$platform
->
supportsSequences
())
{
$this
->
markTestSkipped
(
sprintf
(
'The "%s" platform does not support sequences.'
,
$platform
->
getName
())
);
}
$name
=
'dropcreate_sequences_test_seq'
;
...
...
@@ -158,8 +163,12 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase
public
function
testListSequences
()
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
supportsSequences
())
{
$this
->
markTestSkipped
(
$this
->
connection
->
getDriver
()
->
getName
()
.
' does not support sequences.'
);
$platform
=
$this
->
connection
->
getDatabasePlatform
();
if
(
!
$platform
->
supportsSequences
())
{
$this
->
markTestSkipped
(
sprintf
(
'The "%s" platform does not support sequences.'
,
$platform
->
getName
())
);
}
$sequence
=
new
Sequence
(
'list_sequences_test_seq'
,
20
,
10
);
...
...
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