function ultimate_cron_requirements in Ultimate Cron 6
Same name and namespace in other branches
- 8.2 ultimate_cron.install \ultimate_cron_requirements()
- 8 ultimate_cron.install \ultimate_cron_requirements()
- 7.2 ultimate_cron.install \ultimate_cron_requirements()
- 7 ultimate_cron.install \ultimate_cron_requirements()
Implementation of hook_requirements().
1 call to ultimate_cron_requirements()
- ultimate_cron_view_page in ./
ultimate_cron.admin.inc - Page overviewing cron jobs.
File
- ./
ultimate_cron.install, line 157 - Installation file for Ultimate Cron
Code
function ultimate_cron_requirements($phase) {
$response = array();
switch ($phase) {
case 'install':
return $response;
case 'runtime':
$t = get_t();
$response['title'] = 'Ultimate Cron';
$response['value'] = $t('OK');
$response['severity'] = REQUIREMENT_OK;
if ($modules = _ultimate_cron_incompatible_modules()) {
$response['severity'] = REQUIREMENT_ERROR;
$response['value'] = $t('Ultimate Cron is DISABLED!');
$response['description'] = $t('%modules is installed on the system, but is incompatible with Ultimate Cron.<br/>Please disable the modules %modules.<br/>You might want to !url settings first.', array(
'%modules' => join(', ', $modules),
'!url' => l(t('import'), 'admin/settings/cron/import'),
));
}
elseif ($functions = ultimate_cron_unsafe_hooks()) {
$response['severity'] = REQUIREMENT_WARNING;
$response['value'] = $t('Running in degraded mode');
$response['description'] = $t('Ultimate Cron is not the first module. Please reclaim position through !settings to enable Ultimate Cron handling for all functions.', array(
'!settings' => l(t('settings'), 'admin/settings/cron/settings'),
));
$response['description'] .= '<br/>';
$response['description'] .= $t('Functions not handled by Ultimate Cron because they are unsafe:<br/>%functions', array(
'%functions' => join(', ', array_keys($functions)),
));
}
if (ini_get('safe_mode')) {
$desc = $t('Safe mode enabled. Ultimate Cron is unable to control maximum execution time for cron jobs. This may cause cron jobs to end prematurely.');
if ($response['severity'] < REQUIREMENT_WARNING) {
$response['severity'] = REQUIREMENT_WARNING;
$response['value'] = $t('Safe mode enabled');
$response['description'] = $desc;
}
else {
$response['description'] .= '<br/>' . $desc;
}
}
$result = array();
$result['ultimate_cron'] = $response;
return $result;
}
}