summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-12-04 17:05:52 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-12-05 00:03:05 +0100
commitf5ad80fc5774934b5f05c3538cd12218f2b17d21 (patch)
tree4da08f3845301b00dfda5b9ac295c443ada0e7c7 /settings/Controller
parent441496a5a579a30d21c9545d32429281de66bd24 (diff)
downloadnextcloud-server-f5ad80fc5774934b5f05c3538cd12218f2b17d21.tar.gz
nextcloud-server-f5ad80fc5774934b5f05c3538cd12218f2b17d21.zip
Add setup check for recommended PHP modules (i.e. Imagick, intl)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/CheckSetupController.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php
index 5da84eca68d..d757c017e18 100644
--- a/settings/Controller/CheckSetupController.php
+++ b/settings/Controller/CheckSetupController.php
@@ -583,6 +583,27 @@ Raw output
}
/**
+ * Checks for potential PHP modules that would improve the instance
+ *
+ * @return string[] A list of PHP modules that is recommended
+ */
+ protected function hasRecommendedPHPModules(): array {
+ $recommendedPHPModules = [];
+
+ if (!function_exists('grapheme_strlen')) {
+ $recommendedPHPModules[] = 'intl';
+ }
+
+ if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') {
+ if (!extension_loaded('imagick')) {
+ $recommendedPHPModules[] = 'imagick';
+ }
+ }
+
+ return $recommendedPHPModules;
+ }
+
+ /**
* @return DataResponse
*/
public function check() {
@@ -621,6 +642,7 @@ Raw output
'mailSettingsDocumentation' => $this->urlGenerator->getAbsoluteURL('index.php/settings/admin'),
'isMemoryLimitSufficient' => $this->memoryInfo->isMemoryLimitSufficient(),
'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(),
+ 'recommendedPHPModules' => $this->hasRecommendedPHPModules(),
]
);
}