diff --git a/src/library/FOSSBilling/Environment.php b/src/library/FOSSBilling/Environment.php index 511a46d14..67efff83e 100644 --- a/src/library/FOSSBilling/Environment.php +++ b/src/library/FOSSBilling/Environment.php @@ -60,6 +60,6 @@ class Environment */ public static function isCLI(): bool { - return php_sapi_name() === 'cli' || !http_response_code(); + return PHP_SAPI === 'cli' || defined('STDIN') || !http_response_code(); } } diff --git a/src/library/FOSSBilling/SentryHelper.php b/src/library/FOSSBilling/SentryHelper.php index 2d6d71ee1..3d9fdfdd1 100644 --- a/src/library/FOSSBilling/SentryHelper.php +++ b/src/library/FOSSBilling/SentryHelper.php @@ -52,7 +52,8 @@ class SentryHelper { $sentryDSN = '--replace--this--during--release--process--'; - $httpClient = new class() implements HttpClientInterface { + $httpClient = new class() implements HttpClientInterface + { public function sendRequest(Request $request, Options $options): Response { $dsn = $options->getDsn(); @@ -179,6 +180,8 @@ class SentryHelper return 'Litespeed'; } elseif (stripos(strtolower($serverSoftware), 'nginx') !== false) { return 'NGINX'; + } elseif (PHP_SAPI === 'cli-server') { + return 'PHP Development Server'; } else { return 'Unknown'; }