Skip to content

Commit 3951079

Browse files
Merge branch '3.2' into 3.3
* 3.2: Don't display the Symfony debug toolbar when printing the page do not wire namespaces for the ArrayAdapter [Cache] Added test for ApcuAdapter when using in CLI allow to configure custom formats in XML configs [HttpKernel] fix DumpDataCollector tests [FrameworkBundle] fix changelog [WebProfilerBundle] Cleanup profiler leftover require the XML PHP extension Fix phpdoc for serializer normalizers exceptions Fixed absolute url generation for query strings and hash urls bumped Symfony version to 2.8.25 updated VERSION for 2.8.24 updated CHANGELOG for 2.8.24 bumped Symfony version to 2.7.32 [Filesystem] Dont copy perms when origin is remote updated VERSION for 2.7.31 update CONTRIBUTORS for 2.7.31 updated CHANGELOG for 2.7.31
2 parents 14e0156 + 405fe9e commit 3951079

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ CHANGELOG
7171
* Deprecated using core form types without dependencies as services
7272
* Added `Symfony\Component\HttpHernel\DataCollector\RequestDataCollector::onKernelResponse()`
7373
* Added `Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector`
74-
* Deprecated service `serializer.mapping.cache.apc` (use `serializer.mapping.cache.doctrine.apc` instead)
74+
* The `framework.serializer.cache` option and the service `serializer.mapping.cache.apc` have been
75+
deprecated. APCu should now be automatically used when available.
7576

7677
3.0.0
7778
-----

DependencyInjection/Compiler/CachePoolPass.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\Compiler;
1313

1414
use Symfony\Component\Cache\Adapter\AbstractAdapter;
15+
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1516
use Symfony\Component\DependencyInjection\ChildDefinition;
1617
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -72,7 +73,7 @@ public function process(ContainerBuilder $container)
7273
}
7374
$i = 0;
7475
foreach ($attributes as $attr) {
75-
if (isset($tags[0][$attr])) {
76+
if (isset($tags[0][$attr]) && ('namespace' !== $attr || ArrayAdapter::class !== $adapter->getClass())) {
7677
$pool->replaceArgument($i++, $tags[0][$attr]);
7778
}
7879
unset($tags[0][$attr]);

Tests/DependencyInjection/Compiler/CachePoolPassTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass;
16+
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1617
use Symfony\Component\DependencyInjection\ChildDefinition;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
1819
use Symfony\Component\DependencyInjection\Definition;
@@ -49,6 +50,24 @@ public function testNamespaceArgumentIsReplaced()
4950
$this->assertSame('D07rhFx97S', $cachePool->getArgument(0));
5051
}
5152

53+
public function testNamespaceArgumentIsNotReplacedIfArrayAdapterIsUsed()
54+
{
55+
$container = new ContainerBuilder();
56+
$container->setParameter('kernel.environment', 'prod');
57+
$container->setParameter('kernel.name', 'app');
58+
$container->setParameter('kernel.root_dir', 'foo');
59+
60+
$container->register('cache.adapter.array', ArrayAdapter::class)->addArgument(0);
61+
62+
$cachePool = new ChildDefinition('cache.adapter.array');
63+
$cachePool->addTag('cache.pool');
64+
$container->setDefinition('app.cache_pool', $cachePool);
65+
66+
$this->cachePoolPass->process($container);
67+
68+
$this->assertCount(0, $container->getDefinition('app.cache_pool')->getArguments());
69+
}
70+
5271
public function testArgsAreReplaced()
5372
{
5473
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)