From a348a6f4507e28e6c5093669e17e10c42941007f Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Mon, 22 Sep 2014 12:04:48 +0200 Subject: no loner use deprecated class \OC_Config --- core/command/upgrade.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'core/command/upgrade.php') diff --git a/core/command/upgrade.php b/core/command/upgrade.php index c626f24bcc3..5b9432d631b 100644 --- a/core/command/upgrade.php +++ b/core/command/upgrade.php @@ -9,6 +9,7 @@ namespace OC\Core\Command; use OC\Updater; +use OCP\IConfig; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -24,6 +25,18 @@ class Upgrade extends Command { public $upgradeFailed = false; + /** + * @var IConfig + */ + private $config; + + /** + * @param IConfig $config + */ + public function __construct(IConfig $config) { + $this->config = $config; + } + protected function configure() { $this ->setName('upgrade') @@ -106,7 +119,7 @@ class Upgrade extends Command { $this->postUpgradeCheck($input, $output); return self::ERROR_SUCCESS; - } else if(\OC_Config::getValue('maintenance', false)) { + } else if($this->config->getSystemValue('maintenance', false)) { //Possible scenario: ownCloud core is updated but an app failed $output->writeln('ownCloud is in maintenance mode'); $output->write('Maybe an upgrade is already in process. Please check the ' @@ -128,7 +141,7 @@ class Upgrade extends Command { * @param OutputInterface $output output interface */ protected function postUpgradeCheck(InputInterface $input, OutputInterface $output) { - $trustedDomains = \OC_Config::getValue('trusted_domains', array()); + $trustedDomains = $this->config->getSystemValue('trusted_domains', array()); if (empty($trustedDomains)) { $output->write( 'The setting "trusted_domains" could not be ' . -- cgit v1.2.3