From 66b7a5cb74d45c2e94b021aff1a24d3b83ca8501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 7 Jan 2008 19:43:29 +0000 Subject: #199946 by JirkaRybka: append a short query string to CSS and JS files, changing on upgrades, so on core/module/theme upgrades, browser caches will 'flush' --- update.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'update.php') diff --git a/update.php b/update.php index 235eed624..3ddf10435 100644 --- a/update.php +++ b/update.php @@ -13,6 +13,12 @@ * be sure to open settings.php again, and change it back to its original state! */ +/** + * Global flag to identify update.php run, and so avoid various unwanted + * operations, such as hook_init() and hook_exit() invokes, css/js preprocessing + * and translation, and solve some theming issues. This flag is checked on several + * places in Drupal code (not just update.php). + */ define('MAINTENANCE_MODE', 'update'); /** @@ -264,11 +270,7 @@ function update_batch() { function update_finished($success, $results, $operations) { // clear the caches in case the data has been updated. - cache_clear_all('*', 'cache', TRUE); - cache_clear_all('*', 'cache_page', TRUE); - cache_clear_all('*', 'cache_filter', TRUE); - drupal_clear_css_cache(); - drupal_clear_js_cache(); + drupal_flush_all_caches(); $_SESSION['update_results'] = $results; $_SESSION['update_success'] = $success; @@ -340,6 +342,9 @@ function update_results_page() { } function update_info_page() { + // Change query-strings on css/js files to enforce reload for all users. + _drupal_flush_css_js(); + update_task_list('info'); drupal_set_title('Drupal database update'); $output = '

Use this utility to update your database whenever a new release of Drupal or a module is installed.

For more detailed information, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.

'; @@ -516,11 +521,6 @@ ini_set('display_errors', FALSE); include_once './includes/bootstrap.inc'; -// Bootstrap Drupal in a safe way, without calling hook_init() and hook_exit(), -// to avoid possible warnings. We need to set the global variable after -// DRUPAL_BOOTSTRAP_CONFIGURATION, which unsets globals, but before the rest. -drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); -$update_mode = TRUE; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_maintenance_theme(); -- cgit v1.2.3