Clear Drupal 5 Cache


/ Published in: PHP
Save to your folder(s)

This might work in Drupal 6, but I haven't tried it.


Copy this code and paste it in your HTML
  1. <?php
  2. /*
  3.  * See http://drupal.org/node/152983 for details!
  4.  */
  5.  
  6. // only allow site administrators to visit this page:
  7. if (!user_access('administer site configuration')) {
  8. drupal_not_found();
  9. }
  10. else {
  11. drupal_clear_css_cache();
  12. $tables = array(
  13. 'cache',
  14. 'cache_content',
  15. 'cache_filter',
  16. 'cache_menu',
  17. 'cache_page',
  18. 'cache_views',
  19. );
  20. foreach ($tables as $table) {
  21. cache_clear_all('*', $table, TRUE);
  22. }
  23. drupal_set_message('Cache cleared.');
  24. drupal_goto('/');
  25. }
  26. ?>

URL: http://drupal.org/node/152983

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.