From 53ff6b35cd1327aa804261244240e374a3bb403f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sun, 18 May 2014 21:46:10 +0200 Subject: [PATCH] changed update channel setting to SET --- application/core/Update/UpdateManager.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/application/core/Update/UpdateManager.php b/application/core/Update/UpdateManager.php index fa465e36..c965e629 100644 --- a/application/core/Update/UpdateManager.php +++ b/application/core/Update/UpdateManager.php @@ -61,7 +61,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener $this->maniaControl->settingManager->initSetting($this, self::SETTING_ENABLEUPDATECHECK, true); $this->maniaControl->settingManager->initSetting($this, self::SETTING_AUTO_UPDATE, true); $this->maniaControl->settingManager->initSetting($this, self::SETTING_UPDATECHECK_INTERVAL, 1); - $this->maniaControl->settingManager->initSetting($this, self::SETTING_UPDATECHECK_CHANNEL, self::CHANNEL_BETA); + $this->maniaControl->settingManager->initSetting($this, self::SETTING_UPDATECHECK_CHANNEL, $this->getUpdateChannels()); $this->maniaControl->settingManager->initSetting($this, self::SETTING_PERFORM_BACKUPS, true); // Register for callbacks @@ -82,6 +82,16 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener $this->pluginUpdateManager = new PluginUpdateManager($maniaControl); } + /** + * Get the possible Update Channels + * + * @return array + */ + public function getUpdateChannels() { + // TODO: change default channel on release + return array(self::CHANNEL_BETA, self::CHANNEL_RELEASE, self::CHANNEL_NIGHTLY); + } + /** * Perform Hourly Update Check * @@ -140,7 +150,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener public function getCurrentUpdateChannelSetting() { $updateChannel = $this->maniaControl->settingManager->getSettingValue($this, self::SETTING_UPDATECHECK_CHANNEL); $updateChannel = strtolower($updateChannel); - if (!in_array($updateChannel, array(self::CHANNEL_RELEASE, self::CHANNEL_BETA, self::CHANNEL_NIGHTLY))) { + if (!in_array($updateChannel, $this->getUpdateChannels())) { $updateChannel = self::CHANNEL_RELEASE; } return $updateChannel;