CacheController.class.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. namespace Admin\Controller;
  3. /**
  4. * 缓存管理
  5. * @author Devil
  6. * @blog http://gong.gg/
  7. * @version 0.0.1
  8. * @datetime 2016-12-01T21:51:08+0800
  9. */
  10. class CacheController extends CommonController
  11. {
  12. /**
  13. * [_initialize 前置操作-继承公共前置方法]
  14. * @author Devil
  15. * @blog http://gong.gg/
  16. * @version 0.0.1
  17. * @datetime 2016-12-03T12:39:08+0800
  18. */
  19. public function _initialize()
  20. {
  21. // 调用父类前置方法
  22. parent::_initialize();
  23. // 登录校验
  24. $this->Is_Login();
  25. // 权限校验
  26. $this->Is_Power();
  27. }
  28. /**
  29. * [Index 首页]
  30. * @author Devil
  31. * @blog http://gong.gg/
  32. * @version 0.0.1
  33. * @datetime 2017-02-26T19:13:29+0800
  34. */
  35. public function Index()
  36. {
  37. $this->assign('cache_type_list', L('cache_type_list'));
  38. $this->display('Index');
  39. }
  40. /**
  41. * [SiteUpdate 站点缓存更新]
  42. * @author Devil
  43. * @blog http://gong.gg/
  44. * @version 0.0.1
  45. * @datetime 2017-02-26T19:53:14+0800
  46. */
  47. public function SiteUpdate()
  48. {
  49. // 后台
  50. S(C('cache_common_my_config_key'), null);
  51. S(C('cache_common_timezone_key'), null);
  52. S(C('cache_common_home_nav_header_key'), null);
  53. S(C('cache_common_home_nav_footer_key'), null);
  54. S(C('cache_common_default_theme_key'), null);
  55. PowerCacheDelete();
  56. // 前台
  57. S(C('cache_home_channel_key'), null);
  58. $this->success(L('common_operation_update_success'));
  59. }
  60. /**
  61. * [TemplateUpdate 模板缓存更新]
  62. * @author Devil
  63. * @blog http://gong.gg/
  64. * @version 0.0.1
  65. * @datetime 2017-02-26T19:53:14+0800
  66. */
  67. public function TemplateUpdate()
  68. {
  69. // 模板 Cache
  70. DelDirFile(CACHE_PATH);
  71. $this->success(L('common_operation_update_success'));
  72. }
  73. /**
  74. * [ModuleUpdate 模块缓存更新]
  75. * @author Devil
  76. * @blog http://gong.gg/
  77. * @version 0.0.1
  78. * @datetime 2017-02-26T19:53:14+0800
  79. */
  80. public function ModuleUpdate()
  81. {
  82. $this->success(L('common_operation_update_success'));
  83. }
  84. }
  85. ?>