diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-03-25 16:18:51 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-03-25 16:20:21 +0100 |
commit | c7037d7b38d794ad49c93cbc1dfb8721898bd191 (patch) | |
tree | 8ccfb151eb0a6d6b52a42f20ae0ebcbcbc75864f /lib/private/legacy | |
parent | 1ae3e8e77dfe6b70c76d430ad06bb49bd8d0e069 (diff) | |
download | nextcloud-server-c7037d7b38d794ad49c93cbc1dfb8721898bd191.tar.gz nextcloud-server-c7037d7b38d794ad49c93cbc1dfb8721898bd191.zip |
fix: Move getAppInstalledVersions to AppConfig so that it can be used earlierfix/add-getappversions-replacement
Call it from OC_App to make sure there is only one request to DB.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_App.php | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 8f3284b0955..ecceafa65b3 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -642,17 +642,10 @@ class OC_App { /** * get the installed version of all apps - * @deprecated 32.0.0 Use IAppManager::getAppInstalledVersions instead + * @deprecated 32.0.0 Use IAppManager::getAppInstalledVersions or IAppConfig::getAppInstalledVersions instead */ - public static function getAppVersions() { - static $versions; - - if (!$versions) { - /** @var IAppConfig $appConfig */ - $appConfig = \OCP\Server::get(IAppConfig::class); - $versions = $appConfig->searchValues('installed_version'); - } - return $versions; + public static function getAppVersions(): array { + return \OCP\Server::get(IAppConfig::class)->getAppInstalledVersions(); } /** |