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