diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-03-06 12:17:13 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-22 12:15:07 +0200 |
commit | 8c5f32320a3ceeb9aac86bb2340d0919adf37993 (patch) | |
tree | 4df71a1e7cc6aaeee4f9b4e159646c378e97bac1 /console.php | |
parent | 644036ab4e3d1d6f175a485ed7ae4883c668ff48 (diff) | |
download | nextcloud-server-8c5f32320a3ceeb9aac86bb2340d0919adf37993.tar.gz nextcloud-server-8c5f32320a3ceeb9aac86bb2340d0919adf37993.zip |
fix: use DI to build main Application class in console.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'console.php')
-rw-r--r-- | console.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/console.php b/console.php index afa8b1b6be1..6bfbf964d94 100644 --- a/console.php +++ b/console.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -57,7 +60,7 @@ try { exit(1); } - $config = \OC::$server->getConfig(); + $config = \OCP\Server::get(\OCP\IConfig::class); set_exception_handler('exceptionHandler'); if (!function_exists('posix_getuid')) { @@ -102,14 +105,7 @@ try { echo "Additionally the function 'pcntl_signal' and 'pcntl_signal_dispatch' need to be enabled in your php.ini." . PHP_EOL; } - $application = new Application( - $config, - \OC::$server->get(\OCP\EventDispatcher\IEventDispatcher::class), - \OC::$server->getRequest(), - \OC::$server->get(\Psr\Log\LoggerInterface::class), - \OC::$server->query(\OC\MemoryInfo::class), - \OCP\Server::get(\OCP\App\IAppManager::class), - ); + $application = \OCP\Server::get(Application::class); $application->loadCommands(new ArgvInput(), new ConsoleOutput()); $application->run(); } catch (Exception $ex) { |