di->setShared($this->serviceName, function () { $config = $this->getShared('config'); $frontend = new JsonFrontend([ 'lifetime' => $config->redis->lifetime, ]); $backend = new RedisBackend($frontend, [ 'host' => $config->redis->host, 'port' => $config->redis->port, 'auth' => $config->redis->auth, ]); return $backend; }); } }