diff options
Diffstat (limited to 'settings/Controller/CheckSetupController.php')
-rw-r--r-- | settings/Controller/CheckSetupController.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index d9e4846672c..016f6a1dab2 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -26,6 +26,7 @@ namespace OC\Settings\Controller; +use bantu\IniGetWrapper\IniGetWrapper; use GuzzleHttp\Exception\ClientException; use OC\AppFramework\Http; use OC\IntegrityCheck\Checker; @@ -355,6 +356,42 @@ Raw output } /** + * Checks whether a PHP opcache is properly set up + * @return bool + */ + private function isOpcacheProperlySetup() { + $iniWrapper = new IniGetWrapper(); + + $isOpcacheProperlySetUp = true; + + if(!$iniWrapper->getBool('opcache.enable')) { + $isOpcacheProperlySetUp = false; + } + + if(!$iniWrapper->getBool('opcache.save_comments')) { + $isOpcacheProperlySetUp = false; + } + + if(!$iniWrapper->getBool('opcache.enable_cli')) { + $isOpcacheProperlySetUp = false; + } + + if($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { + $isOpcacheProperlySetUp = false; + } + + if($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { + $isOpcacheProperlySetUp = false; + } + + if($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { + $isOpcacheProperlySetUp = false; + } + + return $isOpcacheProperlySetUp; + } + + /** * @return DataResponse */ public function check() { @@ -372,6 +409,8 @@ Raw output 'isCorrectMemcachedPHPModuleInstalled' => $this->isCorrectMemcachedPHPModuleInstalled(), 'hasPassedCodeIntegrityCheck' => $this->checker->hasPassedCheck(), 'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'), + 'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(), + 'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'), ] ); } |