Review main Merged

81588[TASK] Remove usage of deprecated `doctrine/event-manager`

Stefan Bürk CR +2 V +2 Nightmare +2326 −468 updated 11/20/23, 14:24

Commit message

The doctrine team used `doctrine/dbal:3.x` as a transition version
to prepare for a full overhaul with `4.0` and added the removed
or breaking changes as deprecation to the `3.x` versions.

`doctrine/dbal:3.7` deprecated the event based system to enhance
the integration using the `doctrine/event-manger`.

TYPO3 used two types of the deprecated events to provide required
additional database schema handling information:

* `schema-definition-events [1]`
* `schama-manipulation-events [2]`

The proposed way to replace the deprecated `schema-definition-events`
is to use custom SchemaManager classes to provide the required changes.
Therefore, all doctrine SchemaManager variants needs to be extended and
replaced using a custom SchemaManagerFactory. This also also mitigates
the requirement that a SchemaManagerFactory needs to be always set
which we now do.

To mitigate the deprecated `schama-manipulation-events` the proposed
way is to implement custom platform classes. We now extend all provided
platform classes for supported dbms vendors and versions.
To ensure the extended platform classes are used, a custom doctrine/dbal
driver middleware and a driver decorator is added to the system as
global connection middlewares. Global connection middlewares can be
opened up as a feature with another patch.

The old event classes of the deprecated `doctrine/event-manager`
integration are removed and not considered since they are core
internal implementations.

Namespace imports for platform classes are modified in most places
to aliases prefixed with `Doctrine` to make it easier to differentiate
between TYPO3 and doctrine implementations.

Beside the fact that the introduced platform classes are marked as
`@internal` an important ReST file is added to provide information
why the core classes should not be used especially for `instanceof`
checks.

[1] https://github.com/doctrine/dbal/blob/3.7.x/UPGRADE.md#deprecated-extension-via-schema-definition-events
[2] https://github.com/doctrine/dbal/blob/3.7.x/UPGRADE.md#deprecated-extension-via-schema-manipulation-events
[3] https://github.com/doctrine/dbal/blob/3.7.x/UPGRADE.md#deprecated-not-setting-a-schema-manager-factory

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 57

Show 37 more files