Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
gilour
/
vendor
/
facade
/
flare-client-php
/
src
/
Context
:
ContextContextDetector.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace Facade\FlareClient\Context; class ContextContextDetector implements ContextDetectorInterface { public function detectCurrentContext(): ContextInterface { if ($this->runningInConsole()) { return new ConsoleContext($_SERVER['argv'] ?? []); } return new RequestContext(); } private function runningInConsole(): bool { if (isset($_ENV['APP_RUNNING_IN_CONSOLE'])) { return $_ENV['APP_RUNNING_IN_CONSOLE'] === 'true'; } return in_array(php_sapi_name(), ['cli', 'phpdb']); } }