From 912490cb7e8abeab32fe856f794cc6bbd0ec540d Mon Sep 17 00:00:00 2001 From: dapphp Date: Sun, 7 Nov 2021 09:57:59 -0800 Subject: [PATCH] Update code to use the same config key defined in section Initializing the Session Manager Signed-off-by: dapphp --- docs/book/manager.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/book/manager.md b/docs/book/manager.md index c61f15f9..74695d0c 100644 --- a/docs/book/manager.md +++ b/docs/book/manager.md @@ -88,11 +88,11 @@ class Module $container->httpUserAgent = $request->getServer()->get('HTTP_USER_AGENT'); $config = $serviceManager->get('Config'); - if (! isset($config['session'])) { + if (! isset($config['session_manager'])) { return; } - $sessionConfig = $config['session']; + $sessionConfig = $config['session_manager']; if (! isset($sessionConfig['validators'])) { return; @@ -123,23 +123,18 @@ class Module 'factories' => [ SessionManager::class => function ($container) { $config = $container->get('config'); - if (! isset($config['session'])) { + if (! isset($config['session_manager'])) { $sessionManager = new SessionManager(); Container::setDefaultManager($sessionManager); return $sessionManager; } - $session = $config['session']; + $session = $config['session_manager']; $sessionConfig = null; if (isset($session['config'])) { - $class = isset($session['config']['class']) - ? $session['config']['class'] - : SessionConfig::class; - - $options = isset($session['config']['options']) - ? $session['config']['options'] - : []; + $class = $session['config']['class'] ?? SessionConfig::class; + $options = $session['config']['options'] ?? []; $sessionConfig = new $class(); $sessionConfig->setOptions($options);