- [refac] remove code of cache from admin module.

This commit is contained in:
liugang
2024-11-20 15:42:49 +08:00
committed by 朱金勇
parent c36e3e807c
commit 3f81e771e0
7 changed files with 0 additions and 118 deletions
-46
View File
@@ -590,50 +590,4 @@ class admin extends control
echo 'success';
}
/**
* 设置是否启用缓存。
* Set cache enable.
*
* @access public
* @return void
*/
public function cache()
{
if($_POST)
{
if(!extension_loaded('apcu')) return $this->send(array('result' => 'fail', 'message' => $this->lang->admin->apcuNotLoaded));
if(!ini_get('apc.enabled')) return $this->send(array('result' => 'fail', 'message' => $this->lang->admin->apcuNotEnabled));
$cache = form::data()->get();
$this->loadModel('setting')->setItem('system.common.global.cache', json_encode($cache));
if($cache->dao['enable'] != $this->config->cache->dao->enable) $this->dao->clearCache();
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => true));
}
if(helper::isAPCuEnabled())
{
$this->view->rate = $this->adminZen->getAPCuMemory('rate');
$this->view->used = $this->adminZen->getAPCuMemory('used');
$this->view->total = $this->adminZen->getAPCuMemory('total');
}
$this->view->title = $this->lang->admin->cache;
$this->display();
}
/**
* 清除数据缓存。
* Clear data cache.
*
* @access public
* @return void
*/
public function ajaxClearCache()
{
$this->dao->clearCache();
return $this->send(array('result' => 'success', 'message' => $this->lang->admin->clearSuccess, 'load' => true));
}
}