diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-02-15 00:40:36 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-02-22 23:45:48 -0600 |
commit | cee8853658703358a8e564c414807c632ee0d5ea (patch) | |
tree | b7ecd1915099914b4d2f8ccec9c3fe16e7008107 /settings | |
parent | 41276f720b838681d571c40da937e0b143c9fdf6 (diff) | |
download | nextcloud-server-cee8853658703358a8e564c414807c632ee0d5ea.tar.gz nextcloud-server-cee8853658703358a8e564c414807c632ee0d5ea.zip |
Show info in admin settings about PHP opcache if disabled
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'settings')
-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'), ] ); } |