diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-05-04 09:41:37 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-05-04 09:41:37 +0000 |
commit | c740ac7fd58b5f4597bde987ae9263f3d05febd8 (patch) | |
tree | 0eb9221dd27cfa6d308e99babc41b1f9fd474c7b /modules/system/system.module | |
parent | 304400293a997a76290f04c7d1d65680fef2c7d8 (diff) | |
download | brdo-c740ac7fd58b5f4597bde987ae9263f3d05febd8.tar.gz brdo-c740ac7fd58b5f4597bde987ae9263f3d05febd8.tar.bz2 |
#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.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 23 |
1 files changed, 23 insertions, 0 deletions
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); + } +} |