summaryrefslogtreecommitdiffstats
path: root/apps/settings/tests/Controller/CheckSetupControllerTest.php
diff options
context:
space:
mode:
authorMichaIng <micha@dietpi.com>2021-06-05 22:18:21 +0200
committerMichaIng <micha@dietpi.com>2021-12-19 23:38:21 +0100
commit82c1beaacb92ed452afd73967c69aad68aecc0a5 (patch)
treea7abf6f3b7c7342f066ade1571084a58101b73b6 /apps/settings/tests/Controller/CheckSetupControllerTest.php
parentd98e31a87218eaa1a0447c3011c8b0a9fc958bd8 (diff)
downloadnextcloud-server-82c1beaacb92ed452afd73967c69aad68aecc0a5.tar.gz
nextcloud-server-82c1beaacb92ed452afd73967c69aad68aecc0a5.zip
Enhance and complement OPcache setup checks
The current OPcache recommendations match the PHP defaults, but the values are much higher than required to run Nextcloud, even with a high number of installed apps. On the other hand, when other applications use the same OPcache instance, the recommended values might not be sufficient. Accurate recommendations need to take into account actual OPcache usage. With this commit, recommendations are shown to raise the config value if more than 90% of max cache size or number of keys is used. The checks whether the module is loaded and whether the OPcache is properly configured have been merged into a single function. This allowed to reduce the overhead of OPcache configuration checks when the module is not loaded. A check has been added whether Nextcloud is permitted to use the OPcache API. Without this, inconsistencies during core or app upgrades may cause errors and OPcache usage cannot be determined for the new usage based checks. OPcache usage based checks are skipped when Nextcloud is not permitted to use the API. Signed-off-by: MichaIng <micha@dietpi.com>
Diffstat (limited to 'apps/settings/tests/Controller/CheckSetupControllerTest.php')
-rw-r--r--apps/settings/tests/Controller/CheckSetupControllerTest.php15
1 files changed, 4 insertions, 11 deletions
diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php
index 612a04d7d62..d54c1bb226a 100644
--- a/apps/settings/tests/Controller/CheckSetupControllerTest.php
+++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php
@@ -179,13 +179,12 @@ class CheckSetupControllerTest extends TestCase {
'getSuggestedOverwriteCliURL',
'getCurlVersion',
'isPhpOutdated',
- 'isOpcacheProperlySetup',
+ 'getOpcacheSetupRecommendations',
'hasFreeTypeSupport',
'hasMissingIndexes',
'hasMissingPrimaryKeys',
'isSqliteUsed',
'isPHPMailerUsed',
- 'hasOpcacheLoaded',
'getAppDirsWithDifferentOwner',
'hasRecommendedPHPModules',
'hasBigIntConversionPendingColumns',
@@ -479,8 +478,8 @@ class CheckSetupControllerTest extends TestCase {
->willReturn(true);
$this->checkSetupController
->expects($this->once())
- ->method('isOpcacheProperlySetup')
- ->willReturn(false);
+ ->method('getOpcacheSetupRecommendations')
+ ->willReturn(['recommendation1', 'recommendation2']);
$this->checkSetupController
->method('hasFreeTypeSupport')
->willReturn(false);
@@ -507,10 +506,6 @@ class CheckSetupControllerTest extends TestCase {
->willReturn(true);
$this->checkSetupController
->expects($this->once())
- ->method('hasOpcacheLoaded')
- ->willReturn(true);
- $this->checkSetupController
- ->expects($this->once())
->method('hasWorkingFileLocking')
->willReturn(true);
$this->checkSetupController
@@ -624,9 +619,7 @@ class CheckSetupControllerTest extends TestCase {
'isCorrectMemcachedPHPModuleInstalled' => true,
'hasPassedCodeIntegrityCheck' => true,
'codeIntegrityCheckerDocumentation' => 'http://docs.example.org/server/go.php?to=admin-code-integrity',
- 'isOpcacheProperlySetup' => false,
- 'hasOpcacheLoaded' => true,
- 'phpOpcacheDocumentation' => 'http://docs.example.org/server/go.php?to=admin-php-opcache',
+ 'OpcacheSetupRecommendations' => ['recommendation1', 'recommendation2'],
'isSettimelimitAvailable' => true,
'hasFreeTypeSupport' => false,
'isSqliteUsed' => false,