国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com

54 lines
2.2KB

  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 GNU GPL v2 (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. } else if ($step == 1) {
  22. UpDateCatCache();
  23. ClearOptCache();
  24. ShowMsg("完成所有栏目缓存清理,开始清理枚举缓存", "sys_cache_up.php?dopost=ok&step=2&uparc=$uparc");
  25. exit();
  26. } else if ($step == 2) {
  27. include_once(DEDEINC."/enums.func.php");
  28. WriteEnumsCache();
  29. ShowMsg("正在清理枚举缓存,继续清理文档调用缓存", "sys_cache_up.php?dopost=ok&step=3&uparc=$uparc");
  30. exit();
  31. } else if ($step == 3) {
  32. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$cfg_soft_lang\">";
  33. $dsql->ExecuteNoneQuery("DELETE FROM `#@__arccache`");
  34. $msg = array();
  35. $msg[] = "正在清理文档调用,过期会员浏览记录";
  36. $oldtime = time() - (90 * 24 * 3600);
  37. $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_pms` WHERE sendtime<'$oldtime' ");
  38. $msg[] = "过期会员短信";
  39. $limit = date('Ymd', strtotime('-15 days'));
  40. $dsql->ExecuteNoneQuery("DELETE FROM `#@__statistics_detail` WHERE created_date<'$limit' ");
  41. $msg[] = "过期流量统计等缓存";
  42. $url = "sys_cache_up.php?dopost=ok&step=-1&uparc=$uparc";
  43. if ($uparc == 1) {
  44. $url = "sys_cache_up.php?dopost=ok&step=9";
  45. }
  46. ShowMsg(implode(",", $msg), $url);
  47. exit();
  48. } else if ($step == 9) {
  49. ShowMsg('已取消清理错误文档,建议用系统修复工具', 'sys_cache_up.php?dopost=ok&step=-1&uparc=1');
  50. exit();
  51. }
  52. }
  53. include DedeInclude('templets/sys_cache_up.htm');
  54. ?>