$v) { foreach ($v->remote_nodes as $rn) { $node = intval($rn->node); if (isIgnored($node)) continue; // Capture previous keyed values $keyedNow = $rn->keyed === "yes"; $keyedBefore = isset($keyed[$node]); // Set current key state. In PHP null !== isset $keyed[$node] = $keyedNow ?: null; if ($keyedBefore !== $keyedNow) { // Permanently set to Allstar for now // $nodePrefix = isIrlp($node) ? 'stn' : 'rpt'; $nodePrefix = 'rpt'; $keyedLabel = $keyedNow ? "KEY" : "UNKEY"; $time = Carbon::now(); $timeFormatted = $time->format("M d h:i:s"); // echo "{$node},{$keyedLabel},{$time}\n"; echo "{$timeFormatted} $nodePrefix{$node} {$keyedLabel} tx\n"; } } } } /** * @param $node * @return bool */ function isIgnored($node){ global $ignore; return in_array($node, $ignore); } /** * @return string */ function getAllMonUri() { global $hubs; $hubsStr = implode(",", $hubs); // return "https://allmon.winsystem.org/server.php?nodes=2353"; // return __DIR__ . '/test.stream'; return "https://allmon.winsystem.org/server.php?nodes=" . $hubsStr; }