// 读取session驱动
$class = false !== strpos($config['type'], '\\') ? $config['type'] : '\\think\\session\\driver\\' . ucwords($config['type']);
// 检查驱动类
if (!class_exists($class) || !session_set_save_handler(new $class($config))) {
throw new ClassNotFoundException('error session handler:' . $class, $class);
}
}
if ($isDoStart) {
session_start();
self::$init = true;
} else {
self::$init = false;
}
}
/**
* session自动启动或者初始化
* @return void
config | { "id": "", "var_session_id": "", "prefix": "think", "type": "", "auto_start": true, "expire": "3600" } |
isDoStart | true |