From be2a2f2877b762553884810f5afde9d3dfb19be9 Mon Sep 17 00:00:00 2001 From: eraseyourknees <112027564+eraseyourknees@users.noreply.github.com> Date: Mon, 29 Aug 2022 03:36:33 +0200 Subject: [PATCH] A little cleanup of the caching class --- shared/cache.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shared/cache.php b/shared/cache.php index 59e13cc..dcb9797 100644 --- a/shared/cache.php +++ b/shared/cache.php @@ -17,15 +17,13 @@ limitations under the License. class UupDumpCache { private $cacheFile; - private $isCompressed; private $newCacheVersion = 1; - public function __construct($resource, $compressed = true) { + public function __construct($resource, private $isCompressed = true) { $res = $resource."+cache_v".$this->newCacheVersion; $cacheHash = hash('sha256', strtolower($res)); - $ext = $compressed ? '.json.gz' : '.json'; + $ext = $isCompressed ? '.json.gz' : '.json'; $this->cacheFile = 'cache/'.$cacheHash.$ext; - $this->isCompressed = $compressed; } public function getFileName() {