diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-12-05 00:34:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-05 00:34:04 +0100 |
commit | faa988c0993aa114140eec7cad48b93dec0e4b0d (patch) | |
tree | bd72a2f8b172065c344a0e11cce5d6f3e6fe56d3 /settings/Controller | |
parent | 922fd4dd78a5c4bedb0ec764978611f52402770b (diff) | |
parent | 5b2222535173312b681ca4ab0de1d01ae28c913b (diff) | |
download | nextcloud-server-faa988c0993aa114140eec7cad48b93dec0e4b0d.tar.gz nextcloud-server-faa988c0993aa114140eec7cad48b93dec0e4b0d.zip |
Merge pull request #12821 from nextcloud/feature/12767/add-setup-check-for-php-module
Add setup check for recommended PHP modules (i.e. Imagick, intl)
Diffstat (limited to 'settings/Controller')
-rw-r--r-- | settings/Controller/CheckSetupController.php | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index e906af77bae..4211b9b4c6c 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -527,7 +527,7 @@ Raw output return []; } - protected function isPhpMailerUsed(): bool { + protected function isPHPMailerUsed(): bool { return $this->config->getSystemValue('mail_smtpmode', 'smtp') === '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() { @@ -617,10 +638,11 @@ Raw output 'missingIndexes' => $this->hasMissingIndexes(), 'isSqliteUsed' => $this->isSqliteUsed(), 'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'), - 'isPhpMailerUsed' => $this->isPhpMailerUsed(), + 'isPHPMailerUsed' => $this->isPHPMailerUsed(), 'mailSettingsDocumentation' => $this->urlGenerator->getAbsoluteURL('index.php/settings/admin'), 'isMemoryLimitSufficient' => $this->memoryInfo->isMemoryLimitSufficient(), 'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(), + 'recommendedPHPModules' => $this->hasRecommendedPHPModules(), ] ); } |