1 | <?php |
||
16 | class Scaffold extends ConsoleBase |
||
17 | { |
||
18 | /** |
||
19 | * The application name |
||
20 | * @var string |
||
21 | */ |
||
22 | const APPLICATION_NAME = <<<NAME |
||
23 | _____ __ ______ _ _____ __ |
||
24 | / __(_) / _____ ____/ __/ /_____(_)__ ___ / ___/__ ___ ___ ___ / /__ |
||
25 | _\ \/ / / |/ / -_) __/\ \/ __/ __/ / _ \/ -_) / /__/ _ \/ _ \(_-</ _ \/ / -_) |
||
26 | /___/_/_/|___/\__/_/ /___/\__/_/ /_/ .__/\__/ \___/\___/_//_/___/\___/_/\__/ |
||
27 | /_/ |
||
28 | |||
29 | NAME; |
||
30 | |||
31 | /** |
||
32 | * The application version (semver) |
||
33 | * @var string |
||
34 | */ |
||
35 | const APPLICATION_VERSION = '1.1.0'; |
||
36 | |||
37 | /** |
||
38 | * The SilverStripe Loader class |
||
39 | * @var SilverStripeLoader |
||
40 | */ |
||
41 | protected $silverStripeLoader; |
||
42 | |||
43 | /** |
||
44 | * The Configuration Loader class |
||
45 | * @var ConfigurationLoader |
||
46 | */ |
||
47 | protected $configurationLoader; |
||
48 | |||
49 | /** |
||
50 | * The application configuration |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $configuration; |
||
55 | |||
56 | /** |
||
57 | * Instantiate the console Application |
||
58 | */ |
||
59 | 2 | public function __construct() |
|
73 | |||
74 | /** |
||
75 | * Run the console Application |
||
76 | * |
||
77 | * @see Application::run |
||
78 | * @return int Error code, or zero if successful |
||
79 | */ |
||
80 | 1 | public function run() |
|
84 | |||
85 | /** |
||
86 | * Set the SilverStripeLoader |
||
87 | * |
||
88 | * @param SilverStripeLoader $loader |
||
89 | * @return $this |
||
90 | */ |
||
91 | 3 | public function setSilverStripeLoader(SilverStripeLoader $loader) |
|
96 | |||
97 | /** |
||
98 | * Get the SilverStripeLoader |
||
99 | * |
||
100 | * @return SilverStripeLoader |
||
101 | */ |
||
102 | 3 | public function getSilverStripeLoader() |
|
106 | |||
107 | /** |
||
108 | * Get the console application's configuration |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | 3 | public function getConfiguration() |
|
119 | |||
120 | /** |
||
121 | * Set the console application's configuration |
||
122 | * |
||
123 | * @param array $configuration |
||
124 | * @return $this |
||
125 | */ |
||
126 | 3 | public function setConfiguration(array $configuration) |
|
131 | |||
132 | /** |
||
133 | * Get the configuration loader class |
||
134 | * |
||
135 | * @return ConfigurationLoader |
||
136 | */ |
||
137 | 4 | public function getConfigurationLoader() |
|
141 | |||
142 | /** |
||
143 | * Set the configuration loader class |
||
144 | * |
||
145 | * @param ConfigurationLoader |
||
146 | * @return $this |
||
147 | */ |
||
148 | 3 | public function setConfigurationLoader(ConfigurationLoader $loader) |
|
153 | |||
154 | /** |
||
155 | * Call the SilverStripe bootstrap class |
||
156 | * |
||
157 | * @return $this |
||
158 | */ |
||
159 | 3 | protected function bootstrap() |
|
164 | |||
165 | /** |
||
166 | * Scaffold the Application, including adding all requires commands and configuration |
||
167 | * |
||
168 | * @return $this |
||
169 | */ |
||
170 | 3 | protected function scaffoldApplication() |
|
188 | |||
189 | /** |
||
190 | * Adds all automatically created BuildTask Commands, and all concrete Commands from configuration |
||
191 | * |
||
192 | * @return $this |
||
193 | */ |
||
194 | 3 | protected function addCommands() |
|
206 | } |
||
207 |