Skip to content

Commit fb8e43c

Browse files
committed
Merge branch '3.2'
* 3.2: (24 commits) [Filesystem] Remove extra argv in dumpFile() tests [DI] minor FileLoaders tests update [FrameworkBundle] Add framework.cache.prefix_seed for predictible cache key prefixes [SecurityBundle] Remove FirewallContext mandatory FirewallConfig argument deprecation [HttpKernel] Revert BC breaking change of Request::isMethodSafe() [DI] Allow null as default env value [WebProfilerBundle] Fix deprecated uses of profiler_dump [SecurityBundle] Fix FirewallConfig nullable arguments [FrameworkBundle] Avoid warming up the validator cache for non-existent classes [DOMCrawler] Bug fixed [FrameworkBundle] Mark cache.default_*_provider services private [Process] Do feat test before enabling TTY mode bumped Symfony version to 3.1.8 updated VERSION for 3.1.7 updated CHANGELOG for 3.1.7 bumped Symfony version to 2.8.15 updated VERSION for 2.8.14 updated CHANGELOG for 2.8.14 bumped Symfony version to 2.7.22 updated VERSION for 2.7.21 ...
2 parents f397cf2 + 92c65d7 commit fb8e43c

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

CacheWarmer/ValidatorCacheWarmer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public function warmUp($cacheDir)
6868

6969
foreach ($this->extractSupportedLoaders($loaders) as $loader) {
7070
foreach ($loader->getMappedClasses() as $mappedClass) {
71-
$metadataFactory->getMetadataFor($mappedClass);
71+
if ($metadataFactory->hasMetadataFor($mappedClass)) {
72+
$metadataFactory->getMetadataFor($mappedClass);
73+
}
7274
}
7375
}
7476

DependencyInjection/Compiler/CachePoolPass.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ public function process(ContainerBuilder $container)
3131
{
3232
$namespaceSuffix = '';
3333

34-
foreach (array('name', 'root_dir', 'environment', 'debug') as $key) {
35-
if ($container->hasParameter('kernel.'.$key)) {
36-
$namespaceSuffix .= '.'.$container->getParameter('kernel.'.$key);
34+
foreach (array('kernel.name', 'kernel.environment', 'kernel.debug', 'cache.prefix.seed') as $key) {
35+
if ($container->hasParameter($key)) {
36+
$namespaceSuffix .= '.'.$container->getParameter($key);
3737
}
3838
}
39+
$container->getParameterBag()->remove('cache.prefix.seed');
3940

4041
$aliases = $container->getAliases();
4142
$attributes = array(

DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,10 @@ private function addCacheSection(ArrayNodeDefinition $rootNode)
667667
->addDefaultsIfNotSet()
668668
->fixXmlConfig('pool')
669669
->children()
670+
->scalarNode('prefix_seed')
671+
->info('Used to namespace cache keys when using several apps with the same shared backend')
672+
->example('my-application-name')
673+
->end()
670674
->scalarNode('app')
671675
->info('App related cache pools configuration')
672676
->defaultValue('cache.adapter.filesystem')

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,9 +1242,13 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
12421242
$container->getDefinition('cache.adapter.system')->replaceArgument(2, $version);
12431243
$container->getDefinition('cache.adapter.filesystem')->replaceArgument(2, $config['directory']);
12441244

1245+
if (isset($config['prefix_seed'])) {
1246+
$container->setParameter('cache.prefix.seed', $config['prefix_seed']);
1247+
}
12451248
foreach (array('doctrine', 'psr6', 'redis') as $name) {
12461249
if (isset($config[$name = 'default_'.$name.'_provider'])) {
12471250
$container->setAlias('cache.'.$name, Compiler\CachePoolPass::getServiceProvider($container, $config[$name]));
1251+
$container->getAlias('cache.'.$name)->setPublic(false);
12481252
}
12491253
}
12501254
foreach (array('app', 'system') as $name) {

Tests/Fixtures/Validation/Resources/person.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,15 @@
1515
</constraint>
1616
</property>
1717
</class>
18+
19+
<class name="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\NonExistentClass">
20+
<property name="gender">
21+
<constraint name="Choice">
22+
<option name="choices">
23+
<value>other</value>
24+
</option>
25+
<option name="message">This should be ignored.</option>
26+
</constraint>
27+
</property>
28+
</class>
1829
</constraint-mapping>

0 commit comments

Comments
 (0)