/** * * @return Environment */ public function getGwEnvironment($lang) { $mongoService = $this->getContainer()->get('app.mongo'); /* @var $mongoService MongoService */ $mongoDB = $mongoService->getCacheDatabase(); $cache = new MongoCache($mongoDB); $env = new Environment($lang); $env->setCache($cache); $env->setStorage(new MongoStorage($mongoDB)); return $env; }
/** * * @return Environment */ public function getGwEnvironment() { if (empty($this->gwEnvironment)) { $mongoService = $this->get('app.mongo'); /* @var $mongoService MongoService */ $mongoDB = $mongoService->getCacheDatabase(); $cache = new MongoCache($mongoDB); $env = new Environment($this->getTranslator()->getLocale()); $env->setCache($cache); $env->setStorage(new MongoStorage($mongoDB)); $this->gwEnvironment = $env; } return $this->gwEnvironment; }