Skip to content

Commit eeda225

Browse files
committed
Do not activate the cache if Doctrine's cache is not present
1 parent 422554e commit eeda225

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
1313

1414
use Doctrine\Common\Annotations\Annotation;
15+
use Doctrine\Common\Cache\Cache;
1516
use Symfony\Bundle\FullStack;
1617
use Symfony\Component\Asset\Package;
1718
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
@@ -741,7 +742,7 @@ private function addAnnotationsSection(ArrayNodeDefinition $rootNode)
741742
->info('annotation configuration')
742743
->{class_exists(Annotation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
743744
->children()
744-
->scalarNode('cache')->defaultValue('php_array')->end()
745+
->scalarNode('cache')->defaultValue(interface_exists(Cache::class) ? 'php_array' : 'none')->end()
745746
->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end()
746747
->booleanNode('debug')->defaultValue($this->debug)->end()
747748
->end()

0 commit comments

Comments
 (0)