diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-12 17:08:54 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-08-01 09:46:40 +0200 |
commit | 458c2fa2971e6595a18a289b0afeb4a79ea0e0d3 (patch) | |
tree | c0bebce50e7d6956045df53f1e51dc44b0ab6c9e /lib/private/Console | |
parent | 952acd4d276b3190d23e0597c5e01b1dfc4d72bc (diff) | |
download | nextcloud-server-458c2fa2971e6595a18a289b0afeb4a79ea0e0d3.tar.gz nextcloud-server-458c2fa2971e6595a18a289b0afeb4a79ea0e0d3.zip |
Remove OCP\App and OCP\BackgroundJob
Both deprecated since NC 23
IAppManager is the replacement for OCP\App unfortunately it can't be
dependency injected in classes used by the installed otherwise the
database connection is initialised too early
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/Console')
-rw-r--r-- | lib/private/Console/Application.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Console/Application.php b/lib/private/Console/Application.php index 12d54b48fa9..fc48f57e499 100644 --- a/lib/private/Console/Application.php +++ b/lib/private/Console/Application.php @@ -34,6 +34,7 @@ use OC\MemoryInfo; use OC\NeedsUpdateException; use OC_App; use OCP\AppFramework\QueryException; +use OCP\App\IAppManager; use OCP\Console\ConsoleEvent; use OCP\IConfig; use OCP\IRequest; @@ -117,13 +118,14 @@ class Application { $this->writeMaintenanceModeInfo($input, $output); } else { OC_App::loadApps(); - foreach (\OC::$server->getAppManager()->getInstalledApps() as $app) { + $appManager = \OCP\Server::get(IAppManager::class); + foreach ($appManager->getInstalledApps() as $app) { $appPath = \OC_App::getAppPath($app); if ($appPath === false) { continue; } // load commands using info.xml - $info = \OC_App::getAppInfo($app); + $info = $appManager->getAppInfo($app); if (isset($info['commands'])) { $this->loadCommandsFromInfoXml($info['commands']); } |