手动指定runtime目录后session还是原来目录问题感觉像是问题呢

浏览:366 发布日期:2020/07/16 分类:ThinkPHP6专区
手动指定runtime目录后,session目录还依旧保持原来的目录中。经看源码才知道# \vendor\topthink\framework\src\think\session\driver\File.php
    public function __construct(App $app, array $config = [])
    {
        $this->config = array_merge($this->config, $config);

        if (empty($this->config['path'])) {
            $this->config['path'] = $app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'session' . DIRECTORY_SEPARATOR;
        } elseif (substr($this->config['path'], -1) != DIRECTORY_SEPARATOR) {
            $this->config['path'] .= DIRECTORY_SEPARATOR;
        }

        $this->init();
    }
才知道session需要配置path才可以(session配置中也没提起此参数),问题是这里不应该调用getRuntimePath()方法么?
最佳答案
评论( 相关
后面还有条评论,点击查看>>