check($token, $user_id); } /** * 读取Token * @access public * @param string $token Token标识 * @param mixed $default 默认值 * @return mixed */ public static function get($token, $default = false) { return self::init()->get($token) ?: $default; } /** * 写入Token * @access public * @param string $token Token标识 * @param mixed $user_id 会员ID * @param int|null $expire 有效时间 0为永久 * @return boolean */ public static function set($token, $user_id, $expire = null) { return self::init()->set($token, $user_id, $expire); } /** * 删除Token(delete别名) * @access public * @param string $token Token标识 * @return boolean */ public static function rm($token) { return self::delete($token); } /** * 删除Token * @param string $token 标签名 * @return bool */ public static function delete($token) { return self::init()->delete($token); } /** * 清除Token * @access public * @param int $user_id 会员ID * @return boolean */ public static function clear($user_id = null) { return self::init()->clear($user_id); } }