Files
shopxo/app/admin/controller/Cache.php

119 lines
2.8 KiB
PHP
Raw Normal View History

2018-12-28 18:58:37 +08:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
2021-03-16 10:34:52 +08:00
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
2018-12-28 18:58:37 +08:00
// +----------------------------------------------------------------------
2021-03-16 10:34:52 +08:00
// | Licensed ( https://opensource.org/licenses/mit-license.php )
2018-12-28 18:58:37 +08:00
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\controller;
2019-05-22 18:42:52 +08:00
use app\service\CacheService;
2018-12-28 18:58:37 +08:00
/**
* 缓存管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Cache extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
2019-02-12 11:46:46 +08:00
$this->IsLogin();
2018-12-28 18:58:37 +08:00
// 权限校验
2019-02-12 11:46:46 +08:00
$this->IsPower();
2018-12-28 18:58:37 +08:00
}
/**
* [Index 首页]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-26T19:13:29+0800
*/
public function Index()
{
// 缓存类型
2021-07-18 23:42:10 +08:00
MyViewAssign('cache_type_list', CacheService::AdminCacheTypeList());
2018-12-28 18:58:37 +08:00
2021-07-18 23:42:10 +08:00
return MyView();
2018-12-28 18:58:37 +08:00
}
/**
* [StatusUpdate 站点缓存更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-26T19:53:14+0800
*/
public function StatusUpdate()
{
// 模板 cache
2021-07-18 23:42:10 +08:00
// 系统配置缓存 data
2021-07-25 15:19:51 +08:00
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'cache');
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'data');
2020-09-25 23:08:23 +08:00
2018-12-28 18:58:37 +08:00
return $this->success('更新成功');
}
/**
* [TemplateUpdate 模板缓存更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-26T19:53:14+0800
*/
public function TemplateUpdate()
{
// 模板 cache
2021-07-25 15:19:51 +08:00
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'index'.DS.'temp');
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'api'.DS.'temp');
2018-12-28 18:58:37 +08:00
return $this->success('更新成功');
}
/**
* [ModuleUpdate 模块缓存更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-26T19:53:14+0800
*/
public function ModuleUpdate()
{
return $this->success('更新成功');
}
/**
* [LogDelete 日志删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-26T19:53:14+0800
*/
public function LogDelete()
{
2021-07-25 15:19:51 +08:00
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'admin'.DS.'log');
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'index'.DS.'log');
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'api'.DS.'log');
2018-12-28 18:58:37 +08:00
return $this->success('更新成功');
}
}
?>