- 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

4
.gitignore vendored
View File

@ -1,7 +1,9 @@
config/config.php config/config.php
prototypes/ prototypes/
admin/ admin/
cache/localhost
cache/
!/cache/.htaccess
# PhpStorm # PhpStorm
.idea/ .idea/

View File

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

0
cache/.gitkeep vendored
View File

View File

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

View File

@ -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 &mdash; &copy; <a href="https://wruczek.tech">Wruczek</a> 2016 - 2017 <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.4.2 &mdash; &copy; <a href="https://wruczek.tech">Wruczek</a> 2016 - 2017
</p> </p>
<p> <p>

View File

@ -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">

View File

@ -89,7 +89,7 @@ function showError($title, $text) { ?>
<?php echo $text; ?> <?php echo $text; ?>
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
&copy; <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 &copy; <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>