Skip to content

Commit

Permalink
Merge branch '2.11.x' into 3.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Aug 19, 2020
2 parents c70832a + 53b101b commit 430114e
Show file tree
Hide file tree
Showing 23 changed files with 84 additions and 98 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ jobs:
- stage: Test
php: 7.4
env: DB=mysqli.docker IMAGE=mysql:8.0
- stage: Test
php: 7.4
env: DB=mysqli-tls.docker IMAGE=mysql:8.0 TLS=yes
- stage: Test
php: 7.4
env: DB=mariadb.docker IMAGE=mariadb:10.3
Expand Down
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ Please use other database client applications for import, e.g.:

# Upgrade to 2.11

## Deprecated `Synchronizer` package

The `Doctrine\DBAL\Schema\Synchronizer\SchemaSynchronizer` interface and all its implementations are deprecated.

## Deprecated usage of wrapper-level components as implementations of driver-level interfaces

The usage of the wrapper `Connection` and `Statement` classes as implementations of the `Driver\Connection` and `Driver\Statement` interfaces is deprecated.
Expand Down
7 changes: 0 additions & 7 deletions ci/appveyor/mssql.sql2008r2sp2.sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/appveyor/mssql.sql2012sp1.sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/appveyor/mssql.sql2017.pdo_sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/appveyor/mssql.sql2017.sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
8 changes: 8 additions & 0 deletions ci/travis/docker-run-mysql-or-mariadb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ while true; do
;;
esac
done

if [[ "$TLS" == "yes" ]]
then
for file in "ca.pem" "client-cert.pem" "client-key.pem"
do
docker cp "rdbms:/var/lib/mysql/$file" .
done
fi
7 changes: 0 additions & 7 deletions ci/travis/ibm_db2.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/mariadb.docker.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/mariadb.mysqli.docker.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/mysql.docker.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
37 changes: 37 additions & 0 deletions ci/travis/mysqli-tls.docker.travis.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
>
<php>
<var name="db_driver" value="mysqli"/>
<var name="db_host" value="127.0.0.1"/>
<var name="db_port" value="33306"/>
<var name="db_ssl_ca" value="ca.pem"/>
<var name="db_ssl_cert" value="client-cert.pem"/>
<var name="db_ssl_key" value="client-key.pem"/>

<!-- Use MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT since there's no way to generate a certificate
with a proper common name (CN) on Travis. This flag must be not used in production settings. -->
<var name="db_driver_option_flags" value="64"/>

<var name="db_user" value="root"/>
<var name="db_dbname" value="doctrine_tests"/>
</php>

<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../../tests</directory>
</testsuite>
</testsuites>

<coverage>
<include>
<directory suffix=".php">../../src</directory>
</include>
</coverage>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/mysqli.docker.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/pdo_sqlsrv.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/pgsql.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/sqlite.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
7 changes: 0 additions & 7 deletions ci/travis/sqlsrv.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<directory suffix=".php">../../src</directory>
</include>
</coverage>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
2 changes: 1 addition & 1 deletion docs/en/reference/transactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ constants:

The default transaction isolation level of a
``Doctrine\DBAL\Connection`` is chosen by the underlying platform
but it is always at least READ\_COMMITTED.
but it is always at least ``READ_COMMITTED``.

Transaction Nesting
-------------------
Expand Down
2 changes: 2 additions & 0 deletions src/Schema/Synchronizer/AbstractSchemaSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/**
* Abstract schema synchronizer with methods for executing batches of SQL.
*
* @deprecated
*/
abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
{
Expand Down
2 changes: 2 additions & 0 deletions src/Schema/Synchronizer/SchemaSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/**
* The synchronizer knows how to synchronize a schema with the configured
* database.
*
* @deprecated
*/
interface SchemaSynchronizer
{
Expand Down
2 changes: 2 additions & 0 deletions src/Schema/Synchronizer/SingleDatabaseSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/**
* Schema Synchronizer for Default DBAL Connection.
*
* @deprecated
*/
class SingleDatabaseSynchronizer extends AbstractSchemaSynchronizer
{
Expand Down
15 changes: 9 additions & 6 deletions tests/Functional/Driver/PDO/SQLSrv/DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ protected static function getDatabaseNameForConnectionWithoutDatabaseNameParamet
*/
private function getConnection(array $driverOptions): Connection
{
return $this->connection->getDriver()->connect(
array_merge(
TestUtil::getConnectionParams(),
['driver_options' => $driverOptions]
)
);
$params = TestUtil::getConnectionParams();

if (isset($params['driverOptions'])) {
$driverOptions = array_merge($params['driverOptions'], $driverOptions);
}

$params['driverOptions'] = $driverOptions;

return $this->connection->getDriver()->connect($params);
}

public function testConnectionOptions(): void
Expand Down
16 changes: 16 additions & 0 deletions tests/TestUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
use function extension_loaded;
use function implode;
use function is_string;
use function strlen;
use function strpos;
use function substr;
use function unlink;

/**
Expand Down Expand Up @@ -187,6 +190,11 @@ private static function mapConnectionParameters(array $configuration, string $pr
'dbname',
'port',
'server',
'ssl_key',
'ssl_cert',
'ssl_ca',
'ssl_capath',
'ssl_cipher',
'unix_socket',
] as $parameter
) {
Expand All @@ -197,6 +205,14 @@ private static function mapConnectionParameters(array $configuration, string $pr
$parameters[$parameter] = $configuration[$prefix . $parameter];
}

foreach ($configuration as $param => $value) {
if (strpos($param, $prefix . 'driver_option_') !== 0) {
continue;
}

$parameters['driverOptions'][substr($param, strlen($prefix . 'driver_option_'))] = $value;
}

return $parameters;
}

Expand Down

0 comments on commit 430114e

Please sign in to comment.