数据库¶
数据库方式 Session 处理器
属性 | 值 |
---|---|
命名空间 | fize\session\handler |
类名 | Database |
实现接口 | SessionHandlerInterface |
方法: |
---|
方法名 | 说明 |
---|---|
__construct() | 构造 |
open() | 打开 session |
close() | 关闭 session |
read() | 读取 Session |
write() | 写入 Session |
destroy() | 删除 Session |
gc() | 垃圾回收 Session |
initMysql() | 针对MySQL初始化 |
方法¶
open()¶
打开 session
public function open (
string $save_path,
string $session_name
) : bool
参数: |
|
---|
write()¶
写入 Session
public function write (
string $session_id,
string $session_data
) : bool
参数: |
|
---|
destroy()¶
删除 Session
public function destroy (
string $session_id
) : bool
参数: |
|
---|
initMysql()¶
针对MySQL初始化
public static function initMysql (
array $config
)
参数: |
|
---|
如果尚未建立 session 表,可以运行该方法来建立表