Skip to content

Fix DoctrineConnectionFactoryFactory due to doctrine/common changes #1089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 14, 2020

Conversation

kdefives
Copy link
Contributor

@kdefives kdefives commented Sep 4, 2020

Fix #1085 - Fix to be compatible with doctrine v3 . Since Doctrine v3, seems some changes with doctrine/common

Fix php-enqueue#1085 - Fix to be compatible with doctrine v3 . Since Doctrine v3, seems some changes with doctrine/common
@kdefives kdefives changed the title Fix #1085 Fix DoctrineConnectionFactoryFactory due to doctrine/common changes Sep 4, 2020
@Steveb-p
Copy link
Contributor

Steveb-p commented Sep 4, 2020

@kdefives It will probably be fine just replacing the old interface with the new one, but we should probably also add conflict to composer.json with doctrine/persistence versions that did not have it yet. I had a quick look but could not determine since when it was introduced though.

@kdefives
Copy link
Contributor Author

kdefives commented Sep 4, 2020

@kdefives It will probably be fine just replacing the old interface with the new one, but we should probably also add conflict to composer.json with doctrine/persistence versions that did not have it yet. I had a quick look but could not determine since when it was introduced though.

@Steveb-p I think it is recent because i started to developed my application 18 days ago and everything worked perfectly until yesterday when i executed a "composer update". Hope it will help you.

@Steveb-p
Copy link
Contributor

Steveb-p commented Sep 4, 2020

@kdefives doctrine/persistence @1.3.0 introduces a compatibility layer (9 months ago):
doctrine/persistence@548f75f

Anything before that will break, because Doctrine\Persistence\ManagerRegistry class will not exist. Simple solution would be to mark doctrine/persistence < 1.3.0 as conflicting.

@kdefives
Copy link
Contributor Author

kdefives commented Sep 4, 2020

@Steveb-p Sorry i did not understand what you mean.

When you say "Simple solution would be to mark doctrine/persistence < 1.3.0 as conflicting.". Do you mean here : https://github.com/kdefives/enqueue-dev/blob/patch-1/composer.json ?
Or in the composer.json of my application?

Because i tried to add this line in my composer.json of my application but i still have the issue:

"conflict": {
        "symfony/symfony": "*",
        "doctrine/persistence": "<1.3.0"
    },

My application is working perfectly if i change this line

"doctrine/doctrine-bundle": "^2.1",

by this line

"doctrine/doctrine-bundle": "v2.1.0",

Then, when i execute composer update i can see the downgrade:

Package operations: 0 installs, 3 updates, 0 removals
  - Downgrading doctrine/persistence (2.0.0 => 1.3.8): Loading from cache
  - Downgrading doctrine/doctrine-bundle (2.1.1 => 2.1.0): Loading from cache
  - Downgrading doctrine/common (3.0.2 => 2.13.3): Loading from cache

@Steveb-p
Copy link
Contributor

Steveb-p commented Sep 4, 2020

@kdefives I'm specifically saying that switching DoctrineConnectionFactoryFactory to use Doctrine\Persistence\ManagerRegistry will cause projects that use doctrine/persistence lower than 1.3.0 to crash. Because of this we have to either add a compatibility layer (selecting one of the classes to be used as constructor argument depending on which is available) or mark previous versions as being in conflict (editing enqueue's composer.json to say so).

Marking as conflicting is an easy way out of the problem, however providing compatibility layer is a better solution (especially since persistence 1.3 is 9 months old).

@kdefives
Copy link
Contributor Author

kdefives commented Sep 4, 2020

I did changes but there are still issues with test classes (as you can see the checks failed). I do not think to have enough time to work on it so if someone can finish this PR, feel free. Moreover, I think it could be useful for other people who starts new Symfony project.

Until new release with this fix, I fixed doctrine-bundle version as explained below, in my project.

Thx again for your help.
Regards

@nivpenso
Copy link
Contributor

nivpenso commented Oct 3, 2020

any news regarding that one?

@kricha
Copy link

kricha commented Oct 12, 2020

any news?

@a-menshchikov
Copy link
Contributor

What news about this PR?

@nivpenso nivpenso mentioned this pull request Oct 13, 2020
@nivpenso
Copy link
Contributor

I have created a follow-up PR (#1105) for this PR. hopefully, it will be merged soon

@makasim makasim merged commit c5605e3 into php-enqueue:master Oct 14, 2020
@kdefives kdefives deleted the patch-1 branch February 28, 2021 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type mismatch in DoctrineConnectionFactoryFactory
6 participants