选择语言 :

 Driver_Cache_Driver_Memcache::__construct

Memcache缓存驱动器

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

参数列表

参数 类型 描述 默认值
$config_name $config_name 配置名或数组 string(7) "default"
File: ./drivers/cache/memcache/memcache.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('cache/memcache.' . $config_name);
    }

    if (!is_array($this->servers))
    {
        throw new Exception(__('The memcache config :config does not exist', array(':config'=>$config_name)));
    }

    $this->config_name = $config_name;

    $this->_connect();

    # 增加自动关闭连接列队
    Core::add_close_connect_class('Cache_Driver_Memcache');
}