BlockVarnishCache extends non existant class
gonzalovilaseca opened this issue · 8 comments
BlockVarnishCache extends
Sonata\CacheBundle\Adapter\VarnishCache;
This class was introduced in SonataCacheBundle version 2.1.1, CMF Block Bundle has a dependency on Sonata Block Bundle which has a dependency on "sonata-project/cache": "~1.0", so version 1.0.3 of Sonata Cache is installed (without VarnishCache class).
that seems to me like either sonata is not careful about its setup, or the composer.json of the sonata thing that wants to use VarnishCache is not correct. either way, not much we can do on the cmf side i think.
we can try to relax the requirement on the sonata block bundle and see if it introduces no BC break. do you want to try a PR for that? if you do, please also test the cmf sandbox with the newest sonata block bundle version you allow to reduce the risk of breaking something. (we can't require just 2.2.* of sonata block bundle, because sonata does not respect semver and does BC breaks in PATCH releases)
I know it's nothing to do with you, you just suffer the 'side-effect', but I wanted to inform you.
I going to contact Sonata to see if they can change their requirement, will update here as soon as I have something.
ok, thanks. i appreciate it. it was just not clear to me from your issue
if you expect us to do something about it.
on sonata side, i guess the best thing is a PR to the composer.json with
the correct minimal version requirement.
I messed up with names, versions are correct.
The class is missing because symfony-cmf/block-bundle doesn't install sonata-project/cache-bundle dependency.
I just downloaded CMF, added
"symfony-cmf/block-bundle": "1.1.*"
to it's dependencies, and did a composer install. Sonata-project/cache-bundle is not installed, but sonata-project/cache is. Any ideas?
reading https://github.com/symfony-cmf/BlockBundle/blob/master/composer.json#L34 i think we are correct. we depend on sonata block-bundle. we don't require sonata-cache in our bundle and have no dependencies on it. sonata block-bundle should work without the cache i would expect, but if it does depend its either a bug that needs fixing or the composer.json needs to be fixed. /cc @rande
hm, i start to see what you are telling me. we do have a BlockVarnishCache class in this bundle. but this feature should not be required.
as far as i can tell we only load the service when the SonataCacheBundle is present https://github.com/symfony-cmf/BlockBundle/blob/master/DependencyInjection/CmfBlockExtension.php#L165-L179
am i missing something?
I've setup fresh installs to see if the dependencies where correctly installed, I'll let you know what I find as soon as I have clear conclusions.
ping