diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-01-29 15:12:53 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-01-29 15:28:00 +0100 |
commit | ccc66e912b171ba7bb4e5b4478508a22202eb356 (patch) | |
tree | 539163d9701116dd1b40df25021392fca554c950 /core | |
parent | c1e5ebaed578b655ea5a54ea848b19ad5147815a (diff) | |
download | nextcloud-server-ccc66e912b171ba7bb4e5b4478508a22202eb356.tar.gz nextcloud-server-ccc66e912b171ba7bb4e5b4478508a22202eb356.zip |
fix: Use DI for Setup class and move away from deprecated methods
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/Maintenance/Install.php | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php index f5d53c96234..4401921dacb 100644 --- a/core/Command/Maintenance/Install.php +++ b/core/Command/Maintenance/Install.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -33,12 +36,9 @@ namespace OC\Core\Command\Maintenance; use bantu\IniGetWrapper\IniGetWrapper; use InvalidArgumentException; use OC\Console\TimestampFormatter; -use OC\Installer; use OC\Migration\ConsoleOutput; use OC\Setup; use OC\SystemConfig; -use OCP\Defaults; -use Psr\Log\LoggerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; @@ -56,7 +56,7 @@ class Install extends Command { parent::__construct(); } - protected function configure() { + protected function configure(): void { $this ->setName('maintenance:install') ->setDescription('install Nextcloud') @@ -76,15 +76,7 @@ class Install extends Command { protected function execute(InputInterface $input, OutputInterface $output): int { // validate the environment $server = \OC::$server; - $setupHelper = new Setup( - $this->config, - $this->iniGetWrapper, - $server->getL10N('lib'), - $server->query(Defaults::class), - $server->get(LoggerInterface::class), - $server->getSecureRandom(), - \OC::$server->query(Installer::class) - ); + $setupHelper = \OCP\Server::get(\OC\Setup::class); $sysInfo = $setupHelper->getSystemInfo(true); $errors = $sysInfo['errors']; if (count($errors) > 0) { |