A little cleanup of the caching class

This commit is contained in:
eraseyourknees 2022-08-29 03:36:33 +02:00
parent 067f7f2937
commit be2a2f2877

View File

@ -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() {