// +---------------------------------------------------------------------- namespace think; class Cache { /** * 操作句柄 * @var object * @access protected */ protected static $handler = null; /** * 连接缓存 * @access public * @param array $options 配置数组 * @return object */ public static function connect($options = []) { $type = !empty($options['type']) ? $options['type'] : 'File'; $class = '\\think\\cache\\driver\\' . ucwords($type); self::$handler = new $class($options); return self::$handler; } public static function __callStatic($method, $params) { return call_user_func_array([self::$handler, $method], $params); } }