Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

killcache.inc 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------+
  4. | program/steps/utils/killcache.inc |
  5. | |
  6. | This file is part of the Roundcube Webmail client |
  7. | Copyright (C) 2005-2010, The Roundcube Dev Team |
  8. | |
  9. | Licensed under the GNU General Public License version 3 or |
  10. | any later version with exceptions for skins & plugins. |
  11. | See the README file for a full license statement. |
  12. | |
  13. | PURPOSE: |
  14. | Delete rows from cache tables |
  15. | |
  16. +-----------------------------------------------------------------------+
  17. | Author: Dennis P. Nikolaenko <dennis@nikolaenko.ru> |
  18. +-----------------------------------------------------------------------+
  19. */
  20. // don't allow public access if not in devel_mode
  21. if (!$RCMAIL->config->get('devel_mode')) {
  22. header("HTTP/1.0 401 Access denied");
  23. die("Access denied!");
  24. }
  25. // @TODO: transaction here (if supported by DB) would be a good thing
  26. $res = $RCMAIL->db->query("DELETE FROM " . $RCMAIL->db->table_name('cache', true));
  27. if ($err = $RCMAIL->db->is_error($res)) {
  28. exit($err);
  29. }
  30. $res = $RCMAIL->db->query("DELETE FROM " . $RCMAIL->db->table_name('cache_shared', true));
  31. if ($err = $RCMAIL->db->is_error($res)) {
  32. exit($err);
  33. }
  34. $res = $RCMAIL->db->query("DELETE FROM " . $RCMAIL->db->table_name('cache_messages', true));
  35. if ($err = $RCMAIL->db->is_error($res)) {
  36. exit($err);
  37. }
  38. $res = $RCMAIL->db->query("DELETE FROM " . $RCMAIL->db->table_name('cache_index', true));
  39. if ($err = $RCMAIL->db->is_error($res)) {
  40. exit($err);
  41. }
  42. $res = $RCMAIL->db->query("DELETE FROM " . $RCMAIL->db->table_name('cache_thread', true));
  43. if ($err = $RCMAIL->db->is_error($res)) {
  44. exit($err);
  45. }
  46. echo "Cache cleared\n";
  47. exit;