diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-12 16:38:35 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-13 10:08:44 +0200 |
commit | 76f2bc0bfc86a9d1ed34d37c574c7e7a327c0fab (patch) | |
tree | 74bb396c0324eca612b1cec1ec2f0c20a77fb942 /core | |
parent | 7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc (diff) | |
download | nextcloud-server-76f2bc0bfc86a9d1ed34d37c574c7e7a327c0fab.tar.gz nextcloud-server-76f2bc0bfc86a9d1ed34d37c574c7e7a327c0fab.zip |
fix: Replace OC_App::getAllApps with a method in AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/App/Enable.php | 2 | ||||
-rw-r--r-- | core/Command/App/GetPath.php | 2 | ||||
-rw-r--r-- | core/Command/App/Update.php | 2 | ||||
-rw-r--r-- | core/Command/Db/Migrations/GenerateCommand.php | 13 | ||||
-rw-r--r-- | core/Command/Db/Migrations/GenerateMetadataCommand.php | 2 | ||||
-rw-r--r-- | core/Command/L10n/CreateJs.php | 2 |
6 files changed, 10 insertions, 13 deletions
diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php index b351a14c39e..5366230b841 100644 --- a/core/Command/App/Enable.php +++ b/core/Command/App/Enable.php @@ -145,7 +145,7 @@ class Enable extends Command implements CompletionAwareInterface { */ public function completeArgumentValues($argumentName, CompletionContext $context): array { if ($argumentName === 'app-id') { - $allApps = \OC_App::getAllApps(); + $allApps = $this->appManager->getAllAppsInAppsFolders(); return array_diff($allApps, \OC_App::getEnabledApps(true, true)); } return []; diff --git a/core/Command/App/GetPath.php b/core/Command/App/GetPath.php index 442af2f3570..3ba4ed7781b 100644 --- a/core/Command/App/GetPath.php +++ b/core/Command/App/GetPath.php @@ -63,7 +63,7 @@ class GetPath extends Base { */ public function completeArgumentValues($argumentName, CompletionContext $context): array { if ($argumentName === 'app') { - return \OC_App::getAllApps(); + return $this->appManager->getAllAppsInAppsFolders(); } return []; } diff --git a/core/Command/App/Update.php b/core/Command/App/Update.php index b4018c94b79..b2d02e222de 100644 --- a/core/Command/App/Update.php +++ b/core/Command/App/Update.php @@ -69,7 +69,7 @@ class Update extends Command { return 1; } } elseif ($input->getOption('all') || $input->getOption('showonly')) { - $apps = \OC_App::getAllApps(); + $apps = $this->manager->getAllAppsInAppsFolders(); } else { $output->writeln('<error>Please specify an app to update or "--all" to update all updatable apps"</error>'); return 1; diff --git a/core/Command/Db/Migrations/GenerateCommand.php b/core/Command/Db/Migrations/GenerateCommand.php index 62d5ad201ed..cd92dc5acd6 100644 --- a/core/Command/Db/Migrations/GenerateCommand.php +++ b/core/Command/Db/Migrations/GenerateCommand.php @@ -71,13 +71,10 @@ class {{classname}} extends SimpleMigrationStep { } '; - protected Connection $connection; - protected IAppManager $appManager; - - public function __construct(Connection $connection, IAppManager $appManager) { - $this->connection = $connection; - $this->appManager = $appManager; - + public function __construct( + protected Connection $connection, + protected IAppManager $appManager, + ) { parent::__construct(); } @@ -155,7 +152,7 @@ class {{classname}} extends SimpleMigrationStep { */ public function completeArgumentValues($argumentName, CompletionContext $context) { if ($argumentName === 'app') { - $allApps = \OC_App::getAllApps(); + $allApps = $this->appManager->getAllAppsInAppsFolders(); return array_diff($allApps, \OC_App::getEnabledApps(true, true)); } diff --git a/core/Command/Db/Migrations/GenerateMetadataCommand.php b/core/Command/Db/Migrations/GenerateMetadataCommand.php index 55a2a6aedab..ae83f92b29e 100644 --- a/core/Command/Db/Migrations/GenerateMetadataCommand.php +++ b/core/Command/Db/Migrations/GenerateMetadataCommand.php @@ -64,7 +64,7 @@ class GenerateMetadataCommand extends Command { * @throws \Exception */ private function extractMigrationMetadataFromApps(): array { - $allApps = \OC_App::getAllApps(); + $allApps = $this->appManager->getAllAppsInAppsFolders(); $metadata = []; foreach ($allApps as $appId) { // We need to load app before being able to extract Migrations diff --git a/core/Command/L10n/CreateJs.php b/core/Command/L10n/CreateJs.php index 27d537b093e..7d45fbe91f8 100644 --- a/core/Command/L10n/CreateJs.php +++ b/core/Command/L10n/CreateJs.php @@ -148,7 +148,7 @@ class CreateJs extends Command implements CompletionAwareInterface { */ public function completeArgumentValues($argumentName, CompletionContext $context) { if ($argumentName === 'app') { - return \OC_App::getAllApps(); + return $this->appManager->getAllAppsInAppsFolders(); } elseif ($argumentName === 'lang') { $appName = $context->getWordAtIndex($context->getWordIndex() - 1); try { |