diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-03-08 08:53:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-08 08:53:12 +0100 |
commit | 23e8ae15aaea30359a927492155de13c97b311ce (patch) | |
tree | c4ec96e1edf2e269d14e1152e695119d6f7d5e05 /apps | |
parent | 697e1d602562fb8bad5598b18817e669f08f2b90 (diff) | |
parent | 3c8f8bc70aef23d04b1fc46a1a38ef696b32f736 (diff) | |
download | nextcloud-server-23e8ae15aaea30359a927492155de13c97b311ce.tar.gz nextcloud-server-23e8ae15aaea30359a927492155de13c97b311ce.zip |
Merge pull request #31470 from nextcloud/enh/13099/allow-disable-imagick-warning
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/Controller/CheckSetupController.php | 35 | ||||
-rw-r--r-- | apps/settings/tests/Controller/CheckSetupControllerTest.php | 12 |
2 files changed, 33 insertions, 14 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 1809a47ff44..37305f3edf5 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -714,20 +714,6 @@ Raw output $recommendedPHPModules[] = 'intl'; } - if (!extension_loaded('bcmath')) { - $recommendedPHPModules[] = 'bcmath'; - } - - if (!extension_loaded('gmp')) { - $recommendedPHPModules[] = 'gmp'; - } - - if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') { - if (!extension_loaded('imagick')) { - $recommendedPHPModules[] = 'imagick'; - } - } - if (!defined('PASSWORD_ARGON2I') && PHP_VERSION_ID >= 70400) { // Installing php-sodium on >=php7.4 will provide PASSWORD_ARGON2I // on previous version argon2 wasn't part of the "standard" extension @@ -739,6 +725,25 @@ Raw output return $recommendedPHPModules; } + protected function isImagickEnabled(): bool { + if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') { + if (!extension_loaded('imagick')) { + return false; + } + } + return true; + } + + protected function areWebauthnExtensionsEnabled(): bool { + if (!extension_loaded('bcmath')) { + return false; + } + if (!extension_loaded('gmp')) { + return false; + } + return true; + } + protected function isMysqlUsedWithoutUTF8MB4(): bool { return ($this->config->getSystemValue('dbtype', 'sqlite') === 'mysql') && ($this->config->getSystemValue('mysql.utf8mb4', false) === false); } @@ -870,6 +875,8 @@ Raw output 'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'), 'isMemoryLimitSufficient' => $this->memoryInfo->isMemoryLimitSufficient(), 'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(), + 'isImagickEnabled' => $this->isImagickEnabled(), + 'areWebauthnExtensionsEnabled' => $this->areWebauthnExtensionsEnabled(), 'recommendedPHPModules' => $this->hasRecommendedPHPModules(), 'pendingBigIntConversionColumns' => $this->hasBigIntConversionPendingColumns(), 'isMysqlUsedWithoutUTF8MB4' => $this->isMysqlUsedWithoutUTF8MB4(), diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index 4349994570b..8a1e062f58b 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -550,6 +550,16 @@ class CheckSetupControllerTest extends TestCase { $this->checkSetupController ->expects($this->once()) + ->method('isImagickEnabled') + ->willReturn(false); + + $this->checkSetupController + ->expects($this->once()) + ->method('areWebauthnExtensionsEnabled') + ->willReturn(false); + + $this->checkSetupController + ->expects($this->once()) ->method('hasRecommendedPHPModules') ->willReturn([]); @@ -642,6 +652,8 @@ class CheckSetupControllerTest extends TestCase { 'missingColumns' => [], 'isMemoryLimitSufficient' => true, 'appDirsWithDifferentOwner' => [], + 'isImagickEnabled' => false, + 'areWebauthnExtensionsEnabled' => false, 'recommendedPHPModules' => [], 'pendingBigIntConversionColumns' => [], 'isMysqlUsedWithoutUTF8MB4' => false, |