Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b57895c

Browse files
committed
[FrameworkBundle] deprecated validator.mapping.cache.doctrine.apc
1 parent 7c1febd commit b57895c

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

UPGRADE-3.4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Finder
1616
FrameworkBundle
1717
---------------
1818

19+
* The `validator.mapping.cache.doctrine.apc` service has been deprecated.
20+
1921
* Using the `KERNEL_DIR` environment variable or the automatic guessing based
2022
on the `phpunit.xml` / `phpunit.xml.dist` file location is deprecated since 3.4.
2123
Set the `KERNEL_CLASS` environment variable to the fully-qualified class name

UPGRADE-4.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ Form
227227
FrameworkBundle
228228
---------------
229229

230+
* The `validator.mapping.cache.doctrine.apc` service has been removed.
231+
230232
* The `cache:clear` command does not warmup the cache anymore. Warmup should
231233
be done via the `cache:warmup` command.
232234

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,18 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
661661
->info('validation configuration')
662662
->{!class_exists(FullStack::class) && class_exists(Validation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
663663
->children()
664-
->scalarNode('cache')->end()
664+
->scalarNode('cache')
665+
->beforeNormalization()
666+
// Can be removed in 4.0, when validator.mapping.cache.apc is removed
667+
->ifString()->then(function ($v) {
668+
if ('validator.mapping.cache.apc' === $v && !class_exists('Doctrine\Common\Cache\ApcCache')) {
669+
throw new LogicException('Doctrine APC cache for the validator cannot be enabled as the Doctrine Cache package is not installed.');
670+
}
671+
672+
return $v;
673+
})
674+
->end()
675+
->end()
665676
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
666677
->arrayNode('static_method')
667678
->defaultValue(array('loadValidatorMetadata'))

src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
</call>
5858
</service>
5959
</argument>
60+
<deprecated>The "%service_id%" service is deprecated since Symfony 3.4 and will be removed in 4.0. Use a Psr6 cache like "validator.mapping.cache.symfony" instead.</deprecated>
6061
</service>
6162

6263
<service id="validator.validator_factory" class="Symfony\Component\Validator\ContainerConstraintValidatorFactory">

0 commit comments

Comments
 (0)