diff --git a/.env-example b/.env-example index baf9187..3dbb8e4 100644 --- a/.env-example +++ b/.env-example @@ -1,12 +1,12 @@ -GURU_DRIVER=file -#GURU_DRIVER=rabbitmq +BUTLER_GURU_DRIVER=file +#BUTLER_GURU_DRIVER=rabbitmq -GURU_HOST= -GURU_PORT=5672 -GURU_USERNAME=guest -GURU_PASSWORD=guest -GURU_VHOST=/ +BUTLER_GURU_HOST= +BUTLER_GURU_PORT=5672 +BUTLER_GURU_USERNAME=guest +BUTLER_GURU_PASSWORD=guest +BUTLER_GURU_VHOST=/ -GURU_EXCHANGE=guru.events -GURU_QUEUE=x-service -GURU_ROUTING=# +BUTLER_GURU_EXCHANGE=guru.events +BUTLER_GURU_QUEUE=x-service +BUTLER_GURU_ROUTING=# diff --git a/CHANGELOG.md b/CHANGELOG.md index d78c97b..2d516a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Laravel package auto-discovery +### Changed + +- *BREAKING:* Moved config file `guru.php` to `butler.php` + ## [0.2.1] - 2019-09-20 diff --git a/config/amqp.php b/config/amqp.php index 96d06f3..685aef3 100644 --- a/config/amqp.php +++ b/config/amqp.php @@ -19,18 +19,18 @@ 'properties' => [ 'production' => [ - 'host' => env('GURU_HOST'), - 'port' => env('GURU_PORT'), - 'username' => env('GURU_USERNAME'), - 'password' => env('GURU_PASSWORD'), - 'vhost' => env('GURU_VHOST'), + 'host' => env('BUTLER_GURU_HOST'), + 'port' => env('BUTLER_GURU_PORT'), + 'username' => env('BUTLER_GURU_USERNAME'), + 'password' => env('BUTLER_GURU_PASSWORD'), + 'vhost' => env('BUTLER_GURU_VHOST'), 'connect_options' => [ 'heartbeat' => 10, 'read_write_timeout' => 30 ], 'ssl_options' => [], - 'exchange' => env('GURU_EXCHANGE'), + 'exchange' => env('BUTLER_GURU_EXCHANGE'), 'exchange_type' => 'topic', 'exchange_passive' => false, 'exchange_durable' => true, @@ -54,8 +54,8 @@ 'consumer_nowait' => false, 'timeout' => 0, 'persistent' => true, - 'queue' => env('GURU_QUEUE'), - 'routing' => env('GURU_ROUTING'), + 'queue' => env('BUTLER_GURU_QUEUE'), + 'routing' => env('BUTLER_GURU_ROUTING'), ], ], ]; diff --git a/config/butler.php b/config/butler.php new file mode 100644 index 0000000..556d5a6 --- /dev/null +++ b/config/butler.php @@ -0,0 +1,17 @@ + [ + + 'driver' => env('BUTLER_GURU_DRIVER', 'file'), + + 'events' => [ + 'an.example.event' => [ + EventHandler::class, + ], + ], + + ], + +]; diff --git a/config/guru.php b/config/guru.php deleted file mode 100644 index 5a586d4..0000000 --- a/config/guru.php +++ /dev/null @@ -1,9 +0,0 @@ - env('GURU_DRIVER', 'file'), - 'events' => [ -// 'an.example.event' => [ -// EventHandler::class, -// ], - ], -]; diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index b2630a6..dbaf879 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -20,7 +20,7 @@ class ServiceProvider extends BaseServiceProvider */ public function register() { - $driver = config('guru.driver', 'file'); + $driver = config('butler.guru.driver', 'file'); if ($driver === 'file') { $this->app->bind('Butler\Guru\Drivers\Driver', FileDriver::class); if ($this->app->runningInConsole()) { @@ -42,7 +42,7 @@ public function register() } $this->app->bind(EventRouter::class, function () { - return new EventRouter(config('guru.events')); + return new EventRouter(config('butler.guru.events')); }); } @@ -59,14 +59,14 @@ public function boot() private function setupConfig($app) { - $guruSource = realpath(__DIR__ . '/../config/guru.php'); + $guruSource = realpath(__DIR__ . '/../config/butler.php'); $amqpSource = realpath(__DIR__ . '/../config/amqp.php'); if ($app instanceof LaravelApplication && $app->runningInConsole()) { - $this->publishes([$guruSource => config_path('guru.php')]); + $this->publishes([$guruSource => config_path('butler.php')]); $this->publishes([$amqpSource => config_path('amqp.php')]); } elseif ($app instanceof LumenApplication) { - $app->configure('guru'); + $app->configure('butler'); $this->mergeConfigFrom($amqpSource, 'amqp'); } }