From 24319ddc7a3333afc488e36717da560debca5a6a Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 24 Apr 2019 12:09:05 +0200 Subject: [PATCH] * fix some warnings when cache is disabled on status thing --- system/status.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/system/status.php b/system/status.php index e32f9b86..1384940e 100644 --- a/system/status.php +++ b/system/status.php @@ -147,10 +147,17 @@ function updateStatus() { $status['clientVersion'] = $serverStatus->getClientVersion(); } - if($cache->enabled()) + if($cache->enabled()) { $cache->set('status', serialize($status), 120); - - foreach($status as $key => $value) { - updateDatabaseConfig('status_' . $key, $value); } -} \ No newline at end of file + + $tmpVal = null; + foreach($status as $key => $value) { + if(fetchDatabaseConfig('status_' . $key, $tmpVal)) { + updateDatabaseConfig('status_' . $key, $value); + } + else { + registerDatabaseConfig('status_' . $key, $value); + } + } +}