* [refac] refactor configuration of result caches.
This commit is contained in:
+7
-7
@@ -22,16 +22,16 @@ $config->redis->cache->raw[TABLE_RELEASE] = 'id';
|
||||
$config->redis->cache->raw[TABLE_USER] = 'account';
|
||||
|
||||
$config->redis->cache->res = [];
|
||||
$config->redis->cache->res['module'][] = ['key' => 'CACHE_MODULE_TREE', 'params' => ['type', 'root', 'branch']];
|
||||
$config->redis->cache->res[TABLE_MODULE][] = ['name' => 'CACHE_MODULE_TREE', 'fields' => ['type', 'root', 'branch']];
|
||||
|
||||
$config->redis->cache->res['user'][] = ['key' => 'CACHE_USER_PAIRS'];
|
||||
|
||||
foreach($config->redis->cache->res as $module => $caches)
|
||||
$config->cache->keys = [];
|
||||
foreach($config->redis->cache->res as $table => $caches)
|
||||
{
|
||||
foreach($caches as $cache)
|
||||
{
|
||||
$key = $cache['key'];
|
||||
$value = str_replace('_', ':', strtolower($cache['key']));
|
||||
define($key, $value);
|
||||
$cache = (object)$cache;
|
||||
$cache->table = $table;
|
||||
$config->cache->keys[$cache->name] = $cache;
|
||||
define($cache->name, $cache->name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user