Skip to content

Commit

Permalink
修正session不会使用file类型问题;
Browse files Browse the repository at this point in the history
修正短信配置文件路径识别错误问题;
session的默认配置示例文件中默认启用
  • Loading branch information
Donny committed Apr 11, 2018
1 parent 87bd64c commit 7981d5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sample-config/session.config.sample.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"enabled":false,
"enabled":true,
"adapter":"redis", //redis|file
"option":{
"uniqueId":"KG_",
Expand Down
7 changes: 4 additions & 3 deletions src/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ private static function injectSmsService()
$di = self::$di;
self::$di->set(
'sms', function () use ($config, $di) {
$smsAdapter = \Kuga\Core\Sms\SmsFactory::getAdapter($config->sms->adapter, $config->sms->adapter, $di);
$adapter = $config->sms->adapter;
$smsAdapter = \Kuga\Core\Sms\SmsFactory::getAdapter($adapter, $config->sms->{$adapter}, $di);

return $smsAdapter;
}
Expand Down Expand Up @@ -279,11 +280,11 @@ private static function injectSessionService(){
$session = new \Phalcon\Session\Adapter\Files($sessionOption);
$option = $sessionOption;
}
self::$di->setShared('session', function() use($option){
self::$di->setShared('session', function() use($option,$session){
if (isset($_POST['sessid'])){
session_id($_POST['sessid']);
}
$session = new \Phalcon\Session\Adapter\Redis($option);
//$session = new \Phalcon\Session\Adapter\Redis($option);
ini_set('session.cookie_domain', \Qing\Lib\Application::getCookieDomain());
ini_set('session.cookie_path', '/');
ini_set('session.cookie_lifetime', 86400);
Expand Down

0 comments on commit 7981d5c

Please sign in to comment.