* Add cache for block.
This commit is contained in:
@@ -150,6 +150,7 @@ class baseModel
|
||||
|
||||
$this->loadDAO();
|
||||
$this->setSuperVars();
|
||||
$this->loadCache();
|
||||
|
||||
/**
|
||||
* 读取当前模块的tao类。
|
||||
@@ -323,6 +324,21 @@ class baseModel
|
||||
$this->dao = $dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载缓存类。
|
||||
* Load cache class.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function loadCache()
|
||||
{
|
||||
if($this->config->cache->enable != true) return;
|
||||
$this->app->loadClass('cache', $static = true);
|
||||
$namespace = isset($this->session->user->account) ? $this->session->user->account : 'guest';
|
||||
$this->cache = cache::create($this->config->cache->driver, $namespace, $this->config->cache->lifetime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录。
|
||||
* Delete one record.
|
||||
|
||||
Reference in New Issue
Block a user