/** * Preparation step before anything else. */ public function __construct($errorReporting) { error_reporting($errorReporting); spl_autoload_register([$this, 'loader']); set_exception_handler('Resources\\RunException::main'); set_error_handler('Resources\\RunException::errorHandlerCallback', error_reporting()); $this->config['main'] = Resources\Config::main(); $this->uriObj = new Resources\Uri(); $this->uriObj->setDefaultController($this->config['main']['defaultController']); self::$uri = $this->uriObj; $this->firstUriPath = ucwords($this->uriObj->getClass()); $this->controllerHandler(); }