Commit b2a22815 authored by Benni Mack's avatar Benni Mack Committed by Christian Kuhn
Browse files

[BUGFIX] DBAL: Do not use deprecated classes

In preparation for Doctrine DBAL 3.0,

1. all usages of Doctrine\DBAL\DBALException have
been migrated to Doctrine\DBAL\Exception,
because DBAL Exception does not exist in
Doctrine 3.0 anymore.

2. Doctrine\DBAL\Platforms\PostgreSqlPlatform
has been migrated to Doctrine\DBAL\Platforms\PostgreSQL94Platform
because this class does not exist anymore in Doctrine DBAL 3.0,
same goes for Doctrine\DBAL\Platforms\SQLServerPlatform
which has been replaced by Doctrine\DBAL\Platforms\SQLServer2012Platform

3. Doctrine\DBAL\Driver\PDOException has been
renamed to Doctrine\DBAL\Driver\PDO\Exception

4. Doctrine\DBAL\Driver\PDOStatement has been
renamed to Doctrine\DBAL\Driver\PDO\Statement

Resolves: #93071
Releases: master
Change-Id: I05e82f2fca09eb7718a90c09f95e503980ae10ae
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67109

Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent ac49cd3f
......@@ -17,7 +17,7 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Schema;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaDiff;
use Doctrine\DBAL\Schema\Table;
......@@ -46,7 +46,7 @@ class SchemaMigrator
* @param string[] $statements The CREATE TABLE statements
* @param bool $remove TRUE for RENAME/DROP table and column suggestions, FALSE for ADD/CHANGE suggestions
* @return array[] SQL statements to migrate the database to the expected schema, indexed by performed operation
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \Doctrine\DBAL\Schema\SchemaException
* @throws \InvalidArgumentException
* @throws \RuntimeException
......@@ -79,7 +79,7 @@ class SchemaMigrator
*
* @param array $statements
* @return SchemaDiff[]
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \Doctrine\DBAL\Schema\SchemaException
* @throws \InvalidArgumentException
* @throws \RuntimeException
......@@ -111,7 +111,7 @@ class SchemaMigrator
* @param string[] $statements The CREATE TABLE statements
* @param string[] $selectedStatements The hashes of the update suggestions to execute
* @return array
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \Doctrine\DBAL\Schema\SchemaException
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Core\Database\Schema\Exception\UnexpectedSignalReturnValueTypeException
......@@ -156,7 +156,7 @@ class SchemaMigrator
* @param string[] $statements The CREATE TABLE statements
* @param bool $createOnly Only perform changes that add fields or create tables
* @return array[] Error messages for statements that occurred during the installation procedure.
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \Doctrine\DBAL\Schema\SchemaException
* @throws \InvalidArgumentException
* @throws \RuntimeException
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Core\Resource\Index;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform as SQLServerPlatform;
use Psr\EventDispatcher\EventDispatcherInterface;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
......
......@@ -17,7 +17,7 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Session\Backend;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Core\Utility;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\FetchMode;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Context\Context;
......
......@@ -46,7 +46,7 @@ class BackendUserAuthenticationTest extends FunctionalTestCase
protected $subject;
/**
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \TYPO3\TestingFramework\Core\Exception
*/
protected function setUp(): void
......
......@@ -388,7 +388,7 @@ class QueryGeneratorTest extends FunctionalTestCase
*
* @test
* @dataProvider arbitraryDataIsEscapedDataProvider
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function arbitraryDataIsEscaped(string $injector, array $settings)
{
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Core\Tests\Unit\Database\Mocks;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
class MockPlatform extends AbstractPlatform
......@@ -25,7 +25,7 @@ class MockPlatform extends AbstractPlatform
*
* @param array $field
* @return string|void
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function getBlobTypeDeclarationSQL(array $field)
{
......@@ -161,7 +161,7 @@ class MockPlatform extends AbstractPlatform
*
* @return string
*
* @throws \Doctrine\DBAL\DBALException If not supported on this platform.
* @throws \Doctrine\DBAL\Exception If not supported on this platform.
*/
protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed)
{
......@@ -172,7 +172,7 @@ class MockPlatform extends AbstractPlatform
*
* @return string
*
* @throws \Doctrine\DBAL\DBALException If not supported on this platform.
* @throws \Doctrine\DBAL\Exception If not supported on this platform.
*/
protected function getReservedKeywordsClass()
{
......
......@@ -19,9 +19,9 @@ namespace TYPO3\CMS\Core\Tests\Unit\Database\Platform;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform as PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform as SQLServerPlatform;
use TYPO3\CMS\Core\Database\Platform\PlatformInformation;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
......
......@@ -20,9 +20,9 @@ namespace TYPO3\CMS\Core\Tests\Unit\Database\Query;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform as PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform as SQLServerPlatform;
use Prophecy\Argument;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
......
......@@ -17,8 +17,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Extbase\Persistence\Generic\Storage;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Platforms\SQLServer2012Platform as SQLServerPlatform;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\WorkspaceAspect;
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Extensionmanager\Domain\Repository;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Platform\PlatformInformation;
......
......@@ -15,8 +15,8 @@
namespace TYPO3\CMS\Frontend\ContentObject;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\Exception as DBALException;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Log\LoggerAwareInterface;
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Frontend\Tests\Functional\ContentObject;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform as SQLServerPlatform;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Log\NullLogger;
use TYPO3\CMS\Core\Context\Context;
......
......@@ -17,8 +17,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Install\Controller;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Exception\ConnectionException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
......
......@@ -75,7 +75,7 @@ class MySql extends AbstractPlatform
*
* @return FlashMessageQueue
* @throws \InvalidArgumentException
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function getStatus(): FlashMessageQueue
{
......
......@@ -69,7 +69,7 @@ class PostgreSql extends AbstractPlatform
* Get all status information as array with status objects
*
* @return FlashMessageQueue
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \InvalidArgumentException
*/
public function getStatus(): FlashMessageQueue
......
......@@ -66,7 +66,7 @@ class SqlSrv extends AbstractPlatform
*
* @return FlashMessageQueue
* @throws \InvalidArgumentException
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function getStatus(): FlashMessageQueue
{
......
......@@ -34,7 +34,7 @@ class Sqlite extends AbstractPlatform
*
* @return FlashMessageQueue
* @throws \InvalidArgumentException
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function getStatus(): FlashMessageQueue
{
......
......@@ -17,7 +17,7 @@ declare(strict_types=1);
namespace TYPO3\CMS\Install\Updates;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform as SQLServerPlatform;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Registry;
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Lowlevel\Database;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment