mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-01 21:02:54 +09:00
Improve CLI check, added PHP dev server to sentry helper (#2105)
This commit is contained in:
1 parent
b9f5ca3cec
commit
b729da69fc
2 files changed
+5
-2
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user