v 1.4.2
- Extended status cache time from 10 to 60 seconds. Query should be less spammy now. - Fixed "It is not safe to rely on the system's timezone settings" exception - Removed lang property from html tag
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
require_once __DIR__ . "/../lib/phpfastcache/src/autoload.php";
|
||||
require_once __DIR__ . "/../config/config.php";
|
||||
|
||||
use phpFastCache\CacheManager;
|
||||
use phpFastCache\Util\Languages;
|
||||
@@ -11,10 +12,14 @@ class CacheUtils {
|
||||
private $key;
|
||||
|
||||
function __construct($key) {
|
||||
|
||||
if(!is_string($key))
|
||||
throw new InvalidArgumentException("Key must be a string");
|
||||
|
||||
global $config;
|
||||
if(isset($config["general"]["timezone"])) {
|
||||
date_default_timezone_set($config["general"]["timezone"]);
|
||||
}
|
||||
|
||||
$this->cacheInstance = CacheManager::getInstance('Files', ["path" => __DIR__ . '/../cache']);
|
||||
Languages::setEncoding();
|
||||
$this->cacheItem = $this->cacheInstance->getItem($key);
|
||||
@@ -46,4 +51,4 @@ class CacheUtils {
|
||||
$this->cacheInstance->deleteItem($this->key);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user