From 4bfcf4e0521e7c8757ef10ddfa7d7be97e0b16d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Klabbers?= Date: Thu, 12 Sep 2019 09:11:07 +0200 Subject: [PATCH] moved the artisan binary override and commented some of the bindings for queue --- framework/core/src/Queue/Listener.php | 5 +++++ framework/core/src/Queue/QueueServiceProvider.php | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/core/src/Queue/Listener.php b/framework/core/src/Queue/Listener.php index 72be357fc..04c0a01c6 100644 --- a/framework/core/src/Queue/Listener.php +++ b/framework/core/src/Queue/Listener.php @@ -21,4 +21,9 @@ class Listener extends \Illuminate\Queue\Listener return $command; } + + protected function artisanBinary() + { + return 'flarum'; + } } diff --git a/framework/core/src/Queue/QueueServiceProvider.php b/framework/core/src/Queue/QueueServiceProvider.php index 90bbf0785..18ec1cb81 100644 --- a/framework/core/src/Queue/QueueServiceProvider.php +++ b/framework/core/src/Queue/QueueServiceProvider.php @@ -36,10 +36,6 @@ class QueueServiceProvider extends AbstractServiceProvider public function register() { - if (! defined('ARTISAN_BINARY')) { - define('ARTISAN_BINARY', 'flarum'); - } - // Register a simple connection factory that always returns the same // connection, as that is enough for our purposes. $this->app->singleton(Factory::class, function () { @@ -69,10 +65,13 @@ class QueueServiceProvider extends AbstractServiceProvider ); }); + // Override the Laravel native Listener, so that we can ignore the environment + // option and force the binary to flarum. $this->app->singleton(QueueListener::class, function ($app) { return new Listener($app->basePath()); }); + // Bind a simple cache manager that returns the cache store. $this->app->singleton('cache', function ($app) { return new class($app) { public function __construct($app)