diff options
author | Michael Weimann <mail@michael-weimann.eu> | 2018-07-01 21:56:27 +0300 |
---|---|---|
committer | Michael Weimann <mail@michael-weimann.eu> | 2018-07-01 21:56:27 +0300 |
commit | 9bd48e7c0df3ad0e404f524fa0100697e2bdb84e (patch) | |
tree | 07a8c774a737a32a8865665b69b940ae36099d8c /core | |
parent | 03a5856541d6b760ab9aaeaf5a30bb40a3c66b70 (diff) |
Adds an info if the maintenance mode is already enabled/disabled.
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/Maintenance/Mode.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/Command/Maintenance/Mode.php b/core/Command/Maintenance/Mode.php index 30d72da3583..db4c9dc8c0b 100644 --- a/core/Command/Maintenance/Mode.php +++ b/core/Command/Maintenance/Mode.php @@ -59,14 +59,23 @@ class Mode extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { + $maintenanceMode = $this->config->getSystemValue('maintenance', false); if ($input->getOption('on')) { - $this->config->setSystemValue('maintenance', true); - $output->writeln('Maintenance mode enabled'); + if ($maintenanceMode === false) { + $this->config->setSystemValue('maintenance', true); + $output->writeln('Maintenance mode enabled'); + } else { + $output->writeln('Maintenance mode already enabled'); + } } elseif ($input->getOption('off')) { - $this->config->setSystemValue('maintenance', false); - $output->writeln('Maintenance mode disabled'); + if ($maintenanceMode === true) { + $this->config->setSystemValue('maintenance', false); + $output->writeln('Maintenance mode disabled'); + } else { + $output->writeln('Maintenance mode already disabled'); + } } else { - if ($this->config->getSystemValue('maintenance', false)) { + if ($maintenanceMode) { $output->writeln('Maintenance mode is currently enabled'); } else { $output->writeln('Maintenance mode is currently disabled'); |