diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-11-19 00:25:26 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-11-20 15:03:16 +0100 |
commit | 8ae8eb47349f2510976637c6a1e8fa91e8d9f8d3 (patch) | |
tree | 510f7823369a233e5b8eef4b65168b5cd14f08a3 /core/command/maintenance | |
parent | cbb9caf03083cc083491e292143ee53871920106 (diff) | |
download | nextcloud-server-8ae8eb47349f2510976637c6a1e8fa91e8d9f8d3.tar.gz nextcloud-server-8ae8eb47349f2510976637c6a1e8fa91e8d9f8d3.zip |
drop dependency of some commands on old config object
Diffstat (limited to 'core/command/maintenance')
-rw-r--r-- | core/command/maintenance/mode.php | 11 | ||||
-rw-r--r-- | core/command/maintenance/repair.php | 12 |
2 files changed, 13 insertions, 10 deletions
diff --git a/core/command/maintenance/mode.php b/core/command/maintenance/mode.php index f26a11384a8..f48a9d012c4 100644 --- a/core/command/maintenance/mode.php +++ b/core/command/maintenance/mode.php @@ -9,7 +9,7 @@ namespace OC\Core\Command\Maintenance; -use OC\Config; +use \OCP\IConfig; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -18,9 +18,10 @@ use Symfony\Component\Console\Output\OutputInterface; class Mode extends Command { + /** @var IConfig */ protected $config; - public function __construct(Config $config) { + public function __construct(IConfig $config) { $this->config = $config; parent::__construct(); } @@ -45,13 +46,13 @@ class Mode extends Command { protected function execute(InputInterface $input, OutputInterface $output) { if ($input->getOption('on')) { - $this->config->setValue('maintenance', true); + $this->config->setSystemValue('maintenance', true); $output->writeln('Maintenance mode enabled'); } elseif ($input->getOption('off')) { - $this->config->setValue('maintenance', false); + $this->config->setSystemValue('maintenance', false); $output->writeln('Maintenance mode disabled'); } else { - if ($this->config->getValue('maintenance', false)) { + if ($this->config->getSystemValue('maintenance', false)) { $output->writeln('Maintenance mode is currently enabled'); } else { $output->writeln('Maintenance mode is currently disabled'); diff --git a/core/command/maintenance/repair.php b/core/command/maintenance/repair.php index 7c0cf71d3b6..bf94b2647ce 100644 --- a/core/command/maintenance/repair.php +++ b/core/command/maintenance/repair.php @@ -17,12 +17,14 @@ class Repair extends Command { * @var \OC\Repair $repair */ protected $repair; + /** @var \OCP\IConfig */ + protected $config; /** * @param \OC\Repair $repair - * @param \OC\Config $config + * @param \OCP\IConfig $config */ - public function __construct(\OC\Repair $repair, \OC\Config $config) { + public function __construct(\OC\Repair $repair, \OCP\IConfig $config) { $this->repair = $repair; $this->config = $config; parent::__construct(); @@ -35,8 +37,8 @@ class Repair extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $maintenanceMode = $this->config->getValue('maintenance', false); - $this->config->setValue('maintenance', true); + $maintenanceMode = $this->config->getSystemValue('maintenance', false); + $this->config->setSystemValue('maintenance', true); $this->repair->listen('\OC\Repair', 'step', function ($description) use ($output) { $output->writeln(' - ' . $description); @@ -50,6 +52,6 @@ class Repair extends Command { $this->repair->run(); - $this->config->setValue('maintenance', $maintenanceMode); + $this->config->setSystemValue('maintenance', $maintenanceMode); } } |