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:
parent
3aa1852694
commit
23994df00c
|
@ -1,7 +1,9 @@
|
||||||
config/config.php
|
config/config.php
|
||||||
prototypes/
|
prototypes/
|
||||||
admin/
|
admin/
|
||||||
cache/localhost
|
|
||||||
|
cache/
|
||||||
|
!/cache/.htaccess
|
||||||
|
|
||||||
# PhpStorm
|
# PhpStorm
|
||||||
.idea/
|
.idea/
|
||||||
|
|
|
@ -11,7 +11,7 @@ date_default_timezone_set($config["general"]["timezone"]);
|
||||||
$cacheutils = new CacheUtils('serverstatus');
|
$cacheutils = new CacheUtils('serverstatus');
|
||||||
|
|
||||||
if($cacheutils->isExpired()) {
|
if($cacheutils->isExpired()) {
|
||||||
$cacheutils->setValue(getResult(), 10);
|
$cacheutils->setValue(getResult(), 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
die ($cacheutils->getValue());
|
die ($cacheutils->getValue());
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . "/../lib/phpfastcache/src/autoload.php";
|
require_once __DIR__ . "/../lib/phpfastcache/src/autoload.php";
|
||||||
|
require_once __DIR__ . "/../config/config.php";
|
||||||
|
|
||||||
use phpFastCache\CacheManager;
|
use phpFastCache\CacheManager;
|
||||||
use phpFastCache\Util\Languages;
|
use phpFastCache\Util\Languages;
|
||||||
|
@ -11,10 +12,14 @@ class CacheUtils {
|
||||||
private $key;
|
private $key;
|
||||||
|
|
||||||
function __construct($key) {
|
function __construct($key) {
|
||||||
|
|
||||||
if(!is_string($key))
|
if(!is_string($key))
|
||||||
throw new InvalidArgumentException("Key must be a string");
|
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']);
|
$this->cacheInstance = CacheManager::getInstance('Files', ["path" => __DIR__ . '/../cache']);
|
||||||
Languages::setEncoding();
|
Languages::setEncoding();
|
||||||
$this->cacheItem = $this->cacheInstance->getItem($key);
|
$this->cacheItem = $this->cacheInstance->getItem($key);
|
||||||
|
@ -46,4 +51,4 @@ class CacheUtils {
|
||||||
$this->cacheInstance->deleteItem($this->key);
|
$this->cacheInstance->deleteItem($this->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,7 +12,7 @@
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
<li> <!-- Please respect the amount of work we've put for free into this project and leave the authors in the footer. Thank you. -->
|
<li> <!-- Please respect the amount of work we've put for free into this project and leave the authors in the footer. Thank you. -->
|
||||||
<p>
|
<p>
|
||||||
<a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.4.1 — © <a href="https://wruczek.tech">Wruczek</a> 2016 - 2017
|
<a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.4.2 — © <a href="https://wruczek.tech">Wruczek</a> 2016 - 2017
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -8,7 +8,7 @@ require_once __DIR__ . "/../include/adminlist.php";
|
||||||
$htalink = $config["general"]["enablehta"] ? "" : ".php";
|
$htalink = $config["general"]["enablehta"] ? "" : ".php";
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="pl">
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
|
@ -89,7 +89,7 @@ function showError($title, $text) { ?>
|
||||||
<?php echo $text; ?>
|
<?php echo $text; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
© <a href="https://wruczek.tech">Wruczek</a> 2016 - 2017 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.4.1 | MIT License
|
© <a href="https://wruczek.tech">Wruczek</a> 2016 - 2017 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.4.2 | MIT License
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue