10
10
11
11
class PublishCommand extends Command
12
12
{
13
- /**
14
- * The name and signature of the console command.
15
- *
16
- * @var string
17
- */
18
- protected $ signature = 'sentry:publish {--dsn=}
19
- {--without-performance-monitoring}
20
- {--without-test}
21
- {--without-javascript-sdk} ' ;
22
-
23
- /**
24
- * The console command description.
25
- *
26
- * @var string
27
- */
13
+ protected $ signature = <<<COMMAND
14
+ sentry:publish
15
+ { --dsn= : The DSN to configure }
16
+ { --without-test : Do not send a test event }
17
+ { --with-send-default-pii : Include information such as request headers, IP address and the authenticated user to events collected by the SDK }
18
+ { --without-performance-monitoring : Do not enable performance monitoring }
19
+ { --without-javascript-sdk : Do not enable the JavaScript SDK (deprecated; option unused) }
20
+ COMMAND ;
21
+
28
22
protected $ description = 'Publishes and configures the Sentry config. ' ;
29
23
30
- protected const SDK_CHOICE_BROWSER = 'JavaScript (default) ' ;
31
- protected const SDK_CHOICE_VUE = 'Vue.js ' ;
32
- protected const SDK_CHOICE_REACT = 'React ' ;
33
- protected const SDK_CHOICE_ANGULAR = 'Angular ' ;
34
- protected const SDK_CHOICE_SVELTE = 'Svelte ' ;
35
-
36
- /**
37
- * Execute the console command.
38
- *
39
- * @return int
40
- */
41
24
public function handle (): int
42
25
{
43
26
$ arg = [];
@@ -62,6 +45,17 @@ public function handle(): int
62
45
$ arg ['--dsn ' ] = $ dsn ;
63
46
}
64
47
48
+ $ sendDefaultPii = $ this ->confirm (
49
+ "Do you want to include information such as request headers, IP address and the authenticated user to events collected by the SDK? \n You can read more about this on https://docs.sentry.io/platforms/php/guides/laravel/data-management/data-collected/ " ,
50
+ $ this ->option ('with-send-default-pii ' ) === true
51
+ );
52
+
53
+ if ($ sendDefaultPii ) {
54
+ $ env ['SENTRY_SEND_DEFAULT_PII ' ] = 'true ' ;
55
+ } elseif ($ this ->isEnvKeySet ('SENTRY_SEND_DEFAULT_PII ' )) {
56
+ $ env ['SENTRY_SEND_DEFAULT_PII ' ] = 'false ' ;
57
+ }
58
+
65
59
$ testCommandPrompt = 'Do you want to send a test event to Sentry? ' ;
66
60
67
61
if ($ this ->confirm ('Enable Performance Monitoring? ' , !$ this ->option ('without-performance-monitoring ' ))) {
0 commit comments