Add warning on admin screen when set_time_limit is unavailable
This commit is contained in:
parent
0024b67aaf
commit
786ee72146
|
@ -160,6 +160,14 @@
|
||||||
type: OC.SetupChecks.MESSAGE_TYPE_INFO
|
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 {
|
} else {
|
||||||
messages.push({
|
messages.push({
|
||||||
msg: t('core', 'Error occurred while checking server setup'),
|
msg: t('core', 'Error occurred while checking server setup'),
|
||||||
|
|
|
@ -285,6 +285,20 @@ class CheckSetupController extends Controller {
|
||||||
return !(!extension_loaded('memcached') && extension_loaded('memcache'));
|
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
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
|
@ -411,6 +425,7 @@ Raw output
|
||||||
'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'),
|
'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'),
|
||||||
'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(),
|
'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(),
|
||||||
'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'),
|
'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'),
|
||||||
|
'isSettimelimitAvailable' => $this->isSettimelimitAvailable(),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue