small improvement updatemanager
This commit is contained in:
parent
3a214b07ae
commit
2283da2365
@ -6,6 +6,7 @@ use ManiaControl\Admin\AuthenticationManager;
|
|||||||
use ManiaControl\Callbacks\CallbackListener;
|
use ManiaControl\Callbacks\CallbackListener;
|
||||||
use ManiaControl\Callbacks\TimerListener;
|
use ManiaControl\Callbacks\TimerListener;
|
||||||
use ManiaControl\Commands\CommandListener;
|
use ManiaControl\Commands\CommandListener;
|
||||||
|
use ManiaControl\Files\FileUtil;
|
||||||
use ManiaControl\Players\Player;
|
use ManiaControl\Players\Player;
|
||||||
use ManiaControl\Players\PlayerManager;
|
use ManiaControl\Players\PlayerManager;
|
||||||
use ManiaControl\Plugins\Plugin;
|
use ManiaControl\Plugins\Plugin;
|
||||||
@ -232,7 +233,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
|||||||
/** @var Plugin $pluginClass */
|
/** @var Plugin $pluginClass */
|
||||||
$pluginId = $pluginClass::getId();
|
$pluginId = $pluginClass::getId();
|
||||||
$url = self::URL_WEBSERVICE . 'plugins?id=' . $pluginId;
|
$url = self::URL_WEBSERVICE . 'plugins?id=' . $pluginId;
|
||||||
$dataJson = file_get_contents($url);
|
$dataJson = FileUtil::loadFile($url);
|
||||||
$pluginVersions = json_decode($dataJson);
|
$pluginVersions = json_decode($dataJson);
|
||||||
if (!$pluginVersions || !isset($pluginVersions[0])) {
|
if (!$pluginVersions || !isset($pluginVersions[0])) {
|
||||||
return false;
|
return false;
|
||||||
@ -253,7 +254,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
|||||||
private function checkCoreUpdate($ignoreVersion = false) {
|
private function checkCoreUpdate($ignoreVersion = false) {
|
||||||
$updateChannel = $this->getCurrentUpdateChannelSetting();
|
$updateChannel = $this->getCurrentUpdateChannelSetting();
|
||||||
$url = self::URL_WEBSERVICE . 'versions?update=1¤t=1&channel=' . $updateChannel;
|
$url = self::URL_WEBSERVICE . 'versions?update=1¤t=1&channel=' . $updateChannel;
|
||||||
$dataJson = file_get_contents($url);
|
$dataJson = FileUtil::loadFile($url);
|
||||||
$versions = json_decode($dataJson);
|
$versions = json_decode($dataJson);
|
||||||
if (!$versions || !isset($versions[0])) {
|
if (!$versions || !isset($versions[0])) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user