Skip to content

Commit a1577db

Browse files
author
ziming
committed
support passing arguments to adapters
1 parent 0573cdb commit a1577db

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ return [
7474
'secret' => env('STATSIG_SECRET_KEY'),
7575

7676
'data_adapter' => LocalFileDataAdapter::class,
77+
'data_adapter_arguments' => [
78+
// '/tmp/statsig/',
79+
],
80+
7781
'logging_adapter' => LocalFileLoggingAdapter::class,
82+
'logging_adapter_arguments' => [
83+
// '/tmp/statsig.logs',
84+
],
7885
];
7986
```
8087

config/statsig.php

+7
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,12 @@
1010
'secret' => env('STATSIG_SECRET_KEY', ''),
1111

1212
'data_adapter' => LocalFileDataAdapter::class,
13+
'data_adapter_arguments' => [
14+
// '/tmp/statsig/',
15+
],
16+
1317
'logging_adapter' => LocalFileLoggingAdapter::class,
18+
'logging_adapter_arguments' => [
19+
// '/tmp/statsig.logs',
20+
],
1421
];

src/Commands/StatsigSendCommand.php

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ public function handle(): int
3535
$commandToRun .= ' '.$key.' '.$value;
3636
}
3737

38+
$adapterArguments = config('statsig.logging_adapter_arguments');
39+
40+
foreach ($adapterArguments as $key => $value) {
41+
$commandToRun .= ' '.$key.' '.$value;
42+
}
43+
3844
$result = Process::run($commandToRun);
3945
$this->info($result->output());
4046

src/Commands/StatsigSyncCommand.php

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public function handle(): int
2727
$commandToRun .= ' '.$key.' '.$value;
2828
}
2929

30+
$adapterArguments = config('statsig.data_adapter_arguments');
31+
32+
foreach ($adapterArguments as $key => $value) {
33+
$commandToRun .= ' '.$key.' '.$value;
34+
}
35+
3036
$result = Process::run($commandToRun);
3137
$this->info($result->output());
3238

0 commit comments

Comments
 (0)