public function __construct() { $this->routes = Settings::Get('routes')->Values(['routes']); $this->max_route_attempts = Settings::Get()->Value(['origin', 'max_route_attempts']); if (!$this->routes->offsetExists('*')) { throw new Exception('You must specify a default route in your routes file.'); } if (!$this->routes->offsetExists('404')) { throw new Exception('You must specify a 404 route in your routes file.'); } }
public function __construct($database_name = null) { if ($database_name === null) { throw new Exception('Invalid database name passed. Please check the call and try again.'); } $this->connection_parameters = Settings::Get('databases')->Values([$database_name]); if (!$this->Connect()) { throw new Exception('Unable to connect to database: ' . $database_name . ' - ' . $this->error); } }
public function __construct($file = null) { $this->generic_log_file = Settings::Get('settings')->Value(['origin', 'generic_log_file']); $this->minimum_log_level = (int) Settings::Get('settings')->Value(['origin', 'log_level']); $this->file = $file === null ? 'log.log' : $file . '.log'; }