Skip to content

Commit ffc9884

Browse files
committed
bug symfony#24743 [FrameworkBundle] Do not activate the cache if Doctrine's cache is not present (sroze)
This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] Do not activate the cache if Doctrine's cache is not present | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#24683 | License | MIT | Doc PR | ø Annotations are automatically enabled when the `doctrine/annotations` package is around. These annotations are enabled with the `php_array` cache by default, which require `doctrine/cache`. This PR allow this scenario to happen by disabling the annotation cache when `doctrine/cache` is not present. Commits ------- c5c7a23 Do not activate the cache if Doctrine's cache is not present
2 parents 98dae3e + c5c7a23 commit ffc9884

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/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)