doctrine / DoctrinePHPCRBundle

This bundle integrates Doctrine PHPCR ODM and PHPCR backends into Symfony
http://phpcr.github.com
MIT License
156 stars 66 forks source link

Doctrine Cache 2 #360

Closed KDederichs closed 3 years ago

KDederichs commented 3 years ago

Hey, I’m trying to fix up the LiipTestFixturesBundle atm and I’m running into the issue that DoctrinePHPCRBundle tries to load Doctrine\Common\Cache\ArrayCache when Doctrine Cache 2.0 is installed. Since all the Cache implementations are removed from there it’s erroring out of course.

Is there any way to make this work with Doctrine Cache 2.0 or does this need to be updated for that to work?

dbu commented 3 years ago

hm, i am not too sure if this is in this bundle or in the doctrine bridge of symfony. i quickly tried to see if we use the doctrine_phpcr.odm.cache.array.class parameter of src/Resources/config/odm.xml but did not find it.

one idea to figure out would be to look at the doctrine orm bundle. i guess it works with that bundle - if we can find the fix there, we can port it to the phpcr bundle.

i don't have time to work on this in the next couple of days. if you want to give a shot, would be great.

KDederichs commented 3 years ago

I think it's that line: https://github.com/doctrine/DoctrinePHPCRBundle/blob/872c80b9a2a78636d7b680e288e3724261b19f51/src/DependencyInjection/Configuration.php#L382

since array cache is set as default here and it does not exist in cache 2.0 anymore

dbu commented 3 years ago

hm, looks like, yes. orm uses defaultNull since 2.0 https://github.com/doctrine/DoctrinePHPCRBundle/blob/872c80b9a2a78636d7b680e288e3724261b19f51/src/DependencyInjection/Configuration.php#L382

however, i am not sure if we can simply defaultNull here or if that disables caching by default... would need to dig up where the value is used and if null means "take what is available" or "don't cache"

dbu commented 3 years ago

i made this bundle require doctrine/cache ^1 directly in #361

next step will be to change jackalope to use PSR-6/16 instead of doctrine/cache.