clear_6.inc 1.45 KB
Newer Older
1 2 3 4 5 6
<?php
/**
 *  @file
 *    Rebuild all the caches
 */

7
module_list(TRUE, FALSE);
8
module_rebuild_cache();
9
drush_log(dt('Rebuilt module cache'));
10

11 12 13
cache_clear_all('*', 'cache_form', TRUE); // This bin is excluded in drupal_flush_all_caches()
                                          // but if not purged, it may break tasks with
                                          // mysterious errors thanks to garbage collected.
14
drupal_flush_all_caches();
15
drush_log(dt('All caches flushed'));
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

// function drupal_flush_all_caches() {
//   // Change query-strings on css/js files to enforce reload for all users.
//   _drupal_flush_css_js();
//
//   drupal_clear_css_cache();
//   drupal_clear_js_cache();
//
//   // If invoked from update.php, we must not update the theme information in the
//   // database, or this will result in all themes being disabled.
//   if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') {
//     _system_theme_data();
//   }
//   else {
//     system_theme_data();
//   }
//
//   drupal_rebuild_theme_registry();
//   menu_rebuild();
//   node_types_rebuild();
//   // Don't clear cache_form - in-progress form submissions may break.
//   // Ordered so clearing the page cache will always be the last action.
//   $core = array('cache', 'cache_block', 'cache_filter', 'cache_page');
//   $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
//   foreach ($cache_tables as $table) {
//     cache_clear_all('*', $table, TRUE);
//   }
// }