summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2022-11-21 15:20:11 +0100
committerGitHub <noreply@github.com>2022-11-21 15:20:11 +0100
commitc2cb790532f2a7ea5a9ad39167d95b69c9ed6c10 (patch)
tree9fb70d96531140e789fd4c51aae5992164e500ea /apps
parent1510a3dca498a2f8619793871842c45f92b3c79b (diff)
parent3eab7ca3d4a72abcd10593f3216b59e1f9644456 (diff)
downloadnextcloud-server-c2cb790532f2a7ea5a9ad39167d95b69c9ed6c10.tar.gz
nextcloud-server-c2cb790532f2a7ea5a9ad39167d95b69c9ed6c10.zip
Merge pull request #34745 from nextcloud/optimize-show-apps
Extract $ignoreMaxApps from array_map callback in AppSettingsController
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/Controller/AppSettingsController.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php
index 618d99b3d73..a4addfc5b35 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -237,7 +237,6 @@ class AppSettingsController extends Controller {
/**
* Get all available apps in a category
*
- * @param string $category
* @return JSONResponse
* @throws \Exception
*/
@@ -247,8 +246,14 @@ class AppSettingsController extends Controller {
$dependencyAnalyzer = new DependencyAnalyzer(new Platform($this->config), $this->l10n);
+ $ignoreMaxApps = $this->config->getSystemValue('app_install_overwrite', []);
+ if (!is_array($ignoreMaxApps)) {
+ $this->logger->warning('The value given for app_install_overwrite is not an array. Ignoring...');
+ $ignoreMaxApps = [];
+ }
+
// Extend existing app details
- $apps = array_map(function ($appData) use ($dependencyAnalyzer) {
+ $apps = array_map(function (array $appData) use ($dependencyAnalyzer, $ignoreMaxApps) {
if (isset($appData['appstoreData'])) {
$appstoreData = $appData['appstoreData'];
$appData['screenshot'] = isset($appstoreData['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/' . base64_encode($appstoreData['screenshots'][0]['url']) : '';
@@ -274,11 +279,6 @@ class AppSettingsController extends Controller {
$appData['licence'] = $appData['license'];
}
- $ignoreMaxApps = $this->config->getSystemValue('app_install_overwrite', []);
- if (!is_array($ignoreMaxApps)) {
- $this->logger->warning('The value given for app_install_overwrite is not an array. Ignoring...');
- $ignoreMaxApps = [];
- }
$ignoreMax = in_array($appData['id'], $ignoreMaxApps);
// analyse dependencies