Fix bin/publish: use correct .env path for rspade_system Fix bin/publish script: prevent grep exit code 1 from terminating script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
699 B
PHP
Executable File
29 lines
699 B
PHP
Executable File
<?php
|
|
|
|
namespace Spatie\FlareClient\Context;
|
|
|
|
class BaseContextProviderDetector implements ContextProviderDetector
|
|
{
|
|
public function detectCurrentContext(): ContextProvider
|
|
{
|
|
if ($this->runningInConsole()) {
|
|
return new ConsoleContextProvider($_SERVER['argv'] ?? []);
|
|
}
|
|
|
|
return new RequestContextProvider();
|
|
}
|
|
|
|
protected function runningInConsole(): bool
|
|
{
|
|
if (isset($_ENV['APP_RUNNING_IN_CONSOLE'])) {
|
|
return $_ENV['APP_RUNNING_IN_CONSOLE'] === 'true';
|
|
}
|
|
|
|
if (isset($_ENV['FLARE_FAKE_WEB_REQUEST'])) {
|
|
return false;
|
|
}
|
|
|
|
return in_array(php_sapi_name(), ['cli', 'phpdb']);
|
|
}
|
|
}
|