- 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:
Wruczek
2017-03-30 00:57:06 +02:00
parent 3aa1852694
commit 23994df00c
7 changed files with 14 additions and 7 deletions

View File

@@ -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);
}
}
}