From 30025117b5e2a3c123fccacc204c52a0951d9fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Thu, 4 Apr 2024 19:39:55 +0200 Subject: [PATCH] [11.x] Add setters to cache stores (#50912) * Add setPrefix() to ApcStore and DatabaseStore * Add setDirectory() setter to FileStore --- src/Illuminate/Cache/ApcStore.php | 11 +++++++++++ src/Illuminate/Cache/DatabaseStore.php | 11 +++++++++++ src/Illuminate/Cache/FileStore.php | 13 +++++++++++++ 3 files changed, 35 insertions(+) diff --git a/src/Illuminate/Cache/ApcStore.php b/src/Illuminate/Cache/ApcStore.php index 5779635b203b..50e4c62adcbe 100755 --- a/src/Illuminate/Cache/ApcStore.php +++ b/src/Illuminate/Cache/ApcStore.php @@ -123,4 +123,15 @@ public function getPrefix() { return $this->prefix; } + + /** + * Set the cache key prefix. + * + * @param string $prefix + * @return void + */ + public function setPrefix($prefix) + { + $this->prefix = $prefix; + } } diff --git a/src/Illuminate/Cache/DatabaseStore.php b/src/Illuminate/Cache/DatabaseStore.php index e5b72107ce96..442e6356d387 100755 --- a/src/Illuminate/Cache/DatabaseStore.php +++ b/src/Illuminate/Cache/DatabaseStore.php @@ -387,6 +387,17 @@ public function getPrefix() return $this->prefix; } + /** + * Set the cache key prefix. + * + * @param string $prefix + * @return void + */ + public function setPrefix($prefix) + { + $this->prefix = $prefix; + } + /** * Serialize the given value. * diff --git a/src/Illuminate/Cache/FileStore.php b/src/Illuminate/Cache/FileStore.php index 9d5e2e95c872..5e3fba081caa 100755 --- a/src/Illuminate/Cache/FileStore.php +++ b/src/Illuminate/Cache/FileStore.php @@ -380,6 +380,19 @@ public function getDirectory() return $this->directory; } + /** + * Set the working directory of the cache. + * + * @param string $directory + * @return $this + */ + public function setDirectory($directory) + { + $this->directory = $directory; + + return $this; + } + /** * Set the cache directory where locks should be stored. *