public function __construct(Server $server, $endpoint)
{
$this->server = $server;
$this->endpoint = "http://{$endpoint}/api/";
if ($server->getProperty("auto-updater.enabled", true)) {
$this->check();
if ($this->hasUpdate()) {
if ($this->server->getProperty("auto-updater.on-update.warn-console", true)) {
$this->showConsoleUpdate();
}
} elseif ($this->server->getProperty("auto-updater.preferred-channel", true)) {
$version = new VersionString();
if (!$version->isDev() and $this->getChannel() !== "stable") {
$this->showChannelSuggestionStable();
} elseif ($version->isDev() and $this->getChannel() === "stable") {
$this->showChannelSuggestionBeta();
}
}
}
}