Important: #102402 - Extended Doctrine DBAL Platform classes
See forge#102402
Description
The Core needs to adapt some internal classes to prepare towards doctrine/
major version 4.x. The Doctrine team deprecated especially the Doctrine
event manager, the Core used to populate custom adaptions.
The proposed way to mitigate the old events is to extend classes and integrate custom handling code directly. TYPO3 thus extends a couple of classes and replaces them using a factory.
Affected code is marked @internal
. Extension author must not rely on the
TYPO3 class names for instanceof
checks and should check using the original
Doctrine classes instead.
For example, doctrine/
has the following inheritance chain:
<?php
class MySQL80Platform extends MySQL57Platform {}
class MySQL57Platform extends MySQLPlatform {}
class MySQLPlatform extends AbstractMySQLPlatform {}
class AbstractMySQLPlatform extends AbstractPlatform {}
TYPO3 now extends the concrete platform classes:
\TYPO3\
extendsCMS\ Core\ Database\ Platform\ My SQL80Platform \Doctrine\
DBAL\ Platforms\ My SQL80Platform \TYPO3\
extendsCMS\ Core\ Database\ Platform\ My SQL57Platform \Doctrine\
DBAL\ Platforms\ My SQL57Platform \TYPO3\
extendsCMS\ Core\ Database\ Platform\ My SQLPlatform \Doctrine\
DBAL\ Platforms\ My SQLPlatform
The TYPO3 Core classes are only used as top layer, for example:
\TYPO3\
extendsCMS\ Core\ Database\ Platform\ My SQL80Platform \Doctrine\
DBAL\ Platforms\ My SQL80Platform \Doctrine\
extendsDBAL\ Platforms\ My SQL80Platform \Doctrine\
DBAL\ Platforms\ My SQL57Platform \Doctrine\
extendsDBAL\ Platforms\ My SQL57Platform \Doctrine\
DBAL\ Platforms\ My SQLPlatform \Doctrine\
extendsDBAL\ Platforms\ My SQLPlatform \Doctrine\
DBAL\ Platforms\ Abstract My SQLPlatform \Doctrine\
extendsDBAL\ Platforms\ Abstract My SQLPlatform \Doctrine\
DBAL\ Platforms\ Abstract Platform
Custom extension code that needs to implement instanceof
checks for specific platforms
should use the Doctrine classes and not the TYPO3 Core classes, for example:
<?php
use Doctrine\DBAL\Platforms\MySQLPlatform as DoctrineMySQLPlatform;
use TYPO3\CMS\Core\Database\Platform\MySQL80Platform as Typo3MySQL80Platform;
// Usually incoming from elsewhere, eg. DI.
$platform = new Typo3MySQL80Platform();
$check = $platform instanceof DoctrineMySQLPlatform();