diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
index 84a5e3d094..c434cac057 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -1037,9 +1037,9 @@ class FrameworkExtension extends Extension
private function registerCacheConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
{
- $nonce = substr(str_replace('/', '-', base64_encode(md5(uniqid(mt_rand(), true), true))), 0, -2);
- $container->getDefinition('cache.adapter.apcu')->replaceArgument(2, $nonce);
- $container->getDefinition('cache.adapter.system')->replaceArgument(2, $nonce);
+ $version = substr(str_replace('/', '-', base64_encode(md5(uniqid(mt_rand(), true), true))), 0, -2);
+ $container->getDefinition('cache.adapter.apcu')->replaceArgument(2, $version);
+ $container->getDefinition('cache.adapter.system')->replaceArgument(2, $version);
$container->getDefinition('cache.adapter.filesystem')->replaceArgument(2, $config['directory']);
foreach (array('doctrine', 'psr6', 'redis') as $name) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml
index 931b74a58d..c438a1a66f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml
@@ -28,7 +28,7 @@
-
+
%kernel.cache_dir%/pools
@@ -38,7 +38,7 @@
-
+
diff --git a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php
index 8c753fb814..01207f54e6 100644
--- a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php
+++ b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php
@@ -68,7 +68,7 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
);
}
- public static function createSystemCache($namespace, $defaultLifetime, $nonce, $directory, LoggerInterface $logger = null)
+ public static function createSystemCache($namespace, $defaultLifetime, $version, $directory, LoggerInterface $logger = null)
{
$fs = new FilesystemAdapter($namespace, $defaultLifetime, $directory);
if (null !== $logger) {
@@ -78,7 +78,7 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
return $fs;
}
- $apcu = new ApcuAdapter($namespace, $defaultLifetime / 5, $nonce);
+ $apcu = new ApcuAdapter($namespace, $defaultLifetime / 5, $version);
if (null !== $logger) {
$apcu->setLogger($logger);
}
diff --git a/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php b/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php
index 35a4d987e3..a1c24a6350 100644
--- a/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php
+++ b/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php
@@ -24,7 +24,7 @@ class ApcuAdapter extends AbstractAdapter
return function_exists('apcu_fetch') && ini_get('apc.enabled') && !('cli' === PHP_SAPI && !ini_get('apc.enable_cli'));
}
- public function __construct($namespace = '', $defaultLifetime = 0, $nonce = null)
+ public function __construct($namespace = '', $defaultLifetime = 0, $version = null)
{
if (!static::isSupported()) {
throw new CacheException('APCu is not enabled');
@@ -34,12 +34,12 @@ class ApcuAdapter extends AbstractAdapter
}
parent::__construct($namespace, $defaultLifetime);
- if (null !== $nonce) {
- CacheItem::validateKey($nonce);
+ if (null !== $version) {
+ CacheItem::validateKey($version);
- if (!apcu_exists($nonce.':nonce'.$namespace)) {
+ if (!apcu_exists($version.':'.$namespace)) {
$this->clear($namespace);
- apcu_add($nonce.':nonce'.$namespace, null);
+ apcu_add($version.':'.$namespace, null);
}
}
}
diff --git a/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php
index 9dcbb5ba9d..1cd4269b45 100644
--- a/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php
+++ b/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php
@@ -44,7 +44,7 @@ class ApcuAdapterTest extends CachePoolTest
$this->assertFalse($item->isHit());
}
- public function testNonce()
+ public function testVersion()
{
$namespace = str_replace('\\', '.', __CLASS__);