PHP 8.2.30
Preview: BaseContextProviderDetector.php Size: 699 B
/proc/thread-self/root/home/byroehnu/easetack.com/vendor/spatie/flare-client-php/src/Context/BaseContextProviderDetector.php

<?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']);
    }
}

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
699 B lrw-rw-rw- 2025-02-14 13:42:06
Edit Download
540 B lrw-rw-rw- 2025-02-14 13:42:06
Edit Download
170 B lrw-rw-rw- 2025-02-14 13:42:06
Edit Download
145 B lrw-rw-rw- 2025-02-14 13:42:06
Edit Download
4.34 KB lrw-rw-rw- 2025-02-14 13:42:06
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).