1 | <?php |
||
24 | class Builder extends AbstractCommand |
||
25 | { |
||
26 | /** |
||
27 | * The directory that contains your application builds. |
||
28 | */ |
||
29 | const BUILD_PATH = BASE_PATH.'/builds'; |
||
30 | |||
31 | /** |
||
32 | * The default build name. |
||
33 | */ |
||
34 | const BUILD_NAME = 'application'; |
||
35 | |||
36 | /** |
||
37 | * Contains the application structure |
||
38 | * needed for the build. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $structure = [ |
||
43 | 'app/', |
||
44 | 'bootstrap/', |
||
45 | 'vendor/', |
||
46 | 'config/', |
||
47 | ]; |
||
48 | |||
49 | /** |
||
50 | * The name and signature of the console command. |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $signature = 'build'; |
||
55 | |||
56 | /** |
||
57 | * The console command description. |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $description = 'The build app command'; |
||
62 | |||
63 | /** |
||
64 | * Execute the console command. |
||
65 | */ |
||
66 | public function handle(): void |
||
79 | |||
80 | /** |
||
81 | * Configure the command options. |
||
82 | * |
||
83 | * Ask for the name of the build. |
||
84 | */ |
||
85 | protected function configure(): void |
||
89 | |||
90 | /** |
||
91 | * Builds the application. |
||
92 | * |
||
93 | * @param string $name |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | protected function build(string $name): Build |
||
107 | |||
108 | /** |
||
109 | * Compiles the standalone application. |
||
110 | * |
||
111 | * @param string $name |
||
112 | * |
||
113 | * @return $this |
||
114 | */ |
||
115 | protected function compile(string $name): Build |
||
125 | |||
126 | /** |
||
127 | * Gets a new instance of the compiler. |
||
128 | * |
||
129 | * @param string $name |
||
130 | * |
||
131 | * @return \Phar |
||
132 | */ |
||
133 | protected function getCompiler(string $name): \Phar |
||
146 | |||
147 | /** |
||
148 | * Creates the folder for the builds. |
||
149 | * |
||
150 | * @return $this |
||
151 | */ |
||
152 | protected function makeFolder(): Build |
||
160 | |||
161 | /** |
||
162 | * Moves the compiled files to the builds folder. |
||
163 | * |
||
164 | * @param string $name |
||
165 | * |
||
166 | * @return $this |
||
167 | */ |
||
168 | protected function cleanUp(string $name): Build |
||
175 | } |
||
176 |