From 853d1cfd4f2efe4f19e62fedd11e851385ee1e72 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Tue, 17 Mar 2020 23:22:59 -0700 Subject: [PATCH] Deprecate the usage of the legacy platforms and drivers --- UPGRADE.md | 18 ++++++++++++++++ docs/en/reference/platforms.rst | 21 +++++++++---------- .../Driver/DrizzlePDOMySql/Connection.php | 3 +++ .../DBAL/Driver/DrizzlePDOMySql/Driver.php | 2 ++ lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php | 2 ++ .../DBAL/Platforms/DrizzlePlatform.php | 2 ++ .../DBAL/Platforms/PostgreSQL91Platform.php | 2 ++ .../DBAL/Platforms/PostgreSQL92Platform.php | 2 ++ .../DBAL/Platforms/PostgreSqlPlatform.php | 2 ++ .../DBAL/Platforms/SQLAnywhere11Platform.php | 2 ++ .../DBAL/Platforms/SQLAnywhere12Platform.php | 2 ++ .../DBAL/Platforms/SQLAnywherePlatform.php | 2 ++ .../DBAL/Platforms/SQLAzurePlatform.php | 2 ++ .../DBAL/Platforms/SQLServer2005Platform.php | 2 ++ .../DBAL/Platforms/SQLServer2008Platform.php | 2 ++ .../DBAL/Platforms/SQLServerPlatform.php | 2 ++ .../DBAL/Sharding/PoolingShardConnection.php | 2 ++ .../DBAL/Sharding/PoolingShardManager.php | 2 ++ .../SQLAzureFederationsSynchronizer.php | 2 ++ .../SQLAzure/SQLAzureShardManager.php | 2 ++ .../SQLAzure/Schema/MultiTenantVisitor.php | 2 ++ .../ShardChoser/MultiTenantShardChoser.php | 2 ++ .../DBAL/Sharding/ShardChoser/ShardChoser.php | 2 ++ lib/Doctrine/DBAL/Sharding/ShardManager.php | 2 ++ .../DBAL/Sharding/ShardingException.php | 2 ++ 25 files changed, 75 insertions(+), 11 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 89066aaf018..6bf517e921a 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,23 @@ # Upgrade to 2.11 +## Deprecated database platforms: + +1. PostgreSQL 9.3 and older +2. MariaDB 10.0 and older +3. SQL Server 2008 and older +4. SQL Anywhere 12 and older +5. Drizzle +6. Azure SQL Database + +## Deprecated database drivers: + +1. PDO-based IBM DB2 driver +2. Drizzle MySQL driver + +## Deprecated `Doctrine\DBAL\Sharding` package + +The sharding functionality in DBAL has been effectively unmaintained for a long time. + ## Deprecated `Doctrine\DBAL\Version` class The usage of the `Doctrine\DBAL\Version` class is deprecated as internal implementation detail. Please refrain from checking the DBAL version at runtime. diff --git a/docs/en/reference/platforms.rst b/docs/en/reference/platforms.rst index 32ef74304ea..2b6516e269c 100644 --- a/docs/en/reference/platforms.rst +++ b/docs/en/reference/platforms.rst @@ -50,25 +50,25 @@ Oracle Microsoft SQL Server ^^^^^^^^^^^^^^^^^^^^ -- ``SQLServerPlatform`` for version 2000 and above. -- ``SQLServer2005Platform`` for version 2005 and above. -- ``SQLServer2008Platform`` for version 2008 and above. +- ``SQLServerPlatform`` for version 2000 and above (deprecated). +- ``SQLServer2005Platform`` for version 2005 and above (deprecated). +- ``SQLServer2008Platform`` for version 2008 and above (deprecated). - ``SQLServer2012Platform`` for version 2012 and above. PostgreSQL ^^^^^^^^^^ -- ``PostgreSqlPlatform`` for all versions. -- ``PostgreSQL91Platform`` for version 9.1 and above. -- ``PostgreSQL92Platform`` for version 9.2 and above. +- ``PostgreSqlPlatform`` for version 9.0 and below (deprecated). +- ``PostgreSQL91Platform`` for version 9.1 and above (deprecated). +- ``PostgreSQL92Platform`` for version 9.2 and above (deprecated). - ``PostgreSQL94Platform`` for version 9.4 and above. SAP Sybase SQL Anywhere ^^^^^^^^^^^^^^^^^^^^^^^ -- ``SQLAnywherePlatform`` for version 10 and above. -- ``SQLAnywhere11Platform`` for version 11 and above. -- ``SQLAnywhere12Platform`` for version 12 and above. +- ``SQLAnywherePlatform`` for version 10 and above (deprecated). +- ``SQLAnywhere11Platform`` for version 11 and above (deprecated). +- ``SQLAnywhere12Platform`` for version 12 and above (deprecated). - ``SQLAnywhere16Platform`` for version 16 and above. SQLite @@ -79,7 +79,7 @@ SQLite Drizzle ^^^^^^ -- ``DrizzlePlatform`` for all versions. +- ``DrizzlePlatform`` for all versions (deprecated). It is highly encouraged to use the platform class that matches your database vendor and version best. Otherwise it is not guaranteed @@ -113,4 +113,3 @@ all the different database vendors, for example MySQL BIGINT and Oracle NUMBER should be handled as integer. Doctrine 2 offers a powerful way to abstract the database to php and back conversion, which is described in the next section. - diff --git a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php b/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php index 4089ab26e11..058bd19e2d0 100644 --- a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php +++ b/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php @@ -5,6 +5,9 @@ use Doctrine\DBAL\Driver\PDOConnection; use Doctrine\DBAL\ParameterType; +/** + * @deprecated + */ class Connection extends PDOConnection { /** diff --git a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php b/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php index dbf342814f9..37bd0729efa 100644 --- a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php +++ b/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php @@ -7,6 +7,8 @@ /** * Drizzle driver using PDO MySql. + * + * @deprecated */ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver { diff --git a/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php b/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php index 12fb14ef5cb..e57deca0c59 100644 --- a/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php +++ b/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php @@ -7,6 +7,8 @@ /** * Driver for the PDO IBM extension. + * + * @deprecated Use the driver based on the ibm_db2 extension instead. */ class Driver extends AbstractDB2Driver { diff --git a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php index 8f6f0966323..8ea51c27a24 100644 --- a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php @@ -23,6 +23,8 @@ /** * Drizzle platform + * + * @deprecated */ class DrizzlePlatform extends AbstractPlatform { diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php b/lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php index f558409831c..7e3aac30e07 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php @@ -6,6 +6,8 @@ /** * Provides the behavior, features and SQL dialect of the PostgreSQL 9.1 database platform. + * + * @deprecated Use PostgreSQL 9.4 or newer */ class PostgreSQL91Platform extends PostgreSqlPlatform { diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php b/lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php index 1703056143f..c0b5675a383 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php @@ -7,6 +7,8 @@ /** * Provides the behavior, features and SQL dialect of the PostgreSQL 9.2 database platform. + * + * @deprecated Use PostgreSQL 9.4 or newer */ class PostgreSQL92Platform extends PostgreSQL91Platform { diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index dd90f2cb6b3..b5cd8f8c769 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -35,6 +35,8 @@ /** * PostgreSqlPlatform. * + * @deprecated Use PostgreSQL 9.4 or newer + * * @todo Rename: PostgreSQLPlatform */ class PostgreSqlPlatform extends AbstractPlatform diff --git a/lib/Doctrine/DBAL/Platforms/SQLAnywhere11Platform.php b/lib/Doctrine/DBAL/Platforms/SQLAnywhere11Platform.php index a46ae9352c4..71922b22769 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLAnywhere11Platform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLAnywhere11Platform.php @@ -5,6 +5,8 @@ /** * The SQLAnywhere11Platform provides the behavior, features and SQL dialect of the * SAP Sybase SQL Anywhere 11 database platform. + * + * @deprecated Use SQLAnywhere 16 or newer */ class SQLAnywhere11Platform extends SQLAnywherePlatform { diff --git a/lib/Doctrine/DBAL/Platforms/SQLAnywhere12Platform.php b/lib/Doctrine/DBAL/Platforms/SQLAnywhere12Platform.php index dd73ef736ad..4fb3c63f70f 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLAnywhere12Platform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLAnywhere12Platform.php @@ -8,6 +8,8 @@ /** * The SQLAnywhere12Platform provides the behavior, features and SQL dialect of the * SAP Sybase SQL Anywhere 12 database platform. + * + * @deprecated Use SQLAnywhere 16 or newer */ class SQLAnywhere12Platform extends SQLAnywhere11Platform { diff --git a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php index 6e3b2fcb958..3f23733fd1f 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php @@ -33,6 +33,8 @@ /** * The SQLAnywherePlatform provides the behavior, features and SQL dialect of the * SAP Sybase SQL Anywhere 10 database platform. + * + * @deprecated Use SQLAnywhere 16 or newer */ class SQLAnywherePlatform extends AbstractPlatform { diff --git a/lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php b/lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php index a104848f84e..f281f4fc4e4 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php @@ -10,6 +10,8 @@ * On top of SQL Server 2008 the following functionality is added: * * - Create tables with the FEDERATED ON syntax. + * + * @deprecated */ class SQLAzurePlatform extends SQLServer2008Platform { diff --git a/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php b/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php index 1026a934f00..5cd3475c1e2 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php @@ -15,6 +15,8 @@ * NVARCHAR(max) replace the old TEXT, NTEXT and IMAGE types. See * {@link http://www.sql-server-helper.com/faq/sql-server-2005-varchar-max-p01.aspx} * for more information. + * + * @deprecated Use SQL Server 2012 or newer */ class SQLServer2005Platform extends SQLServerPlatform { diff --git a/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php b/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php index c2e36f34e67..9cbcb3872e6 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php @@ -7,6 +7,8 @@ * * Differences to SQL Server 2005 and before are that a new DATETIME2 type was * introduced that has a higher precision. + * + * @deprecated Use SQL Server 2012 or newer */ class SQLServer2008Platform extends SQLServer2005Platform { diff --git a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php index a37f7c9394a..4500e973c05 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php @@ -38,6 +38,8 @@ /** * The SQLServerPlatform provides the behavior, features and SQL dialect of the * Microsoft SQL Server database platform. + * + * @deprecated Use SQL Server 2012 or newer */ class SQLServerPlatform extends AbstractPlatform { diff --git a/lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php b/lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php index 8d8134127d7..871b54eec9e 100644 --- a/lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php +++ b/lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php @@ -32,6 +32,8 @@ * * Instantiation through the DriverManager looks like: * + * @deprecated + * * @example * * $conn = DriverManager::getConnection(array( diff --git a/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php b/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php index 5edc56b8778..2687c9d98ea 100644 --- a/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php +++ b/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php @@ -7,6 +7,8 @@ /** * Shard Manager for the Connection Pooling Shard Strategy + * + * @deprecated */ class PoolingShardManager implements ShardManager { diff --git a/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php b/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php index 417f674a3e0..e889edbc5d7 100644 --- a/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php +++ b/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php @@ -20,6 +20,8 @@ * by partitioning the passed schema into subschemas for the federation and the * global database and then applying the operations step by step using the * {@see \Doctrine\DBAL\Schema\Synchronizer\SingleDatabaseSynchronizer}. + * + * @deprecated */ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer { diff --git a/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php b/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php index d8178ee07db..62a6fd48447 100644 --- a/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php +++ b/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php @@ -11,6 +11,8 @@ /** * Sharding using the SQL Azure Federations support. + * + * @deprecated */ class SQLAzureShardManager implements ShardManager { diff --git a/lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php b/lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php index a83b401c2cd..79ac61abdcb 100644 --- a/lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php +++ b/lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php @@ -30,6 +30,8 @@ * (otherwise they will affect the same-id rows from other tenants as well). * SQLAzure throws errors when you try to create IDENTIY columns on federated * tables. + * + * @deprecated */ class MultiTenantVisitor implements Visitor { diff --git a/lib/Doctrine/DBAL/Sharding/ShardChoser/MultiTenantShardChoser.php b/lib/Doctrine/DBAL/Sharding/ShardChoser/MultiTenantShardChoser.php index 584e8155ae9..f44c3af4322 100644 --- a/lib/Doctrine/DBAL/Sharding/ShardChoser/MultiTenantShardChoser.php +++ b/lib/Doctrine/DBAL/Sharding/ShardChoser/MultiTenantShardChoser.php @@ -7,6 +7,8 @@ /** * The MultiTenant Shard choser assumes that the distribution value directly * maps to the shard id. + * + * @deprecated */ class MultiTenantShardChoser implements ShardChoser { diff --git a/lib/Doctrine/DBAL/Sharding/ShardChoser/ShardChoser.php b/lib/Doctrine/DBAL/Sharding/ShardChoser/ShardChoser.php index 6f8a9d47702..92510d704b1 100644 --- a/lib/Doctrine/DBAL/Sharding/ShardChoser/ShardChoser.php +++ b/lib/Doctrine/DBAL/Sharding/ShardChoser/ShardChoser.php @@ -7,6 +7,8 @@ /** * Given a distribution value this shard-choser strategy will pick the shard to * connect to for retrieving rows with the distribution value. + * + * @deprecated */ interface ShardChoser { diff --git a/lib/Doctrine/DBAL/Sharding/ShardManager.php b/lib/Doctrine/DBAL/Sharding/ShardManager.php index 7b37bb2c7e1..dbb229a1907 100644 --- a/lib/Doctrine/DBAL/Sharding/ShardManager.php +++ b/lib/Doctrine/DBAL/Sharding/ShardManager.php @@ -17,6 +17,8 @@ * executed against the last shard that was selected. If a query is created for * a shard Y but then a shard X is selected when its actually executed you * will hit the wrong shard. + * + * @deprecated */ interface ShardManager { diff --git a/lib/Doctrine/DBAL/Sharding/ShardingException.php b/lib/Doctrine/DBAL/Sharding/ShardingException.php index b46bda2ff0d..419e8aa10ef 100644 --- a/lib/Doctrine/DBAL/Sharding/ShardingException.php +++ b/lib/Doctrine/DBAL/Sharding/ShardingException.php @@ -6,6 +6,8 @@ /** * Sharding related Exceptions + * + * @deprecated */ class ShardingException extends DBALException {