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
......@@ -59,7 +59,7 @@ class QueryInformation extends AbstractSubModule implements DataProviderInterfac
/**
* @param ServerRequestInterface $request
* @return \TYPO3\CMS\Adminpanel\ModuleApi\ModuleData
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function getDataToStore(ServerRequestInterface $request): ModuleData
{
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Backend\Form\FormDataProvider;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use TYPO3\CMS\Backend\Module\ModuleLoader;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
......
......@@ -15,8 +15,8 @@
namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\Exception as DBALException;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems;
......
......@@ -15,10 +15,10 @@
namespace TYPO3\CMS\Core\DataHandling;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform as PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform as SQLServerPlatform;
use Doctrine\DBAL\Types\IntegerType;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
......@@ -8875,7 +8875,7 @@ class DataHandler implements LoggerAwareInterface
* @param \TYPO3\CMS\Core\Database\Connection $connection
* @param string $tableName
* @return int
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
protected function postProcessSqlServerInsert(Connection $connection, string $tableName): int
{
......
......@@ -22,7 +22,7 @@ use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform as PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\VersionAwarePlatformDriver;
use Psr\Log\LoggerAwareInterface;
......@@ -79,7 +79,7 @@ class Connection extends \Doctrine\DBAL\Connection implements LoggerAwareInterfa
* @param Configuration|null $config The configuration, optional.
* @param EventManager|null $em The event manager, optional.
*
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function __construct(array $params, Driver $driver, Configuration $config = null, EventManager $em = null)
{
......
......@@ -111,7 +111,7 @@ class ConnectionPool
*
* @param string $connectionName
* @return Connection
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function getConnectionByName(string $connectionName): Connection
{
......
......@@ -17,8 +17,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Driver;
use Doctrine\DBAL\Driver\PDO\Exception as PDOException;
use Doctrine\DBAL\Driver\PDOConnection as DoctrineDbalPDOConnection;
use Doctrine\DBAL\Driver\PDOException;
use PDO;
/**
......
......@@ -17,8 +17,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Driver\PDOMySql;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrinePDOMySqlDriver;
use Doctrine\DBAL\Exception as DBALException;
use PDOException;
use TYPO3\CMS\Core\Database\Driver\PDOConnection;
......
......@@ -17,8 +17,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Driver\PDOPgSql;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineDbalPDOPgSqlDriver;
use Doctrine\DBAL\Exception as DBALException;
use PDO;
use PDOException;
use TYPO3\CMS\Core\Database\Driver\PDOConnection;
......
......@@ -17,8 +17,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Driver\PDOSqlite;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\PDOSqlite\Driver as DoctrinePDOSqliteDriver;
use Doctrine\DBAL\Exception as DBALException;
use PDOException;
use TYPO3\CMS\Core\Database\Driver\PDOConnection;
......
......@@ -17,8 +17,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Driver;
use Doctrine\DBAL\Driver\PDOException;
use Doctrine\DBAL\Driver\PDOStatement as DoctrineDbalPDOStatement;
use Doctrine\DBAL\Driver\PDO\Exception as PDOException;
use Doctrine\DBAL\Driver\PDO\Statement as DoctrineDbalPDOStatement;
use PDO;
class PDOStatement extends DoctrineDbalPDOStatement
......
......@@ -17,12 +17,12 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Platform;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
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;
/**
* Helper to handle platform specific details
......@@ -108,7 +108,7 @@ class PlatformInformation
/**
* Return information about the maximum supported length for a SQL identifier.
*
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @param AbstractPlatform $platform
* @return int
* @internal
*/
......@@ -122,7 +122,7 @@ class PlatformInformation
/**
* Return information about the maximum number of bound parameters supported on this platform
*
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @param AbstractPlatform $platform
* @return int
* @internal
*/
......@@ -136,7 +136,7 @@ class PlatformInformation
/**
* Return the platform shortname to use as a lookup key
*
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @param AbstractPlatform $platform
* @return string
* @throws \RuntimeException
* @internal
......
......@@ -19,9 +19,9 @@ namespace TYPO3\CMS\Core\Database\Query;
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 Doctrine\DBAL\Query\Expression\CompositeExpression;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Core\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;
......
......@@ -15,7 +15,7 @@
namespace TYPO3\CMS\Core\Database;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
......
......@@ -17,9 +17,9 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Database\Schema;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception as DBALException;
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\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff;
......@@ -206,7 +206,7 @@ class ConnectionMigrator
* for tables that are in the database but have no direct relation to the TYPO3 instance.
*
* @param bool $renameUnused
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @return \Doctrine\DBAL\Schema\SchemaDiff
* @throws \Doctrine\DBAL\Schema\SchemaException
* @throws \InvalidArgumentException
......@@ -275,7 +275,7 @@ class ConnectionMigrator
*
* @param string $connectionName
* @return \Doctrine\DBAL\Schema\Schema
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \InvalidArgumentException
*/
protected function buildExpectedSchemaDefinitions(string $connectionName): Schema
......
......@@ -33,7 +33,7 @@ class SchemaAlterTableListener
*
* @param \Doctrine\DBAL\Event\SchemaAlterTableEventArgs $event
* @return bool
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function onSchemaAlterTable(SchemaAlterTableEventArgs $event)
{
......
......@@ -33,7 +33,7 @@ class SchemaColumnDefinitionListener
* for custom doctrine types and builds the appropriate Column Object.
*
* @param \Doctrine\DBAL\Event\SchemaColumnDefinitionEventArgs $event
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function onSchemaColumnDefinition(SchemaColumnDefinitionEventArgs $event)
{
......@@ -60,7 +60,7 @@ class SchemaColumnDefinitionListener
* @param array $tableColumn
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @return \Doctrine\DBAL\Schema\Column
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @todo: The $tableColumn source currently only support MySQL definition style.
*/
protected function getEnumerationTableColumnDefinition(array $tableColumn, AbstractPlatform $platform): Column
......
......@@ -33,7 +33,7 @@ class SchemaIndexDefinitionListener
* part length into account when a MySQL platform has been detected.
*
* @param \Doctrine\DBAL\Event\SchemaIndexDefinitionEventArgs $event
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \InvalidArgumentException
*/
public function onSchemaIndexDefinition(SchemaIndexDefinitionEventArgs $event)
......
......@@ -87,7 +87,7 @@ class TableBuilder
*
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @throws \InvalidArgumentException
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
*/
public function __construct(AbstractPlatform $platform = null)
{
......
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