国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 line
2.5KB

  1. <?php
  2. /**
  3. * 更新缓存
  4. *
  5. * @version $id:sys_cache_up.php 16:22 2010年7月20日 tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2022 DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. CheckPurview('sys_ArcBatch');
  13. if (empty($dopost)) $dopost = '';
  14. if (empty($step)) $step = 1;
  15. if ($dopost == "ok") {
  16. if (empty($uparc)) $uparc = 0;
  17. if ($step == -1) {
  18. if ($uparc == 0) sleep(1);
  19. ShowMsg("全部缓存清理已完成", "javascript:;");
  20. exit();
  21. }
  22. //更新栏目缓存
  23. else if ($step == 1) {
  24. UpDateCatCache();
  25. ClearOptCache();
  26. ShowMsg("正在清理栏目缓存,继续清理枚举缓存", "sys_cache_up.php?dopost=ok&step=2&uparc=$uparc");
  27. exit();
  28. }
  29. //更新枚举缓存
  30. else if ($step == 2) {
  31. include_once(DEDEINC."/enums.func.php");
  32. WriteEnumsCache();
  33. //WriteAreaCache(); 已过期
  34. ShowMsg("正在清理枚举缓存,继续清理调用缓存", "sys_cache_up.php?dopost=ok&step=3&uparc=$uparc");
  35. exit();
  36. }
  37. //清理arclist调用缓存、过期会员浏览历史、过期短信、陈旧的流量统计数据
  38. else if ($step == 3) {
  39. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$cfg_soft_lang\">";
  40. $dsql->ExecuteNoneQuery("DELETE FROM `#@__arccache`");
  41. $msg = array();
  42. $msg[] = "正在清理arclist调用缓存,继续清理过期会员浏览历史";
  43. $oldtime = time() - (90 * 24 * 3600);
  44. $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_pms` WHERE sendtime<'$oldtime' ");
  45. $msg[] = "正在清理过期短信,继续修正错误文档,要占较长时间";
  46. $limit = date('Ymd', strtotime('-15 days'));
  47. $dsql->ExecuteNoneQuery("DELETE FROM `#@__statistics_detail` WHERE created_date < '$limit'");
  48. $msg[] = "正在清理15天之前流量统计";
  49. $url = "sys_cache_up.php?dopost=ok&step=-1&uparc=$uparc";
  50. if ($uparc == 1) {
  51. $url = "sys_cache_up.php?dopost=ok&step=9";
  52. }
  53. ShowMsg(implode("<br/>",$msg),$url);
  54. exit();
  55. }
  56. //修正错误文档
  57. else if ($step == 9) {
  58. ShowMsg('清理错误文档已取消,到系统修复工具进行操作', 'sys_cache_up.php?dopost=ok&step=-1&uparc=1', 0, 5000);
  59. exit();
  60. }
  61. }
  62. include DedeInclude('templets/sys_cache_up.htm');
  63. ?>