* @package cache * @link https://www.zentao.net */ class cacheModel extends model { /** * 清空缓存。 * Clear the cache. * * @access public * @return void */ public function clear() { /* 多应用共享时采用遍历删除的方式,所以需要先关闭缓存,清空之后再打开。When multiple applications share the cache, the cache needs to be closed first, cleared, and then opened. */ $needStop = $this->config->cache->scope == 'shared'; if($needStop) $this->loadModel('setting')->setItem('system.common.cache.enable', 0); $this->mao->clearCache(); if($needStop) $this->setting->setItem('system.common.cache.enable', 1); } }