+ installModel: enable dao cache by if apcu is enabled.
This commit is contained in:
@@ -418,4 +418,26 @@ class installModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启 dao 缓存。
|
||||
* Enable dao cache.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function enableDaoCache(): bool
|
||||
{
|
||||
if(!helper::isAPCuEnabled()) return false;
|
||||
|
||||
$cache = new stdclass();
|
||||
$cache->owner = 'system';
|
||||
$cache->module = 'common';
|
||||
$cache->section = 'global';
|
||||
$cache->key = 'cache';
|
||||
$cache->value = '{"dao":{"enable":"1"}}';
|
||||
$this->dao->replace(TABLE_CONFIG)->data($cache)->exec();
|
||||
|
||||
return !dao::isError();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user