- [refac] remove code of cache from admin module.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user