From 5d1bb21f75d87e290c7ff7418d09b5e03c52e48d Mon Sep 17 00:00:00 2001 From: Joseph Roberts Date: Mon, 12 Jun 2023 13:30:40 -0400 Subject: [PATCH] fix acorn router not being loaded when WP_CLI is active --- src/Roots/Acorn/Bootloader.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Roots/Acorn/Bootloader.php b/src/Roots/Acorn/Bootloader.php index f598a8aa..99cb6e14 100644 --- a/src/Roots/Acorn/Bootloader.php +++ b/src/Roots/Acorn/Bootloader.php @@ -111,10 +111,6 @@ public function boot($callback = null) } if (Env::get('ACORN_ENABLE_EXPIRIMENTAL_ROUTER')) { - $app->singleton( - \Illuminate\Contracts\Http\Kernel::class, - \Roots\Acorn\Http\Kernel::class - ); return $this->bootHttp($app); } @@ -261,12 +257,14 @@ public function getApplication(): ApplicationContract $this->app->singleton( \Illuminate\Contracts\Http\Kernel::class, - $this->app->config->get('kernels.http', \Roots\Acorn\Kernel::class) + Env::get('ACORN_ENABLE_EXPIRIMENTAL_ROUTER') + ? \Roots\Acorn\Http\Kernel::class + : \Roots\Acorn\Kernel::class ); $this->app->singleton( \Illuminate\Contracts\Console\Kernel::class, - $this->app->config->get('kernels.console', \Roots\Acorn\Console\Kernel::class) + \Roots\Acorn\Console\Kernel::class ); $this->app->singleton(