File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 55namespace Tempest \Http ;
66
77use Tempest \Container \Container ;
8+ use Tempest \Container \Singleton ;
89use Tempest \Core \AppConfig ;
910use Tempest \Core \Application ;
1011use Tempest \Core \Kernel ;
1617use Tempest \Support \PathHelper ;
1718use Throwable ;
1819
20+ #[Singleton]
1921final readonly class HttpApplication implements Application
2022{
2123 public function __construct (private Container $ container )
@@ -29,17 +31,11 @@ public static function boot(
2931 ): self {
3032 $ container = Tempest::boot ($ root , $ discoveryLocations );
3133
32- // Application,
33- // TODO: can be refactored to resolve via the container
34- $ application = new HttpApplication ($ container );
35-
36- $ container ->singleton (Application::class, fn () => $ application );
37-
38- $ root = $ container ->get (Kernel::class)->root ;
34+ $ application = $ container ->get (HttpApplication::class);
3935
4036 // Application-specific setup
4137 $ logConfig = $ container ->get (LogConfig::class);
42- $ logConfig ->debugLogPath = PathHelper::make ($ root , '/log/debug.log ' );
38+ $ logConfig ->debugLogPath = PathHelper::make ($ container -> get (Kernel::class)-> root , '/log/debug.log ' );
4339 $ logConfig ->serverLogPath = env ('SERVER_LOG ' );
4440 $ logConfig ->channels [] = new AppendLogChannel (PathHelper::make ($ root , '/log/tempest.log ' ));
4541
You can’t perform that action at this time.
0 commit comments