1 | <?php |
||
9 | class SystemCheckCommand extends Command |
||
10 | { |
||
11 | /** |
||
12 | * The console command name. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name = 'system:check'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'Check server and laravel configuration'; |
||
24 | |||
25 | /** |
||
26 | * The collection of all available checks. |
||
27 | * |
||
28 | * @var ChecksCollection |
||
29 | */ |
||
30 | protected $checks; |
||
31 | |||
32 | /** |
||
33 | * The table headers for the command. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $headers = ['Check', 'Result', 'Comment']; |
||
38 | |||
39 | /** |
||
40 | * Constructor. |
||
41 | * |
||
42 | * @param ChecksCollection $checks |
||
43 | */ |
||
44 | public function __construct(ChecksCollection $checks) |
||
50 | |||
51 | /** |
||
52 | * Execute the console command. |
||
53 | * |
||
54 | * @return void |
||
55 | */ |
||
56 | public function fire() |
||
68 | |||
69 | /** |
||
70 | * laravel 5.* support |
||
71 | */ |
||
72 | public function handle() { |
||
75 | |||
76 | /** |
||
77 | * Perform server configuration checks. |
||
78 | * |
||
79 | * @param string $env |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | protected function performServerChecks($env) |
||
89 | |||
90 | /** |
||
91 | * Perform laravel configuration checks. |
||
92 | * |
||
93 | * @param string $env |
||
94 | * |
||
95 | * @return void |
||
96 | */ |
||
97 | protected function performLaravelChecks($env) |
||
103 | |||
104 | /** |
||
105 | * Perform configuration checks. |
||
106 | * |
||
107 | * @param array $checks |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | protected function performChecks($checks) |
||
123 | |||
124 | /** |
||
125 | * Build a check object and perform a check. |
||
126 | * |
||
127 | * @param string $class |
||
128 | * |
||
129 | * @return array |
||
130 | */ |
||
131 | protected function performCheck($class) |
||
146 | |||
147 | /** |
||
148 | * Display all given rows as a table. |
||
149 | * |
||
150 | * @param array $rows |
||
151 | */ |
||
152 | protected function displayRows(array $rows) |
||
158 | |||
159 | /** |
||
160 | * Add some styling to status. |
||
161 | * |
||
162 | * @param string $status |
||
163 | * |
||
164 | * @return string |
||
165 | */ |
||
166 | protected function styleStatus($status) |
||
182 | } |
||
183 |