From 52fbea837ba5cecaa9c104c18515c43003117d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Thu, 28 Sep 2023 16:41:48 +0200 Subject: [PATCH] Bootstrap: use nella --- app/bootstrap.php | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index e341d6e3..341631f1 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -1,21 +1,28 @@ setDebugMode(getenv('NETTE_DEBUG') === '1'); -$configurator->enableTracy(__DIR__ . '/../var/log'); - -$configurator->setTimeZone('Europe/Prague'); -$configurator->setTempDirectory(__DIR__ . '/../var/tmp'); - -$configurator->createRobotLoader() - ->addDirectory(__DIR__) - ->register(); - -$configurator->addConfig(__DIR__ . '/../config/config.neon'); - -return $configurator->createContainer(); +namespace App; + +use Contributte\Bootstrap\ExtraConfigurator; +use Contributte\Nella\Boot\Bootloader; +use Contributte\Nella\Boot\Preset\NellaPreset; +use Nette\Application\Application; + +final class Bootstrap +{ + + public static function boot(): ExtraConfigurator + { + return Bootloader::create() + ->use(NellaPreset::create(__DIR__)) + ->boot(); + } + + public static function run(): void + { + self::boot() + ->createContainer() + ->getByType(Application::class) + ->run(); + } + +}