Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.823 diff -u -p -r1.823 common.inc --- includes/common.inc 10 Nov 2008 05:22:59 -0000 1.823 +++ includes/common.inc 11 Nov 2008 01:25:20 -0000 @@ -2715,6 +2715,7 @@ function _drupal_bootstrap_full() { require_once DRUPAL_ROOT . '/includes/form.inc'; require_once DRUPAL_ROOT . '/includes/mail.inc'; require_once DRUPAL_ROOT . '/includes/actions.inc'; + // Set the Drupal custom error handler. set_error_handler('_drupal_error_handler'); set_exception_handler('_drupal_exception_handler'); @@ -2728,6 +2729,14 @@ function _drupal_bootstrap_full() { // Load all enabled modules module_load_all(); + // Register a safe cron run at the end of the request if needed. + if (variable_get('cron_safe_threshold', 10800)) { + $cron_last = variable_get('cron_last', NULL); + if (!isset($cron_last) || (REQUEST_TIME - $cron_last > variable_get('cron_safe_threshold', 10800))) { + register_shutdown_function('drupal_cron_run'); + } + } + // Let all modules take action before menu system handles the request // We do not want this while running update.php. if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') { Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.103 diff -u -p -r1.103 system.admin.inc --- modules/system/system.admin.inc 10 Nov 2008 05:23:00 -0000 1.103 +++ modules/system/system.admin.inc 11 Nov 2008 01:24:26 -0000 @@ -1700,22 +1700,51 @@ function system_date_time_lookup() { * @see system_settings_form() */ function system_site_maintenance_settings() { + global $base_url; - $form['site_offline'] = array( + $form['offline'] = array( + '#type' => 'fieldset', + '#title' => t('Maintenance'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + $form['offline']['site_offline'] = array( '#type' => 'radios', '#title' => t('Site status'), '#default_value' => variable_get('site_offline', 0), '#options' => array(t('Online'), t('Offline')), '#description' => t('When set to "Online", all visitors will be able to browse your site normally. When set to "Offline", only users with the "administer site configuration" permission will be able to access your site to perform maintenance; all other visitors will see the site offline message configured below. Authorized users can log in during "Offline" mode directly via the user login page.', array('@user-login' => url('user'))), ); - - $form['site_offline_message'] = array( + $form['offline']['site_offline_message'] = array( '#type' => 'textarea', '#title' => t('Site offline message'), '#default_value' => variable_get('site_offline_message', t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))), '#description' => t('Message to show visitors when the site is in offline mode.') ); + $form['cron'] = array( + '#type' => 'fieldset', + '#title' => t('Cron'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + $form['cron']['cron_safe_threshold'] = array( + '#type' => 'select', + '#title' => t('Automatically run cron'), + '#default_value' => variable_get('cron_safe_threshold', 10800), + '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'), + '#description' => t('When enabled, the site will check whether cron has been run in the configured interval and automatically run it upon the next page request. You can also run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))), + ); + $advanced = '

' . t('To run cron from outside the site, go to !cron', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal'))))) . '

'; + $advanced .= '

' . t('If the hosting provider of this site supports system controlled cron jobs, you can try to use the following command:'); + $advanced .= '
cd ' . getcwd() . '; ./scripts/drupal.sh http://' . substr(conf_path(), strpos(conf_path(), '/') + 1) . url('/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal'))) . '

'; + $advanced .= '

' . t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'http://drupal.org/cron')) . '

'; + $form['cron'][] = array( + '#type' => 'item', + '#title' => t('Advanced cron setup'), + '#markup' => $advanced, + ); + return system_settings_form($form); } Index: profiles/expert/expert.profile =================================================================== RCS file: /cvs/drupal/drupal/profiles/expert/expert.profile,v retrieving revision 1.1 diff -u -p -r1.1 expert.profile --- profiles/expert/expert.profile 5 Jul 2008 10:58:12 -0000 1.1 +++ profiles/expert/expert.profile 11 Nov 2008 01:26:59 -0000 @@ -90,7 +90,10 @@ function expert_profile_task_list() { * modify the $task, otherwise discarded. */ function expert_profile_tasks(&$task, $url) { + // Disable Locale module. module_disable(array('locale')); + // Disable automated cron runs. + variable_set('cron_safe_threshold', 0); } /**