Skip to content

Commit

Permalink
support passing arguments to adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
ziming committed Jul 28, 2023
1 parent 0573cdb commit a1577db
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ return [
'secret' => env('STATSIG_SECRET_KEY'),

'data_adapter' => LocalFileDataAdapter::class,
'data_adapter_arguments' => [
// '/tmp/statsig/',
],

'logging_adapter' => LocalFileLoggingAdapter::class,
'logging_adapter_arguments' => [
// '/tmp/statsig.logs',
],
];
```

Expand Down
7 changes: 7 additions & 0 deletions config/statsig.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@
'secret' => env('STATSIG_SECRET_KEY', ''),

'data_adapter' => LocalFileDataAdapter::class,
'data_adapter_arguments' => [
// '/tmp/statsig/',
],

'logging_adapter' => LocalFileLoggingAdapter::class,
'logging_adapter_arguments' => [
// '/tmp/statsig.logs',
],
];
6 changes: 6 additions & 0 deletions src/Commands/StatsigSendCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public function handle(): int
$commandToRun .= ' '.$key.' '.$value;
}

$adapterArguments = config('statsig.logging_adapter_arguments');

foreach ($adapterArguments as $key => $value) {
$commandToRun .= ' '.$key.' '.$value;
}

$result = Process::run($commandToRun);
$this->info($result->output());

Expand Down
6 changes: 6 additions & 0 deletions src/Commands/StatsigSyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ public function handle(): int
$commandToRun .= ' '.$key.' '.$value;
}

$adapterArguments = config('statsig.data_adapter_arguments');

foreach ($adapterArguments as $key => $value) {
$commandToRun .= ' '.$key.' '.$value;
}

$result = Process::run($commandToRun);
$this->info($result->output());

Expand Down

0 comments on commit a1577db

Please sign in to comment.