1 | <?php |
||
15 | class Builder extends Command |
||
16 | { |
||
17 | /** |
||
18 | * The directory that contains your application builds. |
||
19 | */ |
||
20 | const BUILD_PATH = BASE_PATH.DIRECTORY_SEPARATOR.'builds'; |
||
21 | |||
22 | /** |
||
23 | * Contains the default app structure. |
||
24 | * |
||
25 | * @var []string |
||
26 | */ |
||
27 | protected $structure = [ |
||
28 | 'app'.DIRECTORY_SEPARATOR, |
||
29 | 'bootstrap'.DIRECTORY_SEPARATOR, |
||
30 | 'vendor'.DIRECTORY_SEPARATOR, |
||
31 | 'config'.DIRECTORY_SEPARATOR, |
||
32 | ]; |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | protected $signature = 'app:build {name=application : The build name}'; |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | protected $description = 'Perform an application build'; |
||
43 | |||
44 | /** |
||
45 | * Holds the configuration on is original state. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected static $config; |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function handle(): void |
||
67 | |||
68 | /** |
||
69 | * Builds the application. |
||
70 | * |
||
71 | * @param string $name |
||
72 | * |
||
73 | * @return $this |
||
74 | */ |
||
75 | protected function build(string $name): Builder |
||
87 | |||
88 | /** |
||
89 | * Compiles the standalone application. |
||
90 | * |
||
91 | * @param string $name |
||
92 | * |
||
93 | * @return $this |
||
94 | */ |
||
95 | protected function compile(string $name): Builder |
||
118 | |||
119 | /** |
||
120 | * Gets a new instance of the compiler. |
||
121 | * |
||
122 | * @param string $name |
||
123 | * |
||
124 | * @return \Phar |
||
125 | */ |
||
126 | protected function getCompiler(string $name): \Phar |
||
139 | |||
140 | /** |
||
141 | * Creates the folder for the builds. |
||
142 | * |
||
143 | * @return $this |
||
144 | */ |
||
145 | protected function makeFolder(): Builder |
||
153 | |||
154 | /** |
||
155 | * Moves the compiled files to the builds folder. |
||
156 | * |
||
157 | * @param string $name |
||
158 | * |
||
159 | * @return $this |
||
160 | */ |
||
161 | protected function cleanUp(string $name): Builder |
||
168 | |||
169 | /** |
||
170 | * Sets the executable mode on the standalone application file. |
||
171 | * |
||
172 | * @param string $name |
||
173 | * |
||
174 | * @return $this |
||
175 | */ |
||
176 | protected function setPermissions($name): Builder |
||
183 | |||
184 | /** |
||
185 | * Prepares the application for build. |
||
186 | * |
||
187 | * @return $this |
||
188 | */ |
||
189 | protected function prepare(): Builder |
||
203 | |||
204 | /** |
||
205 | * Prepares the application for build. |
||
206 | * |
||
207 | * @return $this |
||
208 | */ |
||
209 | protected function finish(): Builder |
||
217 | |||
218 | /** |
||
219 | * Makes sure that the finish is performed even |
||
220 | * if the command fails. |
||
221 | */ |
||
222 | public function __destruct() |
||
228 | } |
||
229 |