relations = $relations; $this->definitions = $definitions; } /** * Create Environment object * * @return EnvironmentInterface */ public function createEnvironment() { switch ($this->getMode()) { case Compiled::MODE: return new Compiled($this); break; default: return new Developer($this); } } /** * Determinate running mode * * @return string */ private function getMode() { if (file_exists(ConfigLoader\Compiled::getFilePath(Area::AREA_GLOBAL))) { return Compiled::MODE; } return Developer::MODE; } /** * Returns definitions * * @return DefinitionInterface */ public function getDefinitions() { return $this->definitions; } /** * Returns relations * * @return RelationsInterface */ public function getRelations() { return $this->relations; } }