1 | <?php |
||
15 | class Builder extends Command |
||
16 | { |
||
17 | /** |
||
18 | * The directory that contains your application builds. |
||
19 | */ |
||
20 | const BUILD_PATH = BASE_PATH.'/builds'; |
||
21 | |||
22 | /** |
||
23 | * Contains the default app structure. |
||
24 | * |
||
25 | * @var []string |
||
26 | */ |
||
27 | protected $structure = [ |
||
28 | 'app/', |
||
29 | 'bootstrap/', |
||
30 | 'vendor/', |
||
31 | 'config/', |
||
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): self |
||
87 | |||
88 | /** |
||
89 | * Compiles the standalone application. |
||
90 | * |
||
91 | * @param string $name |
||
92 | * |
||
93 | * @return $this |
||
94 | */ |
||
95 | protected function compile(string $name): self |
||
109 | |||
110 | /** |
||
111 | * Gets a new instance of the compiler. |
||
112 | * |
||
113 | * @param string $name |
||
114 | * |
||
115 | * @return \Phar |
||
116 | */ |
||
117 | protected function getCompiler(string $name): \Phar |
||
130 | |||
131 | /** |
||
132 | * Creates the folder for the builds. |
||
133 | * |
||
134 | * @return $this |
||
135 | */ |
||
136 | protected function makeFolder(): self |
||
144 | |||
145 | /** |
||
146 | * Moves the compiled files to the builds folder. |
||
147 | * |
||
148 | * @param string $name |
||
149 | * |
||
150 | * @return $this |
||
151 | */ |
||
152 | protected function cleanUp(string $name): self |
||
159 | |||
160 | /** |
||
161 | * Sets the executable mode on the standalone application file. |
||
162 | * |
||
163 | * @param string $name |
||
164 | * |
||
165 | * @return $this |
||
166 | */ |
||
167 | protected function setPermissions($name): self |
||
174 | |||
175 | /** |
||
176 | * Prepares the application for build. |
||
177 | * |
||
178 | * @return $this |
||
179 | */ |
||
180 | protected function prepare(): self |
||
193 | |||
194 | /** |
||
195 | * Prepares the application for build. |
||
196 | * |
||
197 | * @return $this |
||
198 | */ |
||
199 | protected function finish(): self |
||
207 | |||
208 | /** |
||
209 | * Makes sure that the finish is performed even |
||
210 | * if the command fails. |
||
211 | */ |
||
212 | public function __destruct() |
||
218 | } |
||
219 |