mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Extract ServerConfigGroup from Server
this API isn't very nice, but it's pretty much the same as the original, and at least this can be _kinda_ unit-tested...
This commit is contained in:
@ -57,7 +57,7 @@ class AutoUpdater{
|
||||
$this->logger = new \PrefixedLogger($server->getLogger(), "Auto Updater");
|
||||
$this->endpoint = "http://$endpoint/api/";
|
||||
|
||||
if((bool) $server->getProperty("auto-updater.enabled", true)){
|
||||
if((bool) $server->getConfigGroup()->getProperty("auto-updater.enabled", true)){
|
||||
$this->doCheck();
|
||||
}
|
||||
}
|
||||
@ -77,7 +77,7 @@ class AutoUpdater{
|
||||
$this->checkUpdate();
|
||||
if($this->hasUpdate()){
|
||||
(new UpdateNotifyEvent($this))->call();
|
||||
if((bool) $this->server->getProperty("auto-updater.on-update.warn-console", true)){
|
||||
if((bool) $this->server->getConfigGroup()->getProperty("auto-updater.on-update.warn-console", true)){
|
||||
$this->showConsoleUpdate();
|
||||
}
|
||||
}else{
|
||||
@ -187,7 +187,7 @@ class AutoUpdater{
|
||||
* Returns the channel used for update checking (stable, beta, dev)
|
||||
*/
|
||||
public function getChannel() : string{
|
||||
$channel = strtolower($this->server->getProperty("auto-updater.preferred-channel", "stable"));
|
||||
$channel = strtolower($this->server->getConfigGroup()->getProperty("auto-updater.preferred-channel", "stable"));
|
||||
if($channel !== "stable" and $channel !== "beta" and $channel !== "alpha" and $channel !== "development"){
|
||||
$channel = "stable";
|
||||
}
|
||||
|
Reference in New Issue
Block a user