1 | <?php |
||
12 | class HoneybadgerInstallCommand extends Command |
||
13 | { |
||
14 | use RequiredInput; |
||
15 | |||
16 | /** |
||
17 | * The name and signature of the console command. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $signature = 'honeybadger:install {apiKey?}'; |
||
22 | |||
23 | /** |
||
24 | * The console command description. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $description = 'Install and configure Honeybadger'; |
||
29 | |||
30 | /** |
||
31 | * Configuration from gathered input. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $config = []; |
||
36 | |||
37 | /** |
||
38 | * @var \Honeybadger\HoneybadgerLaravel\Contracts\Installer; |
||
39 | */ |
||
40 | protected $installer; |
||
41 | |||
42 | protected $tasks; |
||
43 | |||
44 | /** |
||
45 | * Execute the console command. |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | public function handle(Installer $installer, CommandTasks $commandTasks) |
||
74 | |||
75 | /** |
||
76 | * Publish the configuration file to the framework. |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function publishConfig() |
||
88 | |||
89 | /** |
||
90 | * Prompt for input and gather responses. |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | private function gatherConfig() |
||
101 | |||
102 | /** |
||
103 | * Prompt for the API key. |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | private function promptForApiKey() |
||
111 | |||
112 | /** |
||
113 | * Send test exception to Honeybadger. |
||
114 | * |
||
115 | * @return void |
||
116 | */ |
||
117 | private function sendTest() |
||
128 | |||
129 | /** |
||
130 | * Write configuration values to the env files. |
||
131 | * |
||
132 | * @return void |
||
133 | */ |
||
134 | private function writeEnv() |
||
152 | |||
153 | /** |
||
154 | * Whether the configuration needs to be published or no. |
||
155 | * |
||
156 | * @return bool |
||
157 | */ |
||
158 | private function shouldPublishConfig() |
||
162 | |||
163 | private function outputSuccessMessage() |
||
190 | } |
||
191 |