Index: system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.158
diff -u -r1.158 system.admin.inc
--- modules/system/system.admin.inc 19 Jun 2009 20:35:05 -0000 1.158
+++ modules/system/system.admin.inc 29 Jun 2009 23:47:18 -0000
@@ -1241,6 +1241,14 @@
'#description' => t('Render all blocks on the default 404 (not found) page. Disabling blocks can help with performance but might leave users with a less functional site.'),
'#default_value' => variable_get('site_404_blocks', 0)
);
+ $form['cron_safe_threshold'] = array(
+ '#type' => 'select',
+ '#title' => t('Automatically run cron'),
+ '#default_value' => variable_get('cron_safe_threshold', DRUPAL_DEFAULT_CRON_THRESHOLD),
+ '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'),
+ '#description' => t('It is strongly recommended to Clear cached data after enabling or disabling this feature.
When enabled, the site will check whether cron has been run in the configured interval and automatically run it upon the next page request. For more information visit the status report page.', array('@clear-cached-data' => url('admin/settings/performance'),'@status-report-url' => url('admin/reports/status'))),
+ );
+
$form['#validate'][] = 'system_site_information_settings_validate';
return system_settings_form($form);
Index: system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.716
diff -u -r1.716 system.module
--- modules/system/system.module 28 Jun 2009 12:52:57 -0000 1.716
+++ modules/system/system.module 29 Jun 2009 23:44:45 -0000
@@ -42,6 +42,11 @@
define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600);
/**
+ * Default interval between automatically ran cron task in seconds.
+ */
+define('DRUPAL_DEFAULT_CRON_THRESHOLD', 10800);
+
+/**
* New users will be set to the default time zone at registration.
*/
define('DRUPAL_USER_TIMEZONE_DEFAULT', 0);
@@ -476,6 +481,12 @@
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
+ $items['system/run-cron-image'] = array(
+ 'title' => 'Execute cron',
+ 'page callback' => 'system_run_cron_image',
+ 'access callback' => '_system_run_cron_image_access',
+ 'type' => MENU_CALLBACK,
+ );
$items['admin'] = array(
'title' => 'Administer',
'access arguments' => array('access administration pages'),
@@ -2569,3 +2580,46 @@
}
return $local;
}
+
+/**
+ * Implement hook_footer().
+ *
+ * Add a transparent 1x1 image in the closure of the page when the cron needs
+ * to run.
+ */
+function system_footer() {
+ if(_system_run_cron_image_access()) {
+ return '