mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 10:02:12 +09:00
Migrate cache configuration format, keeping backward compatibility
This commit is contained in:
parent
194cf3fa70
commit
050a507707
8 changed files with 70 additions and 28 deletions
|
|
@ -673,17 +673,21 @@ class adminAdminController extends admin
|
|||
{
|
||||
if ($vars->object_cache_type === 'memcached' || $vars->object_cache_type === 'redis')
|
||||
{
|
||||
$cache_config = $vars->object_cache_type . '://' . $vars->object_cache_host . ':' . intval($vars->object_cache_port);
|
||||
$cache_servers = array($vars->object_cache_type . '://' . $vars->object_cache_host . ':' . intval($vars->object_cache_port));
|
||||
}
|
||||
else
|
||||
{
|
||||
$cache_config = $vars->object_cache_type;
|
||||
$cache_servers = array();
|
||||
}
|
||||
if (!Rhymix\Framework\Cache::getCacheDriver($vars->object_cache_type, array($cache_config)))
|
||||
if (!Rhymix\Framework\Cache::getCacheDriver($vars->object_cache_type, $cache_servers))
|
||||
{
|
||||
return new Object(-1, 'msg_cache_handler_not_supported');
|
||||
}
|
||||
Rhymix\Framework\Config::set('cache', array($cache_config));
|
||||
Rhymix\Framework\Config::set('cache', array(
|
||||
'type' => $vars->object_cache_type,
|
||||
'ttl' => intval($vars->cache_default_ttl ?: 86400),
|
||||
'servers' => $cache_servers,
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue