1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-08 09:49:49 +08:00
jacky huang a93ce8e293
v1.2.3 (#19)
* 去除无用的auth_url

* 修改readme

* 修复计划任务生成sitemap.xml失败问题

* 增加课程推荐

* 增加后台刷新首页缓存小工具

* 调整公众号模板消息

* 增加刷新首页推荐课程缓存逻辑

* 更新课程综合评分算法

* 修复在线用户并发重复记录问题

* 增加限制共享帐号功能

* 修复数据迁移中无符号整型问题

* 更新版本为v1.2.3
2021-01-03 15:13:40 +08:00

36 lines
826 B
PHP

<?php
namespace App\Providers;
use Phalcon\Config;
use Phalcon\Session\Adapter\Redis as RedisSession;
class Session extends Provider
{
protected $serviceName = 'session';
public function register()
{
/**
* @var Config $config
*/
$config = $this->di->getShared('config');
$this->di->setShared($this->serviceName, function () use ($config) {
$session = new RedisSession([
'host' => $config->path('redis.host'),
'port' => $config->path('redis.port'),
'auth' => $config->path('redis.auth'),
'lifetime' => $config->path('session.lifetime') ?: 24 * 3600,
'prefix' => '_SESSION_:',
]);
$session->start();
return $session;
});
}
}