mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
19 lines
408 B
PHP
19 lines
408 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Common\Exec;
|
|
|
|
use const PHP_SAPI;
|
|
use function Shlinkio\Shlink\Common\env;
|
|
|
|
abstract class ExecutionContext
|
|
{
|
|
public const WEB = 'shlink_web';
|
|
public const CLI = 'shlink_cli';
|
|
|
|
public static function currentContextIsSwoole(): bool
|
|
{
|
|
return PHP_SAPI === 'cli' && env('CURRENT_SHLINK_CONTEXT', self::WEB) === self::WEB;
|
|
}
|
|
}
|