Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually merge 2.11.x into 3.0.x #4216

Merged
merged 14 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 1 addition & 1 deletion src/Driver/IBMDB2/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function connect(array $params)
isset($params['persistent']) && $params['persistent'] === true,
$params['user'] ?? '',
$params['password'] ?? '',
$params['driver_options'] ?? []
$params['driverOptions'] ?? []
);
}
}
14 changes: 7 additions & 7 deletions src/Driver/Mysqli/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public function connect(array $params)

$preInitializers = $postInitializers = [];

if (isset($params['driver_options'])) {
$driverOptions = $params['driver_options'];
if (isset($params['driverOptions'])) {
$driverOptions = $params['driverOptions'];

if (isset($driverOptions[Connection::OPTION_FLAGS])) {
$flags = $driverOptions[Connection::OPTION_FLAGS];
Expand Down Expand Up @@ -89,11 +89,11 @@ private function withSecure(array $initializers, array $params): array
isset($params['ssl_cipher'])
) {
$initializers[] = new Secure(
$params['ssl_key'] ?? null,
$params['ssl_cert'] ?? null,
$params['ssl_ca'] ?? null,
$params['ssl_capath'] ?? null,
$params['ssl_cipher'] ?? null
$params['ssl_key'] ?? '',
$params['ssl_cert'] ?? '',
$params['ssl_ca'] ?? '',
$params['ssl_capath'] ?? '',
$params['ssl_cipher'] ?? ''
);
}

Expand Down
12 changes: 6 additions & 6 deletions src/Driver/Mysqli/Initializer/Secure.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@

final class Secure implements Initializer
{
/** @var string|null */
/** @var string */
private $key;

/** @var string|null */
/** @var string */
private $cert;

/** @var string|null */
/** @var string */
private $ca;

/** @var string|null */
/** @var string */
private $capath;

/** @var string|null */
/** @var string */
private $cipher;

public function __construct(?string $key, ?string $cert, ?string $ca, ?string $capath, ?string $cipher)
public function __construct(string $key, string $cert, string $ca, string $capath, string $cipher)
{
$this->key = $key;
$this->cert = $cert;
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/MySQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class Driver extends AbstractMySQLDriver
*/
public function connect(array $params)
{
$driverOptions = $params['driver_options'] ?? [];
$driverOptions = $params['driverOptions'] ?? [];

if (! empty($params['persistent'])) {
$driverOptions[PDO::ATTR_PERSISTENT] = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/OCI/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class Driver extends AbstractOracleDriver
*/
public function connect(array $params)
{
$driverOptions = $params['driver_options'] ?? [];
$driverOptions = $params['driverOptions'] ?? [];

if (! empty($params['persistent'])) {
$driverOptions[PDO::ATTR_PERSISTENT] = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class Driver extends AbstractPostgreSQLDriver
*/
public function connect(array $params)
{
$driverOptions = $params['driver_options'] ?? [];
$driverOptions = $params['driverOptions'] ?? [];

if (! empty($params['persistent'])) {
$driverOptions[PDO::ATTR_PERSISTENT] = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/PDO/SQLSrv/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function connect(array $params)
{
$pdoOptions = $dsnOptions = [];

if (isset($params['driver_options'])) {
foreach ($params['driver_options'] as $option => $value) {
if (isset($params['driverOptions'])) {
foreach ($params['driverOptions'] as $option => $value) {
if (is_int($option)) {
$pdoOptions[$option] = $value;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/SQLite/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class Driver extends AbstractSQLiteDriver
*/
public function connect(array $params)
{
$driverOptions = $params['driver_options'] ?? [];
$driverOptions = $params['driverOptions'] ?? [];

if (isset($driverOptions['userDefinedFunctions'])) {
$this->_userDefinedFunctions = array_merge(
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/SQLSrv/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function connect(array $params)
throw PortWithoutHost::new();
}

$driverOptions = $params['driver_options'] ?? [];
$driverOptions = $params['driverOptions'] ?? [];

if (isset($params['dbname'])) {
$driverOptions['Database'] = $params['dbname'];
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
2 changes: 1 addition & 1 deletion tests/Driver/PDO/PgSQL/DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private function connect(array $driverOptions): Connection
return $this->createDriver()->connect(
array_merge(
TestUtil::getConnectionParams(),
['driver_options' => $driverOptions]
['driverOptions' => $driverOptions]
)
);
}
Expand Down
Loading