选择语言 :

 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
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');
}