Small fixes

This commit is contained in:
Wruczek 2019-04-22 17:40:39 +02:00
parent ad2296e74e
commit 2d6c91f809
3 changed files with 30 additions and 9 deletions

View File

@ -1,15 +1,12 @@
<?php <?php
use Latte\Runtime\Html; use Latte\Runtime\Html;
use Wruczek\PhpFileCache\PhpFileCache;
use Wruczek\TSWebsite\CacheManager; use Wruczek\TSWebsite\CacheManager;
use Wruczek\TSWebsite\Utils\TemplateUtils; use Wruczek\TSWebsite\Utils\TemplateUtils;
use Wruczek\TSWebsite\Utils\Utils; use Wruczek\TSWebsite\Utils\Utils;
require_once __DIR__ . "/private/php/load.php"; require_once __DIR__ . "/private/php/load.php";
$cache = new PhpFileCache(__CACHE_DIR, "banspage");
$banlist = CacheManager::i()->getBanList(); $banlist = CacheManager::i()->getBanList();
$data = null; $data = null;
$ipbanned = false; $ipbanned = false;

View File

@ -89,10 +89,10 @@ body {
/* Reimplement the btn-xs that was removed in Bootstrap 4 */ /* Reimplement the btn-xs that was removed in Bootstrap 4 */
/* https://github.com/twbs/bootstrap/issues/21881#issuecomment-341972830 */ /* https://github.com/twbs/bootstrap/issues/21881#issuecomment-341972830 */
.btn-group-xs > .btn, .btn-xs { .btn-group-xs > .btn, .btn-xs {
padding : .25rem .4rem; padding: .25rem .4rem;
font-size : .875rem; font-size: .875rem;
line-height : .5; line-height: .5;
border-radius : .2rem; border-radius: .2rem;
} }
/* ACCORDION */ /* ACCORDION */

View File

@ -18,7 +18,7 @@ class CacheManager {
private $serverGroupList; private $serverGroupList;
private $channelGroupList; private $channelGroupList;
public function __construct() { private function __construct() {
$this->cache = new PhpFileCache(__CACHE_DIR, "cachemanager"); $this->cache = new PhpFileCache(__CACHE_DIR, "cachemanager");
} }
@ -53,6 +53,10 @@ class CacheManager {
}, Config::get("cache_serverinfo"), $meta); }, Config::get("cache_serverinfo"), $meta);
} }
public function clearServerInfo() {
$this->cache->eraseKey("serverinfo");
}
public function getBanList($meta = false) { public function getBanList($meta = false) {
if ($this->banList) { if ($this->banList) {
return $this->banList; return $this->banList;
@ -74,6 +78,10 @@ class CacheManager {
}, Config::get("cache_banlist"), $meta); }, Config::get("cache_banlist"), $meta);
} }
public function clearBanList() {
$this->cache->eraseKey("banlist");
}
public function getClientList($meta = false) { public function getClientList($meta = false) {
if ($this->clientList) { if ($this->clientList) {
return $this->clientList; return $this->clientList;
@ -91,6 +99,10 @@ class CacheManager {
}, Config::get("cache_clientlist"), $meta); // Lower cache time because of login system }, Config::get("cache_clientlist"), $meta); // Lower cache time because of login system
} }
public function clearClientList() {
$this->cache->eraseKey("clientlist");
}
public function getClient($cldbid) { public function getClient($cldbid) {
$clients = $this->getClientList(); $clients = $this->getClientList();
@ -124,6 +136,10 @@ class CacheManager {
}, Config::get("cache_channelist"), $meta); }, Config::get("cache_channelist"), $meta);
} }
public function clearChannelList() {
$this->cache->eraseKey("channellist");
}
public function getServerGroupList($meta = false) { public function getServerGroupList($meta = false) {
if ($this->serverGroupList) { if ($this->serverGroupList) {
return $this->serverGroupList; return $this->serverGroupList;
@ -141,6 +157,10 @@ class CacheManager {
}, Config::get("cache_servergroups"), $meta); }, Config::get("cache_servergroups"), $meta);
} }
public function clearServerGroupList() {
$this->cache->eraseKey("servergrouplist");
}
public function getChannelGroupList($meta = false) { public function getChannelGroupList($meta = false) {
if ($this->channelGroupList) { if ($this->channelGroupList) {
return $this->channelGroupList; return $this->channelGroupList;
@ -157,4 +177,8 @@ class CacheManager {
return null; return null;
}, Config::get("cache_channelgroups"), $meta); }, Config::get("cache_channelgroups"), $meta);
} }
public function clearChannelGroupList() {
$this->cache->eraseKey("channelgrouplist");
}
} }