Skip to content

Commit

Permalink
php/php拡張のセッションハンドラを利用できるように対応
Browse files Browse the repository at this point in the history
  • Loading branch information
chihiro-adachi committed Aug 31, 2016
1 parent d3b3ff6 commit c84998c
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 c84998c

Please sign in to comment.