diff options
Diffstat (limited to 'core/Command/Config/Import.php')
-rw-r--r-- | core/Command/Config/Import.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/Command/Config/Import.php b/core/Command/Config/Import.php index a6e57e92052..e55f127d94e 100644 --- a/core/Command/Config/Import.php +++ b/core/Command/Config/Import.php @@ -2,6 +2,7 @@ /** * @copyright Copyright (c) 2016, ownCloud, Inc. * + * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Joas Schilling <coding@schilljs.com> * @author Morris Jobke <hey@morrisjobke.de> * @@ -20,7 +21,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ - namespace OC\Core\Command\Config; use OCP\IConfig; @@ -33,7 +33,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class Import extends Command implements CompletionAwareInterface { +class Import extends Command implements CompletionAwareInterface { protected $validRootKeys = ['system', 'apps']; /** @var IConfig */ @@ -59,7 +59,7 @@ class Import extends Command implements CompletionAwareInterface { ; } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $importFile = $input->getArgument('file'); if ($importFile !== null) { $content = $this->getArrayFromFile($importFile); @@ -71,7 +71,7 @@ class Import extends Command implements CompletionAwareInterface { $configs = $this->validateFileContent($content); } catch (\UnexpectedValueException $e) { $output->writeln('<error>' . $e->getMessage(). '</error>'); - return; + return 1; } if (!empty($configs['system'])) { @@ -91,6 +91,7 @@ class Import extends Command implements CompletionAwareInterface { } $output->writeln('<info>Config successfully imported from: ' . $importFile . '</info>'); + return 0; } /** |