- /**
- * Fetch server list from remote servers and adds them when they are new.
- *
- * @param string $poco URL to the POCO endpoint
- */
- private static function fetchServerlist($poco)
- {
- $curlResult = DI::httpRequest()->get($poco . '/@server');
- if (!$curlResult->isSuccess()) {
- Logger::info('Server is not reachable or does not offer the "poco" endpoint', ['poco' => $poco]);
- return;
- }
-
- $serverlist = json_decode($curlResult->getBody(), true);
- if (!is_array($serverlist)) {
- Logger::info('Server does not have any servers listed', ['poco' => $poco]);
- return;
- }
-
- Logger::info('PoCo Server update start', ['poco' => $poco]);
-
- $total = 0;
- $added = 0;
- foreach ($serverlist as $server) {