diff --git a/config/cache.php b/config/cache.php index 3febcd57f9..3024c8700a 100644 --- a/config/cache.php +++ b/config/cache.php @@ -6,8 +6,6 @@ $config->cache->enable = false; // 是否开启缓存。Enable cache o $config->cache->lifetime = 5 * 60; // 缓存生存时间。The lifetime of cache. $config->cache->driver = 'File'; // 缓存驱动。 The driver of cache. can be File|Yac|Apcu. -$config->cache->enableDAO = false; // 是否开启 dao 缓存。Enable dao cache or not. -$config->cache->enableClient = false; // 是否开启客户端缓存。Enable client cache or not. $config->cache->enableFullPage = false; // 是否开启整页缓存。Enable full page cache or not. $config->cache->fullPageLifetime = 5 * 60; $config->cache->fullPageDriver = 'File'; @@ -35,5 +33,9 @@ $config->cacheKeys->bug = new stdclass(); $config->cacheKeys->bug->browse = 'bugBrowse%s'; $config->cache->dao = new stdClass(); +$config->cache->dao->enable = false; // 是否开启 dao 缓存。Enable dao cache or not. $config->cache->dao->lifetime = 60 * 60 * 24 * 30; // 缓存生存时间,默认为 30 天。The lifetime of cache, default is 30 days. $config->cache->dao->driver = 'Apcu'; // 缓存驱动,可以为 File|Yac|Apcu。The driver of cache. can be File|Yac|Apcu. + +$config->cache->client = new stdClass(); +$config->cache->client->enable = false; // 是否开启客户端缓存。Enable client cache or not. diff --git a/framework/base/control.class.php b/framework/base/control.class.php index d7417a0ce3..5059909385 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -1064,7 +1064,7 @@ class baseControl */ public function setResponseHeader() { - if($this->config->cache->enableClient && $this->app->useClientCache) + if($this->config->cache->client->enable && $this->app->useClientCache) { helper::setStatus(304); helper::end(); diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 09c5ec3e3d..a97e1db36d 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -198,7 +198,7 @@ class baseDAO $this->dbh = $dbh; $this->slaveDBH = $slaveDBH ? $slaveDBH : false; - if($config->cache->enableDAO) + if($config->cache->dao->enable) { $app->loadClass('cache', true); try diff --git a/module/install/ui/step3.html.php b/module/install/ui/step3.html.php index f00495c94c..f3c7ed4483 100644 --- a/module/install/ui/step3.html.php +++ b/module/install/ui/step3.html.php @@ -36,7 +36,7 @@ $configContent = <<webRoot = getWebRoot(); \$config->default->lang = '{$myConfig['defaultLang']}'; -\$config->cache->enableDAO = true; +\$config->cache->dao->enable = true; EOT; if($customSession) $configContent .= "\n\$config->customSession = true;"; diff --git a/module/install/zen.php b/module/install/zen.php index 48d5e77087..74baf96919 100644 --- a/module/install/zen.php +++ b/module/install/zen.php @@ -337,7 +337,7 @@ class installZen extends install \$config->webRoot = getWebRoot(); \$config->default->lang = getenv('ZT_DEFAULT_LANG'); -\$config->cache->enableDAO = true; +\$config->cache->dao->enable = true; \$hasSlaveDB = (string)getenv('ENABLE_DB_SLAVE'); if(\$hasSlaveDB && \$hasSlaveDB != 'false')