1 | <?php namespace Lanin\Laravel\SetupWizard\Commands\Steps; |
||
7 | class CreateMysqlDatabase extends AbstractStep |
||
8 | { |
||
9 | /** |
||
10 | * @var Connection |
||
11 | */ |
||
12 | protected $connection; |
||
13 | |||
14 | /** |
||
15 | * @inheritDoc |
||
16 | */ |
||
17 | 20 | public function __construct(Command $command) |
|
23 | |||
24 | |||
25 | /** |
||
26 | * Return command prompt text. |
||
27 | * |
||
28 | * @return string |
||
29 | */ |
||
30 | 2 | public function prompt() |
|
34 | |||
35 | /** |
||
36 | * Prepare step data. |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | 4 | public function prepare() |
|
55 | |||
56 | /** |
||
57 | * Get database config. |
||
58 | * |
||
59 | * @param array $return |
||
60 | */ |
||
61 | 4 | protected function getDatabaseConfigs(array &$return) |
|
77 | |||
78 | /** |
||
79 | * Ask info about 'root' user. |
||
80 | * |
||
81 | * @param array $return |
||
82 | */ |
||
83 | 2 | protected function getOtherConnectionUser(array &$return) |
|
91 | |||
92 | /** |
||
93 | * Generate SQL commands. |
||
94 | * |
||
95 | * @param array $return |
||
96 | */ |
||
97 | 4 | protected function generateSqlCommands(array &$return) |
|
109 | |||
110 | /** |
||
111 | * Generate terminal command. |
||
112 | * |
||
113 | * @param array $results |
||
114 | * @param bool $full |
||
115 | * @return string |
||
116 | */ |
||
117 | 2 | protected function generateConsoleCommand($results, $full = false) |
|
127 | |||
128 | /** |
||
129 | * Preview results. |
||
130 | * |
||
131 | * @param mixed $results |
||
132 | * @return void |
||
133 | */ |
||
134 | 2 | public function preview($results) |
|
140 | |||
141 | /** |
||
142 | * Finish step. |
||
143 | * |
||
144 | * @param mixed $results |
||
145 | * @return bool |
||
146 | */ |
||
147 | 2 | public function finish($results) |
|
158 | } |