diff --git a/src/Tempest/Core/src/GenericExceptionHandlerSetup.php b/src/Tempest/Core/src/GenericExceptionHandlerSetup.php index d2b390bc4..1013e87d1 100644 --- a/src/Tempest/Core/src/GenericExceptionHandlerSetup.php +++ b/src/Tempest/Core/src/GenericExceptionHandlerSetup.php @@ -18,7 +18,7 @@ public function setup(AppConfig $appConfig): void } // Console - if ($_SERVER['argv'] ?? null) { + if (PHP_SAPI === 'cli') { (new Collision())->register(); return; diff --git a/src/Tempest/Framework/Application/ApplicationInitializer.php b/src/Tempest/Framework/Application/ApplicationInitializer.php index f30683ca1..f26e3c322 100644 --- a/src/Tempest/Framework/Application/ApplicationInitializer.php +++ b/src/Tempest/Framework/Application/ApplicationInitializer.php @@ -18,7 +18,7 @@ #[Singleton] public function initialize(Container $container): Application { - if (isset($_SERVER['argv'])) { + if (PHP_SAPI === 'cli') { return new ConsoleApplication( container: $container, appConfig: $container->get(AppConfig::class),