Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 02a6f24

Browse filesBrowse files
[Cache] fix versioning with SimpleCacheAdapter
1 parent cfc8ac0 commit 02a6f24
Copy full SHA for 02a6f24

File tree

Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed

‎src/Symfony/Component/Cache/Adapter/SimpleCacheAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/SimpleCacheAdapter.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ protected function doSave(array $values, $lifetime)
7878

7979
/**
8080
* @return string the namespace separator for cache keys
81+
*
82+
* @internal
8183
*/
8284
protected static function getNsSeparator()
8385
{

‎src/Symfony/Component/Cache/Traits/AbstractTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/AbstractTrait.php
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function clear()
108108
if ($cleared = $this->versioningIsEnabled) {
109109
$namespaceVersion = substr_replace(base64_encode(pack('V', mt_rand())), static::getNsSeparator(), 5);
110110
try {
111-
$cleared = $this->doSave(['@'.$this->namespace => $namespaceVersion], 0);
111+
$cleared = $this->doSave([static::getNsSeparator().$this->namespace => $namespaceVersion], 0);
112112
} catch (\Exception $e) {
113113
$cleared = false;
114114
}
@@ -237,12 +237,12 @@ private function getId($key)
237237
if ($this->versioningIsEnabled && '' === $this->namespaceVersion) {
238238
$this->namespaceVersion = '1'.static::getNsSeparator();
239239
try {
240-
foreach ($this->doFetch(['@'.$this->namespace]) as $v) {
240+
foreach ($this->doFetch([static::getNsSeparator().$this->namespace]) as $v) {
241241
$this->namespaceVersion = $v;
242242
}
243243
if ('1'.static::getNsSeparator() === $this->namespaceVersion) {
244244
$this->namespaceVersion = substr_replace(base64_encode(pack('V', time())), static::getNsSeparator(), 5);
245-
$this->doSave(['@'.$this->namespace => $this->namespaceVersion], 0);
245+
$this->doSave([static::getNsSeparator().$this->namespace => $this->namespaceVersion], 0);
246246
}
247247
} catch (\Exception $e) {
248248
}
@@ -268,6 +268,8 @@ public static function handleUnserializeCallback($class)
268268

269269
/**
270270
* @return string the namespace separator for cache keys
271+
*
272+
* @internal
271273
*/
272274
protected static function getNsSeparator()
273275
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.