mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Updated config so that shlink logger dynamically uses standard output when running with swoole
This commit is contained in:
18
module/Common/src/Exec/ExecutionContext.php
Normal file
18
module/Common/src/Exec/ExecutionContext.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user