di->setShared($this->serviceName, function () { $config = $this->getShared('config'); $session = new RedisSession([ 'host' => $config->redis->host, 'port' => $config->redis->port, 'auth' => $config->redis->auth, 'index' => $config->redis->index, 'lifetime' => $config->session->lifetime, ]); $session->start(); return $session; }); } }