/** * Loads the basic components into the Container * * @return void */ private function initializeBasicComponents() { $this->initializeConfig(); $this->loadDoctrine(); $this->container->set('request', $this->container->share(function ($c) { return new Request($c->get('logger')); })); $this->container->set('session', $this->container->share(function ($c) { return new Session($c->get('config')); })); $this->container->set('auth', $this->container->share(function ($c) { return new Auth($c->get('config'), $c->get('session')); })); $this->container->set('language', $this->container->share(function ($c) { return new Language($c->get('config'), $c->get('yaml')); })); $this->container->set('router', $this->container->share(function ($c) { return new Router($c->get('config')->get('base'), $c->get('config')->get('base_dir'), $c->get('auth'), $c->get('logger'), $c->get('request')); })); $this->container->set('template', $this->container->share(function ($c) { $template = new Template(''); $template->setLanguage($c->get('language')); $template->setConfig($c->get('config')); $template->setAuth($c->get('auth')); return $template; })); $this->container->set('loader', $this->container->share(function ($c) { return new Loader($c); })); }