From d5ad0ed66af360f51c5eb47ed112fdde0269875f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 24 Oct 2022 02:42:19 +0200 Subject: [PATCH] Changes: - converted many `$array['foo'] = $foo;` to a single $array = ['foo' => $foo]; statement - changed more double-quotes to single - added spaces for better readability - added missing type-hints (both parameters and returned value) if possible - added/removed empty lines for better readability - added missing documentation --- src/Database/Database.php | 11 +++++++++-- src/Model/GServer.php | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Database/Database.php b/src/Database/Database.php index a1685d4272..7e0d56e092 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -339,8 +339,8 @@ class Database return; } - $watchlist = explode(',', $this->config->get('system', 'db_log_index_watch')); - $blacklist = explode(',', $this->config->get('system', 'db_log_index_blacklist')); + $watchlist = explode(',', $this->configCache->get('system', 'db_log_index_watch')); + $blacklist = explode(',', $this->configCache->get('system', 'db_log_index_blacklist')); while ($row = $this->fetch($r)) { if ((intval($this->config->get('system', 'db_loglimit_index')) > 0)) { @@ -725,6 +725,7 @@ class Database $duration = round($duration, 3); $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); +<<<<<<< HEAD @file_put_contents( $this->config->get('system', 'db_log'), DateTimeFormat::utcNow() . "\t" . $duration . "\t" . @@ -733,6 +734,12 @@ class Database substr($this->replaceParameters($sql, $args), 0, 4000) . "\n", FILE_APPEND ); +======= + @file_put_contents($this->configCache->get('system', 'db_log'), DateTimeFormat::utcNow() . "\t" . $duration . "\t" . + basename($backtrace[1]['file']) . "\t" . + $backtrace[1]['line'] . "\t" . $backtrace[2]['function'] . "\t" . + substr($this->replaceParameters($sql, $args), 0, 4000) . "\n", FILE_APPEND); +>>>>>>> 82391ca61 (Changes:) } } return $retval; diff --git a/src/Model/GServer.php b/src/Model/GServer.php index a3f0c26077..af7722b8b7 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -781,6 +781,9 @@ class GServer $serverdata = self::fetchWeeklyUsage($url, $serverdata); } + $serverdata['next_contact'] = self::getNextUpdateDate(true, '', '', in_array($serverdata['network'], [Protocol::PHANTOM, Protocol::FEED])); + $serverdata['last_contact'] = DateTimeFormat::utcNow(); + $serverdata['failed'] = false; $serverdata['registered-users'] = $serverdata['registered-users'] ?? 0; $serverdata['next_contact'] = self::getNextUpdateDate(true, '', '', in_array($serverdata['network'], [Protocol::PHANTOM, Protocol::FEED])); $serverdata['last_contact'] = DateTimeFormat::utcNow(); -- 2.39.5