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
84e365da
Unverified
Commit
84e365da
authored
May 24, 2019
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3553 from morozov/remove-driver-name
Removed Driver::getName()
parents
a4158b5c
5857be40
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
47 additions
and
373 deletions
+47
-373
UPGRADE.md
UPGRADE.md
+4
-0
Driver.php
lib/Doctrine/DBAL/Driver.php
+0
-9
DB2Driver.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
+0
-10
Driver.php
lib/Doctrine/DBAL/Driver/Mysqli/Driver.php
+0
-8
Driver.php
lib/Doctrine/DBAL/Driver/OCI8/Driver.php
+0
-10
Driver.php
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
+0
-10
Driver.php
lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
+0
-8
Driver.php
lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
+0
-10
Driver.php
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
+0
-10
Driver.php
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php
+0
-10
Driver.php
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
+0
-10
Driver.php
lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php
+0
-10
DB2DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/IBMDB2/DB2DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/Mysqli/DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/OCI8/DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/PDOMySql/DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/PDOOracle/DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php
+20
-50
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/PDOSqlite/DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/PDOSqlsrv/DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/SQLAnywhere/DriverTest.php
+0
-22
DriverTest.php
tests/Doctrine/Tests/DBAL/Driver/SQLSrv/DriverTest.php
+0
-22
StatementTest.php
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
+23
-20
No files found.
UPGRADE.md
View file @
84e365da
# Upgrade to 3.0
## BC BREAK: `Doctrine\DBAL\Driver::getName()` removed
The
`Doctrine\DBAL\Driver::getName()`
has been removed.
## BC BREAK Removed previously deprecated features
*
Removed
`json_array`
type and all associated hacks.
...
...
lib/Doctrine/DBAL/Driver.php
View file @
84e365da
...
...
@@ -43,15 +43,6 @@ interface Driver
*/
public
function
getSchemaManager
(
Connection
$conn
);
/**
* Gets the name of the driver.
*
* @deprecated
*
* @return string The name of the driver.
*/
public
function
getName
();
/**
* Gets the name of the database connected to for this driver.
*
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
View file @
84e365da
...
...
@@ -38,14 +38,4 @@ class DB2Driver extends AbstractDB2Driver
return
new
DB2Connection
(
$params
,
(
string
)
$username
,
(
string
)
$password
,
$driverOptions
);
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'ibm_db2'
;
}
}
lib/Doctrine/DBAL/Driver/Mysqli/Driver.php
View file @
84e365da
...
...
@@ -20,12 +20,4 @@ class Driver extends AbstractMySQLDriver
throw
DBALException
::
driverException
(
$this
,
$e
);
}
}
/**
* {@inheritdoc}
*/
public
function
getName
()
{
return
'mysqli'
;
}
}
lib/Doctrine/DBAL/Driver/OCI8/Driver.php
View file @
84e365da
...
...
@@ -43,14 +43,4 @@ class Driver extends AbstractOracleDriver
{
return
$this
->
getEasyConnectString
(
$params
);
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'oci8'
;
}
}
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
View file @
84e365da
...
...
@@ -66,14 +66,4 @@ class Driver extends AbstractMySQLDriver
return
$dsn
;
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'pdo_mysql'
;
}
}
lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
View file @
84e365da
...
...
@@ -58,12 +58,4 @@ class Driver extends AbstractOracleDriver
return
$dsn
;
}
/**
* {@inheritdoc}
*/
public
function
getName
()
{
return
'pdo_oracle'
;
}
}
lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
View file @
84e365da
...
...
@@ -111,14 +111,4 @@ class Driver extends AbstractPostgreSQLDriver
return
$dsn
;
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'pdo_pgsql'
;
}
}
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
View file @
84e365da
...
...
@@ -74,14 +74,4 @@ class Driver extends AbstractSQLiteDriver
return
$dsn
;
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'pdo_sqlite'
;
}
}
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php
View file @
84e365da
...
...
@@ -87,14 +87,4 @@ class Driver extends AbstractSQLServerDriver
return
$connectionOptionsDsn
;
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'pdo_sqlsrv'
;
}
}
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
View file @
84e365da
...
...
@@ -40,16 +40,6 @@ class Driver extends AbstractSQLAnywhereDriver
}
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'sqlanywhere'
;
}
/**
* Build the connection string for given connection parameters and driver options.
*
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php
View file @
84e365da
...
...
@@ -47,14 +47,4 @@ class Driver extends AbstractSQLServerDriver
return
new
SQLSrvConnection
(
$serverName
,
$driverOptions
);
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'sqlsrv'
;
}
}
tests/Doctrine/Tests/DBAL/Driver/IBMDB2/DB2DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\IBMDB2
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractDB2DriverTest
;
class
DB2DriverTest
extends
AbstractDB2DriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'ibm_db2'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
DB2Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/Mysqli/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\Mysqli
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\Mysqli\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractMySQLDriverTest
;
class
DriverTest
extends
AbstractMySQLDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'mysqli'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/OCI8/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\OCI8
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\OCI8\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractOracleDriverTest
;
class
DriverTest
extends
AbstractOracleDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'oci8'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/PDOMySql/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\PDOMySql
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDOMySql\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractMySQLDriverTest
;
class
DriverTest
extends
AbstractMySQLDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'pdo_mysql'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/PDOOracle/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\PDOOracle
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDOOracle\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractOracleDriverTest
;
class
DriverTest
extends
AbstractOracleDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'pdo_oracle'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php
View file @
84e365da
...
...
@@ -9,23 +9,25 @@ use Doctrine\DBAL\Driver\PDOConnection;
use
Doctrine\DBAL\Driver\PDOPgSql\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractPostgreSQLDriverTest
;
use
PDO
;
use
PDOException
;
use
function
defined
;
class
DriverTest
extends
AbstractPostgreSQLDriverTest
{
p
ublic
function
testReturnsName
()
:
void
p
rotected
function
setUp
()
:
void
{
self
::
assertSame
(
'pdo_pgsql'
,
$this
->
driver
->
getName
());
parent
::
setUp
();
if
(
isset
(
$GLOBALS
[
'db_type'
])
&&
$GLOBALS
[
'db_type'
]
===
'pdo_pgsql'
)
{
return
;
}
$this
->
markTestSkipped
(
'Test enabled only when using pdo_pgsql specific phpunit.xml'
);
}
/**
* @group DBAL-920
*/
public
function
testConnectionDisablesPrepares
OnPhp56
()
:
void
public
function
testConnectionDisablesPrepares
()
:
void
{
$this
->
skipWhenNotUsingPhp56AndPdoPgsql
();
$connection
=
$this
->
createDriver
()
->
connect
(
[
'host'
=>
$GLOBALS
[
'db_host'
],
...
...
@@ -36,22 +38,16 @@ class DriverTest extends AbstractPostgreSQLDriverTest
);
self
::
assertInstanceOf
(
PDOConnection
::
class
,
$connection
);
try
{
self
::
assertTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
));
}
catch
(
PDOException
$ignored
)
{
/** @link https://bugs.php.net/bug.php?id=68371 */
$this
->
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=68371'
);
}
self
::
assertTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
);
}
/**
* @group DBAL-920
*/
public
function
testConnectionDoesNotDisablePrepares
OnPhp56
WhenAttributeDefined
()
:
void
public
function
testConnectionDoesNotDisablePreparesWhenAttributeDefined
()
:
void
{
$this
->
skipWhenNotUsingPhp56AndPdoPgsql
();
$connection
=
$this
->
createDriver
()
->
connect
(
[
'host'
=>
$GLOBALS
[
'db_host'
],
...
...
@@ -63,25 +59,16 @@ class DriverTest extends AbstractPostgreSQLDriverTest
);
self
::
assertInstanceOf
(
PDOConnection
::
class
,
$connection
);
try
{
self
::
assertNotSame
(
true
,
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
);
}
catch
(
PDOException
$ignored
)
{
/** @link https://bugs.php.net/bug.php?id=68371 */
$this
->
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=68371'
);
}
self
::
assertNotTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
);
}
/**
* @group DBAL-920
*/
public
function
testConnectionDisablePrepares
OnPhp56
WhenDisablePreparesIsExplicitlyDefined
()
:
void
public
function
testConnectionDisablePreparesWhenDisablePreparesIsExplicitlyDefined
()
:
void
{
$this
->
skipWhenNotUsingPhp56AndPdoPgsql
();
$connection
=
$this
->
createDriver
()
->
connect
(
[
'host'
=>
$GLOBALS
[
'db_host'
],
...
...
@@ -93,13 +80,9 @@ class DriverTest extends AbstractPostgreSQLDriverTest
);
self
::
assertInstanceOf
(
PDOConnection
::
class
,
$connection
);
try
{
self
::
assertTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
));
}
catch
(
PDOException
$ignored
)
{
/** @link https://bugs.php.net/bug.php?id=68371 */
$this
->
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=68371'
);
}
self
::
assertTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
);
}
/**
...
...
@@ -109,17 +92,4 @@ class DriverTest extends AbstractPostgreSQLDriverTest
{
return
new
Driver
();
}
private
function
skipWhenNotUsingPhp56AndPdoPgsql
()
:
void
{
if
(
!
defined
(
'PDO::PGSQL_ATTR_DISABLE_PREPARES'
))
{
$this
->
markTestSkipped
(
'Test requires PHP 5.6+'
);
}
if
(
isset
(
$GLOBALS
[
'db_type'
])
&&
$GLOBALS
[
'db_type'
]
===
'pdo_pgsql'
)
{
return
;
}
$this
->
markTestSkipped
(
'Test enabled only when using pdo_pgsql specific phpunit.xml'
);
}
}
tests/Doctrine/Tests/DBAL/Driver/PDOSqlite/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\PDOSqlite
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDOSqlite\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractSQLiteDriverTest
;
class
DriverTest
extends
AbstractSQLiteDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'pdo_sqlite'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/PDOSqlsrv/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\PDOSqlsrv
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDOSqlsrv\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractSQLServerDriverTest
;
class
DriverTest
extends
AbstractSQLServerDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'pdo_sqlsrv'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/SQLAnywhere/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\SQLAnywhere
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\SQLAnywhere\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractSQLAnywhereDriverTest
;
class
DriverTest
extends
AbstractSQLAnywhereDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'sqlanywhere'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Driver/SQLSrv/DriverTest.php
deleted
100644 → 0
View file @
a4158b5c
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Driver\SQLSrv
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\SQLSrv\Driver
;
use
Doctrine\Tests\DBAL\Driver\AbstractSQLServerDriverTest
;
class
DriverTest
extends
AbstractSQLServerDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'sqlsrv'
,
$this
->
driver
->
getName
());
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
}
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
View file @
84e365da
...
...
@@ -5,8 +5,12 @@ declare(strict_types=1);
namespace
Doctrine\Tests\DBAL\Functional
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Driver
;
use
Doctrine\DBAL\Driver\PDOConnection
;
use
Doctrine\DBAL\Driver\PDOMySql\Driver
as
PDOMySQLDriver
;
use
Doctrine\DBAL\Driver\PDOOracle\Driver
as
PDOOracleDriver
;
use
Doctrine\DBAL\Driver\PDOSqlsrv\Driver
as
PDOSQLSRVDriver
;
use
Doctrine\DBAL\Driver\SQLSrv\Driver
as
SQLSRVDriver
;
use
Doctrine\DBAL\Driver\Statement
;
use
Doctrine\DBAL\FetchMode
;
use
Doctrine\DBAL\ParameterType
;
...
...
@@ -14,6 +18,7 @@ use Doctrine\DBAL\Schema\Table;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\Tests\DbalFunctionalTestCase
;
use
function
base64_decode
;
use
function
get_class
;
use
function
sprintf
;
use
function
stream_get_contents
;
...
...
@@ -341,26 +346,24 @@ EOF
public
function
testExecWithRedundantParameters
()
:
void
{
$driver
=
$this
->
connection
->
getDriver
()
->
getName
();
switch
(
$driver
)
{
case
'pdo_mysql'
:
case
'pdo_oracle'
:
case
'pdo_sqlsrv'
:
self
::
markTestSkipped
(
sprintf
(
'PDOStatement::execute() implemented in the "%s" driver does not report redundant parameters'
,
$driver
));
return
;
case
'ibm_db2'
:
self
::
markTestSkipped
(
'db2_execute() does not report redundant parameters'
);
return
;
case
'sqlsrv'
:
self
::
markTestSkipped
(
'sqlsrv_prepare() does not report redundant parameters'
);
return
;
$driver
=
$this
->
connection
->
getDriver
();
if
(
$driver
instanceof
PDOMySQLDriver
||
$driver
instanceof
PDOOracleDriver
||
$driver
instanceof
PDOSQLSRVDriver
)
{
self
::
markTestSkipped
(
sprintf
(
'The underlying implementation of the "%s" driver does not report redundant parameters'
,
get_class
(
$driver
)
));
}
if
(
$driver
instanceof
DB2Driver
)
{
self
::
markTestSkipped
(
'db2_execute() does not report redundant parameters'
);
}
if
(
$driver
instanceof
SQLSRVDriver
)
{
self
::
markTestSkipped
(
'sqlsrv_prepare() does not report redundant parameters'
);
}
$platform
=
$this
->
connection
->
getDatabasePlatform
();
...
...
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