<?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']);
}
}
If you encounter any issues or need assistance, please reach out to our dedicated developer support team Contact Us
Thank you for choosing Kueue Pay Payment Gateway Solutions! We look forward to seeing your integration thrive and provide a seamless payment experience for your valued customers.