\think\session\driverRedis

Summary

Methods
Properties
Constants
__construct()
open()
close()
read()
write()
destroy()
gc()
lock()
unlock()
No public properties found
No constants found
No protected methods found
$handler
$config
N/A
No private methods found
No private properties found
N/A

Properties

$handler

$handler : \Redis

Type

\Redis —

$config

$config

Methods

__construct()

__construct(mixed  $config = []) : mixed

Parameters

mixed $config

Returns

mixed —

open()

open(string  $savePath, mixed  $sessName) : bool

打开Session

Parameters

string $savePath
mixed $sessName

Throws

\think\Exception

Returns

bool —

close()

close() : mixed

关闭Session

Returns

mixed —

read()

read(string  $sessID) : string

读取Session

Parameters

string $sessID

Returns

string —

write()

write(string  $sessID, string  $sessData) : bool

写入Session

Parameters

string $sessID
string $sessData

Returns

bool —

destroy()

destroy(string  $sessID) : bool

删除Session

Parameters

string $sessID

Returns

bool —

gc()

gc(string  $sessMaxLifeTime) : bool

Session 垃圾回收

Parameters

string $sessMaxLifeTime

Returns

bool —

lock()

lock(string  $sessID, int  $timeout = 10) : bool

Redis Session 驱动的加锁机制

Parameters

string $sessID

用于加锁的sessID

int $timeout

默认过期时间

Returns

bool —

unlock()

unlock(string  $sessID) : mixed

Redis Session 驱动的解锁机制

Parameters

string $sessID

用于解锁的sessID

Returns

mixed —