Skip to content

Commit 06b9225

Browse files
committed
Allow '0' cache prefix
1 parent 9b9bc39 commit 06b9225

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

system/Cache/Handlers/FileHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(Cache $config)
7171
}
7272

7373
$this->mode = $config->file['mode'] ?? 0640;
74-
$this->prefix = $config->prefix ?: '';
74+
$this->prefix = (string) $config->prefix;
7575
}
7676

7777
//--------------------------------------------------------------------

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class MemcachedHandler implements CacheInterface
5858
*/
5959
public function __construct(Cache $config)
6060
{
61-
$this->prefix = $config->prefix ?: '';
61+
$this->prefix = (string) $config->prefix;
6262

6363
if (! empty($config))
6464
{

system/Cache/Handlers/PredisHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class PredisHandler implements CacheInterface
5858
*/
5959
public function __construct(Cache $config)
6060
{
61-
$this->prefix = $config->prefix ?: '';
61+
$this->prefix = (string) $config->prefix;
6262

6363
if (isset($config->redis))
6464
{

system/Cache/Handlers/RedisHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class RedisHandler implements CacheInterface
5858
*/
5959
public function __construct(Cache $config)
6060
{
61-
$this->prefix = $config->prefix ?: '';
61+
$this->prefix = (string) $config->prefix;
6262

6363
if (! empty($config))
6464
{

system/Cache/Handlers/WincacheHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WincacheHandler implements CacheInterface
3737
*/
3838
public function __construct(Cache $config)
3939
{
40-
$this->prefix = $config->prefix ?: '';
40+
$this->prefix = (string) $config->prefix;
4141
}
4242

4343
//--------------------------------------------------------------------

user_guide_src/source/libraries/caching.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ more complex, multi-server setups.
5757
**$prefix**
5858

5959
If you have more than one application using the same cache storage, you can add a custom prefix
60-
here that is prepended to all key names.
60+
string here that is prepended to all key names.
6161

6262
**$file**
6363

0 commit comments

Comments
 (0)