CacheModel::__construct PHP Method

__construct() public method

初始化缓存模型对象,缓存类型
public __construct ( $type = '' )
    public function __construct($type = '')
    {
        if (!C('DATA_CACHE_TYPE_ONLY')) {
            $type = model('Xdata')->get('cacheconfig:cachetype');
            if ($type == 'Memcache') {
                $servers = model('Xdata')->get('cacheconfig:cachesetting');
                C('MEMCACHE_HOST', $servers);
            }
        }
        !$type && ($type = $this->type);
        $this->type = strtoupper($type);
        $this->handler = Cache::getInstance($type);
    }