Add warning on admin screen when set_time_limit is unavailable

This commit is contained in:
Ko- 2017-03-16 11:48:28 +01:00
parent 0024b67aaf
commit 786ee72146
2 changed files with 23 additions and 0 deletions

View File

@ -160,6 +160,14 @@
type: OC.SetupChecks.MESSAGE_TYPE_INFO
});
}
if(!data.isSettimelimitAvailable) {
messages.push({
msg: t(
'core',
'The PHP function "set_time_limit" is not available. This could result in scripts being halted mid-execution, breaking your installation. We strongly recommend enabling this function.'),
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
});
}
} else {
messages.push({
msg: t('core', 'Error occurred while checking server setup'),

View File

@ -285,6 +285,20 @@ class CheckSetupController extends Controller {
return !(!extension_loaded('memcached') && extension_loaded('memcache'));
}
/**
* Checks if set_time_limit is not disabled.
*
* @return bool
*/
private function isSettimelimitAvailable() {
if (function_exists('set_time_limit')
&& strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
return true;
}
return false;
}
/**
* @return RedirectResponse
*/
@ -411,6 +425,7 @@ Raw output
'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'),
'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(),
'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'),
'isSettimelimitAvailable' => $this->isSettimelimitAvailable(),
]
);
}