类 CacheSession
CacheSession 提供将会话保存到缓存引擎的方法。与 Session 一起使用
属性摘要
- 
        $_options protectedarray<string, mixed>此会话引擎的选项 
方法摘要
- 
          __construct() public构造函数。 
- 
          close() public在关闭数据库会话时调用的方法。 
- 
          destroy() public在销毁缓存会话时调用的方法。 
- 
          gc() public无操作方法。始终返回 0,因为缓存引擎没有垃圾回收。 
- 
          open() public在打开数据库会话时调用的方法。 
- 
          read() public用于从缓存会话读取的方法。 
- 
          write() public在为缓存会话写入时调用的辅助函数。 
方法详细说明
__construct() ¶ public
__construct(array<string, mixed> $config = [])构造函数。
参数
- 
                array<string, mixed>$config 可选
- 要用于此引擎的配置,它需要密钥 'config',它是用于存储会话的缓存配置的名称 
抛出
InvalidArgumentException如果未提供 'config' 密钥
gc() ¶ public
gc(int $max_lifetime): int|false无操作方法。始终返回 0,因为缓存引擎没有垃圾回收。
参数
- 
                int$max_lifetime
- 在过去 maxlifetime 秒内未更新的会话将被删除。 
返回
int|falseopen() ¶ public
open(string $path, string $name): bool在打开数据库会话时调用的方法。
参数
- 
                string$path
- 存储/检索会话的路径。 
- 
                string$name
- 会话名称。 
返回
boolread() ¶ public
read(string $id): string|false用于从缓存会话读取的方法。
参数
- 
                string$id
- 在缓存中唯一标识会话的 ID。 
返回
string|falsewrite() ¶ public
write(string $id, string $data): bool在为缓存会话写入时调用的辅助函数。
参数
- 
                string$id
- 在缓存中唯一标识会话的 ID。 
- 
                string$data
- 要保存的数据。 
返回
bool