উত্তর:
hook_requirement () ফাংশন আপনাকে সহায়তা করতে পারে।
এটি দেখুন: http://api.drupal.org/api/drupal/modules%21system%21s systemm.api.php / function / hook_requirements/7
আপনার মডিউল ফাইলে hook_requirement () ফাংশন লিখুন।
function hook_requirements($phase) {
if ($phase == 'runtime') {
$cron_last = variable_get('cron_last');
if (is_numeric($cron_last)) {
$requirements['cron']['value'] = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
}
else {
$requirements['cron'] = array(
'description' => $t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for <a href="@url">configuring cron jobs</a>.', array('@url' => 'http://drupal.org/cron')),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Never run'),
);
}
$requirements['cron']['description'] .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
$requirements['cron']['title'] = $t('Cron maintenance tasks');
}
}