From c740ac7fd58b5f4597bde987ae9263f3d05febd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Fri, 4 May 2007 09:41:37 +0000 Subject: #127539: progressive operation support, refactoring update.php code to a generic batch API to support runnning operations in multiple HTTP requests - update.php is already on the batch API - node access rebuilding is in the works - automatic locale importing is in the works Thanks to Yves Chedemois (yched) for the good code quality, very wide awareness of issues related to batches, and the fantastic turnaround times. Hats off. --- modules/system/system.module | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index fab91e2d6..a18439e07 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -327,6 +327,12 @@ function system_menu() { 'page callback' => 'system_sql', 'type' => MENU_CALLBACK, ); + // Default page for batch operations + $items['batch'] = array( + 'page callback' => 'system_batch_page', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); return $items; } @@ -2459,5 +2465,22 @@ function theme_system_admin_by_module($menu_items) { function system_cron() { // Cleanup the flood db_query('DELETE FROM {flood} WHERE timestamp < %d', time() - 3600); + // Cleanup the batch table + db_query('DELETE FROM {batch} WHERE timestamp < %d', time() - 864000); } +/** + * Default page callback for batches. + */ +function system_batch_page() { + require_once './includes/batch.inc'; + $output = _batch_page(); + if ($output === FALSE) { + drupal_access_denied(); + } + else { + // Force a page without blocks or messages to + // display a list of collected messages later. + print theme('page', $output, FALSE, FALSE); + } +} -- cgit v1.2.3