Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Moved config file guru.php to butler.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ttrig committed Nov 4, 2019
1 parent 4bf8155 commit 26d75d5
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 32 deletions.
20 changes: 10 additions & 10 deletions .env-example
Original file line number Diff line number Diff line change
@@ -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=#
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions config/amqp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'),
],
],
];
17 changes: 17 additions & 0 deletions config/butler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

return [

'guru' => [

'driver' => env('BUTLER_GURU_DRIVER', 'file'),

'events' => [
'an.example.event' => [
EventHandler::class,
],
],

],

];
9 changes: 0 additions & 9 deletions config/guru.php

This file was deleted.

10 changes: 5 additions & 5 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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'));
});
}

Expand All @@ -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');
}
}
Expand Down

0 comments on commit 26d75d5

Please sign in to comment.