Updated config so that shlink logger dynamically uses standard output when running with swoole

This commit is contained in:
Alejandro Celaya
2018-11-24 09:29:51 +01:00
parent 16590b2dbb
commit 2fc2ad98aa
6 changed files with 37 additions and 4 deletions

View 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;
}
}