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)