moved the artisan binary override and commented some of the bindings for queue

This commit is contained in:
Daniël Klabbers 2019-09-12 09:11:07 +02:00
parent c1e03b0436
commit 4bfcf4e052
2 changed files with 8 additions and 4 deletions

View File

@ -21,4 +21,9 @@ class Listener extends \Illuminate\Queue\Listener
return $command; return $command;
} }
protected function artisanBinary()
{
return 'flarum';
}
} }

View File

@ -36,10 +36,6 @@ class QueueServiceProvider extends AbstractServiceProvider
public function register() public function register()
{ {
if (! defined('ARTISAN_BINARY')) {
define('ARTISAN_BINARY', 'flarum');
}
// Register a simple connection factory that always returns the same // Register a simple connection factory that always returns the same
// connection, as that is enough for our purposes. // connection, as that is enough for our purposes.
$this->app->singleton(Factory::class, function () { $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) { $this->app->singleton(QueueListener::class, function ($app) {
return new Listener($app->basePath()); return new Listener($app->basePath());
}); });
// Bind a simple cache manager that returns the cache store.
$this->app->singleton('cache', function ($app) { $this->app->singleton('cache', function ($app) {
return new class($app) { return new class($app) {
public function __construct($app) public function __construct($app)