settings = $settings; //Привязываем класс маршрутизации с установкой префикса $this->route = Route::single()->setPrefix($this->settings->getRootPath()); //Создаем класс менеджера для базы данных $this->dbManager = new Capsule(); //Создаем класс для аутентификации на основе настроек приложения $this->auth = new $this->settings->app['auth']; //Настройка для работы с базой данных $this->dbRun(); //Инициализация класса пользователя на основе настроек приложения $this->auth::init(new $this->settings->app['identity']); } public function __get($key) { switch ($key) { case 'settings': return $this->settings; case 'route': return $this->route; case 'auth': return $this->auth; } throw new Error('Accessing a non-existent property'); } private function dbRun() { $this->dbManager->addConnection($this->settings->getDbSetting()); $this->dbManager->setEventDispatcher(new Dispatcher(new Container)); $this->dbManager->setAsGlobal(); $this->dbManager->bootEloquent(); } public function run(): void { //Запуск маршрутизации $this->route->start(); } }