Doctrinebundle: Make some dependencies optional

Created on 1 May 2019  路  1Comment  路  Source: doctrine/DoctrineBundle

Looking at the requirements list, it is possible to make a couple of dependencies optional?

Most helpful comment

This can only happen in 2.0, but has been planned already.

  • doctrine/doctrine-cache-bundle is only needed if doctrine/orm is installed.

With #114 (which I was hoping to add for 1.11) the bundle would also be required when only using DBAL. However, we are deprecating DoctrineCacheBundle (see https://github.com/doctrine/DoctrineCacheBundle/issues/156) and will be dropping the dependency from version of doctrine/doctrine-bundle onwards.

  • jdorn/sql-formatter is used in the web profiler, but symfony/web-profiler-bundle itself is optional. If it isn't installed but the profiler is, will just be a little less pretty?

As per #785, the dependency seems to be essentially dead. I don't want to drop it in a minor release, but the package is going to be dropped in 2.0. If you know any good alternatives that we may add as formatters, please let me know, but it could very well be that we're dropping this entirely for lack of packages.

With regards to packages only needed when using ORM but not with DBAL, we're thinking of splitting this bundle into two distinct bundles for DBAL and ORM, with the latter having a hard dependency on the former. There's some more work to be done in preparation for that, but it would reduce the number of unnecessary (or optional) dependencies.

I will close this issue since both packages are already in the process of being dropped. Thanks for bringing it up!

>All comments

This can only happen in 2.0, but has been planned already.

  • doctrine/doctrine-cache-bundle is only needed if doctrine/orm is installed.

With #114 (which I was hoping to add for 1.11) the bundle would also be required when only using DBAL. However, we are deprecating DoctrineCacheBundle (see https://github.com/doctrine/DoctrineCacheBundle/issues/156) and will be dropping the dependency from version of doctrine/doctrine-bundle onwards.

  • jdorn/sql-formatter is used in the web profiler, but symfony/web-profiler-bundle itself is optional. If it isn't installed but the profiler is, will just be a little less pretty?

As per #785, the dependency seems to be essentially dead. I don't want to drop it in a minor release, but the package is going to be dropped in 2.0. If you know any good alternatives that we may add as formatters, please let me know, but it could very well be that we're dropping this entirely for lack of packages.

With regards to packages only needed when using ORM but not with DBAL, we're thinking of splitting this bundle into two distinct bundles for DBAL and ORM, with the latter having a hard dependency on the former. There's some more work to be done in preparation for that, but it would reduce the number of unnecessary (or optional) dependencies.

I will close this issue since both packages are already in the process of being dropped. Thanks for bringing it up!

Was this page helpful?
0 / 5 - 0 ratings