Ejemplo n.º 1
0
 public function __construct(Uri $uri, $errorReporting)
 {
     $this->uri = $uri;
     $this->config = Config::main();
     $this->uri->setConfig(['defaultController' => $this->config['defaultController'], 'defaultAction' => $this->config['defaultAction']]);
     $this->response = Response::getInstance();
     // Exception handler
     $exception = new Exception($this->response);
     set_exception_handler([$exception, 'main']);
     set_error_handler([$exception, 'errorHandler'], $errorReporting);
     $this->firstUriPath = ucwords($this->uri->getController());
     $this->requstHandler = $this->config['requestHandlerRule'];
     $handler = current($this->requstHandler);
     $this->{$handler}();
 }