1 | <?php |
||
10 | class VapidKeysGenerateCommand extends Command |
||
11 | { |
||
12 | use ConfirmableTrait; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $signature = 'webpush:vapid |
||
18 | {--show : Display the keys instead of modifying files} |
||
19 | {--force : Force the operation to run when in production}'; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $description = 'Generate VAPID keys.'; |
||
25 | |||
26 | /** |
||
27 | * Execute the console command. |
||
28 | * |
||
29 | * @return mixed |
||
30 | */ |
||
31 | 3 | public function handle() |
|
48 | |||
49 | /** |
||
50 | * Set the keys in the environment file. |
||
51 | * |
||
52 | * @param array $keys |
||
53 | * @return bool |
||
54 | */ |
||
55 | 1 | protected function setKeysInEnvironmentFile($keys) |
|
67 | |||
68 | /** |
||
69 | * Write a new environment file with the given keys. |
||
70 | * |
||
71 | * @param array $keys |
||
72 | * @return void |
||
73 | */ |
||
74 | 1 | protected function writeNewEnvironmentFileWith($keys) |
|
100 | |||
101 | /** |
||
102 | * Get a regex pattern that will match env $keyName with any key. |
||
103 | * |
||
104 | * @param string $keyName |
||
105 | * @return string |
||
106 | */ |
||
107 | 1 | protected function keyReplacementPattern($keyName) |
|
121 | } |
||
122 |