/** * alternative constructor * * @return void * * @throws \Exception */ public function init() { // inject classes $this->manager = $this->objectManager->getInstance('\\Noa\\Interfaces\\ConfigurationManagerInterface'); $this->request = $this->objectManager->getInstance('\\Noa\\Core\\Http\\Request'); $this->response = $this->objectManager->getInstance('\\Noa\\Core\\Http\\Response'); $this->sessionPath = $this->manager->getSessionPath(); }
/** * returns existing class instance * * @param string $class the class name * * @return mixed */ protected function inject($class) { return $this->objectManager->getInstance($class); }
/** * returns existing class instance * * @param string $class the class name * @param array $arguments optional class arguments * * @return mixed */ protected function inject($class, $arguments = array()) { $class = $this->objectManager->getInstance($class); return $class; }
/** * Returns teh SessionHandler instance * * @return DefaultSessionHandler */ protected function getCurrentSessionHandler() { $sessionHandlerClass = $this->manager->getSessionHandler(); $className = self::HANDLER_NAMESPACE . $sessionHandlerClass; return $this->objectManager->getInstance($className); }