mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Fixed execution on non-swoole contexts
This commit is contained in:
@@ -13,11 +13,17 @@ use Mezzio\Swoole;
|
|||||||
use function class_exists;
|
use function class_exists;
|
||||||
use function Shlinkio\Shlink\Common\env;
|
use function Shlinkio\Shlink\Common\env;
|
||||||
|
|
||||||
|
use const PHP_SAPI;
|
||||||
|
|
||||||
|
$isCli = PHP_SAPI === 'cli';
|
||||||
|
|
||||||
return (new ConfigAggregator\ConfigAggregator([
|
return (new ConfigAggregator\ConfigAggregator([
|
||||||
Mezzio\ConfigProvider::class,
|
Mezzio\ConfigProvider::class,
|
||||||
Mezzio\Router\ConfigProvider::class,
|
Mezzio\Router\ConfigProvider::class,
|
||||||
Mezzio\Router\FastRouteRouter\ConfigProvider::class,
|
Mezzio\Router\FastRouteRouter\ConfigProvider::class,
|
||||||
class_exists(Swoole\ConfigProvider::class) ? Swoole\ConfigProvider::class : new ConfigAggregator\ArrayProvider([]),
|
$isCli && class_exists(Swoole\ConfigProvider::class)
|
||||||
|
? Swoole\ConfigProvider::class
|
||||||
|
: new ConfigAggregator\ArrayProvider([]),
|
||||||
ProblemDetails\ConfigProvider::class,
|
ProblemDetails\ConfigProvider::class,
|
||||||
Diactoros\ConfigProvider::class,
|
Diactoros\ConfigProvider::class,
|
||||||
Common\ConfigProvider::class,
|
Common\ConfigProvider::class,
|
||||||
|
|||||||
Reference in New Issue
Block a user