Skip to content

Commit ee84b94

Browse files
authored
fix: properly detect application (tempestphp#456)
1 parent f466b7d commit ee84b94

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Tempest/Core/src/GenericExceptionHandlerSetup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function setup(AppConfig $appConfig): void
1818
}
1919

2020
// Console
21-
if ($_SERVER['argv'] ?? null) {
21+
if (PHP_SAPI === 'cli') {
2222
(new Collision())->register();
2323

2424
return;

src/Tempest/Framework/Application/ApplicationInitializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#[Singleton]
1919
public function initialize(Container $container): Application
2020
{
21-
if (isset($_SERVER['argv'])) {
21+
if (PHP_SAPI === 'cli') {
2222
return new ConsoleApplication(
2323
container: $container,
2424
appConfig: $container->get(AppConfig::class),

0 commit comments

Comments
 (0)