From 22444f2fedf0fbe34423128ede822adc0f82e411 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 26 Nov 2007 16:25:14 +0000 Subject: - Patch #195173 by Eaton et al: allow administrators to clear all caches. --- modules/system/system.admin.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules') diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 07168c502..230183aae 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1249,12 +1249,32 @@ function system_performance_settings() { '#description' => t("This option can interfere with module development. It is recommended to only turn this on when your site is complete."), ); + $form['clear_cache'] = array( + '#type' => 'fieldset', + '#title' => t('Clear cached data'), + '#description' => t('Caching data improves performance, but may cause problems while troubleshooting new modules, themes, or translations, if outdated information has been cached. To refresh all cached data on your site, click the button below. Warning: high-traffic sites will experience performance slowdowns while cached data is rebuilt.'), + ); + + $form['clear_cache']['cache'] = array( + '#type' => 'submit', + '#value' => t('Clear cached data'), + '#submit' => array('system_clear_cache_submit'), + ); + $form['#submit'][] = 'drupal_clear_css_cache'; $form['#submit'][] = 'drupal_clear_js_cache'; return system_settings_form($form); } +/** + * Clear system caches. + */ +function system_clear_cache_submit(&$form_state, $form) { + drupal_flush_all_caches(); + drupal_set_message('Caches cleared.'); +} + /** * Form builder; Configure the site file handling. * -- cgit v1.2.3