Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

セッションハンドラのオプション化 #1720

Merged
merged 1 commit into from
Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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