From a4f979be080d563419e9df378babf5af2fdd961f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 27 Aug 2022 17:27:54 +0200 Subject: [PATCH] Enabled support for static files from public dir via RoadRunner --- config/config.php | 7 ++----- config/roadrunner/.rr.dev.yml | 1 + config/roadrunner/.rr.yml | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/config.php b/config/config.php index 1c4fa40b..088cad0a 100644 --- a/config/config.php +++ b/config/config.php @@ -13,14 +13,11 @@ use Shlinkio\Shlink\Config\ConfigAggregator\EnvVarLoaderProvider; use function class_exists; use function Shlinkio\Shlink\Config\env; -use function Shlinkio\Shlink\Config\openswooleIsInstalled; +use function Shlinkio\Shlink\Config\runningInOpenswoole; use function Shlinkio\Shlink\Config\runningInRoadRunner; -use const PHP_SAPI; - $isTestEnv = env('APP_ENV') === 'test'; -// TODO Could check for actual openswoole with runningInOpenswoole()?? -$enableSwoole = PHP_SAPI === 'cli' && ! runningInRoadRunner() && openswooleIsInstalled(); +$enableSwoole = ! runningInRoadRunner() && runningInOpenswoole(); return (new ConfigAggregator\ConfigAggregator([ ! $isTestEnv diff --git a/config/roadrunner/.rr.dev.yml b/config/roadrunner/.rr.dev.yml index a12f2475..7adf4520 100644 --- a/config/roadrunner/.rr.dev.yml +++ b/config/roadrunner/.rr.dev.yml @@ -8,6 +8,7 @@ server: http: address: '0.0.0.0:8080' + middleware: ['static'] static: dir: '../../public' forbid: ['.php', '.htaccess'] diff --git a/config/roadrunner/.rr.yml b/config/roadrunner/.rr.yml index f7409c48..40c93b2b 100644 --- a/config/roadrunner/.rr.yml +++ b/config/roadrunner/.rr.yml @@ -8,6 +8,7 @@ server: http: address: '0.0.0.0:${PORT}' + middleware: ['static'] static: dir: '../../public' forbid: ['.php', '.htaccess']