aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppConfig.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/AppConfig.php')
-rw-r--r--lib/private/AppConfig.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index a8a6f689ffa..adbfc58978b 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -1670,11 +1670,18 @@ class AppConfig implements IAppConfig {
*
* @return array<string, string>
*/
- public function getAppInstalledVersions(): array {
+ public function getAppInstalledVersions(bool $onlyEnabled = false): array {
if ($this->appVersionsCache === null) {
/** @var array<string, string> */
$this->appVersionsCache = $this->searchValues('installed_version', false, IAppConfig::VALUE_STRING);
}
+ if ($onlyEnabled) {
+ return array_filter(
+ $this->appVersionsCache,
+ fn (string $app): bool => $this->getValueString($app, 'enabled', 'no') !== 'no',
+ ARRAY_FILTER_USE_KEY
+ );
+ }
return $this->appVersionsCache;
}
}