Skip to content

Commit

Permalink
Merge pull request #1720 from chihiro-adachi/session-handler
Browse files Browse the repository at this point in the history
セッションハンドラのオプション化
  • Loading branch information
ryo-endo committed Sep 2, 2016
2 parents b3079a9 + c84998c commit 082d3e0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Eccube/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public function initConfig()
->parseConfig('log', $configAll)
->parseConfig('nav', $configAll, true)
->parseConfig('doctrine_cache', $configAll)
->parseConfig('http_cache', $configAll);
->parseConfig('http_cache', $configAll)
->parseConfig('session_handler', $configAll);

return $configAll;
});
Expand Down Expand Up @@ -239,6 +240,15 @@ public function initSession()
// http://blog.tokumaru.org/2011/10/cookiedomain.html
),
));

$options = $this['config']['session_handler'];

if ($options['enabled']) {
// @see http://silex.sensiolabs.org/doc/providers/session.html#custom-session-configurations
$this['session.storage.handler'] = null;
ini_set('session.save_handler', $options['save_handler']);
ini_set('session.save_path', $options['save_path']);
}
}

public function initRendering()
Expand Down
15 changes: 15 additions & 0 deletions src/Eccube/Resource/config/session_handler.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# PHP/PHP拡張のセッションハンドラを利用する場合, enable: trueに設定します。
session_handler:
enabled: false

## memcache
# save_handler: memcache
# save_path: 127.0.0.1:11211

## memcached
# save_handler: memcached
# save_path: 127.0.0.1:11211

## redis
# save_handler: redis
# save_path: 127.0.0.1:6379

0 comments on commit 082d3e0

Please sign in to comment.