Gear::__construct PHP Method

__construct() public method

Preparation step before anything else.
public __construct ( $errorReporting )
    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();
    }

Usage Example

Example #1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     $this->locale = config('site.locale', 'en');
     $this->date_format = config('site.date_format', 'Y-m-d H:i');
     date_default_timezone_set(config('site.timezone', 'Europe/Moscow'));
     parent::__construct();
 }
All Usage Examples Of Gear::__construct