Do not activate the cache if Doctrine's cache is not present

This commit is contained in:
Samuel ROZE 2017-10-29 16:04:35 +00:00
parent 98dae3edb1
commit c5c7a2304d
No known key found for this signature in database
GPG Key ID: 835426F55A19FB84

View File

@ -12,6 +12,7 @@
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
use Doctrine\Common\Annotations\Annotation;
use Doctrine\Common\Cache\Cache;
use Symfony\Bundle\FullStack;
use Symfony\Component\Asset\Package;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
@ -741,7 +742,7 @@ class Configuration implements ConfigurationInterface
->info('annotation configuration')
->{class_exists(Annotation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->children()
->scalarNode('cache')->defaultValue('php_array')->end()
->scalarNode('cache')->defaultValue(interface_exists(Cache::class) ? 'php_array' : 'none')->end()
->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end()
->booleanNode('debug')->defaultValue($this->debug)->end()
->end()