cli-config.php compatibility with DBAL #6566

Closed
opened 2026-01-22 15:35:02 +01:00 by admin · 2 comments
Owner

Originally created by @PowerKiKi on GitHub (Nov 4, 2020).

Since DBAL 2.11.0 and https://github.com/doctrine/dbal/pull/3956, it is now deprecated to use HelperSet in cli-config.php. This will become impossible in DBAL 3, following https://github.com/doctrine/dbal/pull/4059.

This means that, in order to keep sharing a single config file for both packages, this package should also accept the new \Doctrine\DBAL\Tools\Console\ConnectionProvider. It could actually be a new interface along the lines of:

namespace \Doctrine\ORM\Tools\Console;

interface EntityManagerProvider
    public function getEntityManager(string $name) : EntityManagerInterface;
}

I suppose the support of HelperSet could be drop entirely in the next major version too. So long we can use a HelperSetManagerProvider that extends the EntityManagerProvider.

All commands must be adjusted to access the entity manager from a provider instead of the HelperSet. Deprecation messages when using HelperSet must be thrown appropriately.

See related https://github.com/doctrine/migrations/issues/1070

Originally created by @PowerKiKi on GitHub (Nov 4, 2020). Since DBAL 2.11.0 and https://github.com/doctrine/dbal/pull/3956, it is now deprecated to use HelperSet in `cli-config.php`. This will become impossible in DBAL 3, following https://github.com/doctrine/dbal/pull/4059. This means that, in order to keep sharing a single config file for both packages, this package should also accept the new `\Doctrine\DBAL\Tools\Console\ConnectionProvider`. It could actually be a new interface along the lines of: ```php namespace \Doctrine\ORM\Tools\Console; interface EntityManagerProvider public function getEntityManager(string $name) : EntityManagerInterface; } ``` I suppose the support of HelperSet could be drop entirely in the next major version too. So long we can use a `HelperSetManagerProvider` that extends the `EntityManagerProvider`. All commands must be adjusted to access the entity manager from a provider instead of the HelperSet. Deprecation messages when using HelperSet must be thrown appropriately. See related https://github.com/doctrine/migrations/issues/1070
admin added the Deprecation label 2026-01-22 15:35:02 +01:00
admin closed this issue 2026-01-22 15:35:02 +01:00
Author
Owner

@beberlei commented on GitHub (Mar 6, 2021):

I have updated the description of the issue to explain my approach to performing this deprecation:

  1. Introduce EntityManagerProvider as mentioned
  2. Introduce a HelperSetManagerProvider that is used and introduced for the deprecated legacy case in ConsoleRunner
  3. Introduce AbstractEntityManagerCommand that each command implements. Provide backwards compatibility with other packages extending Doctrine commands.
@beberlei commented on GitHub (Mar 6, 2021): I have updated the description of the issue to explain my approach to performing this deprecation: 1. Introduce `EntityManagerProvider` as mentioned 2. Introduce a `HelperSetManagerProvider` that is used and introduced for the deprecated legacy case in `ConsoleRunner` 3. Introduce `AbstractEntityManagerCommand` that each command implements. Provide backwards compatibility with other packages extending Doctrine commands.
Author
Owner

@beberlei commented on GitHub (Apr 18, 2021):

Merged #8524 into 2.9.x

@beberlei commented on GitHub (Apr 18, 2021): Merged #8524 into 2.9.x
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6566