From c7037d7b38d794ad49c93cbc1dfb8721898bd191 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Tue, 25 Mar 2025 16:18:51 +0100 Subject: fix: Move getAppInstalledVersions to AppConfig so that it can be used earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Call it from OC_App to make sure there is only one request to DB. Signed-off-by: Côme Chilliet --- lib/private/legacy/OC_App.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/private/legacy') 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(); } /** -- cgit v1.2.3