选择语言 :

 Module_Storage_Driver_Redis::__construct

Redis缓存驱动器

null Module_Storage_Driver_Redis::__construct( [ $config_name $config_name = string(7) "default" ] )

参数列表

参数 类型 描述 默认值
$config_name $config_name 配置名或数组 string(7) "default"
File: ./modules/storage/driver/redis.class.php
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
public function __construct($config_name = 'default')
{
    if (is_array($config_name))
    {
        $this->servers = $config_name;
        $config_name = md5(serialize($config_name));
    }
    else
    {
        $this->servers = Core::config('storage/redis.' . $config_name);
    }
 
    if (!is_array($this->servers))
    {
        throw new Exception(__('The storage redis config :config does not exist', array(':config'=>$config_name)));
    }
    $this->config_name = $config_name;
 
    $this->_connect();
 
    # 增加自动关闭连接列队
    Core::add_close_connect_class('Storage_Driver_Redis');
}