1 | <?php |
||
20 | class Application extends ConsoleApplication |
||
21 | { |
||
22 | /** |
||
23 | * @var Environment |
||
24 | */ |
||
25 | protected $environment; |
||
26 | |||
27 | /** |
||
28 | * @var RunnerInterface |
||
29 | */ |
||
30 | protected $runner; |
||
31 | |||
32 | /** |
||
33 | * @var Configuration |
||
34 | */ |
||
35 | protected $configuration; |
||
36 | |||
37 | /** |
||
38 | * @param Environment $environment |
||
39 | */ |
||
40 | public function __construct(Environment $environment) |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | * |
||
51 | * @param InputInterface $input |
||
52 | * @param OutputInterface $output |
||
53 | * @return int |
||
54 | */ |
||
55 | public function run(InputInterface $input = null, OutputInterface $output = null) |
||
65 | |||
66 | /** |
||
67 | * Run the Peridot application |
||
68 | * |
||
69 | * @param InputInterface $input |
||
70 | * @param OutputInterface $output |
||
71 | * @return int |
||
72 | */ |
||
73 | public function doRun(InputInterface $input, OutputInterface $output) |
||
90 | |||
91 | /** |
||
92 | * Fetch the ArgvInput used by Peridot. If any exceptions are thrown due to |
||
93 | * a mismatch between the option or argument requested and the input definition, the |
||
94 | * exception will be rendered and Peridot will exit with an error code. |
||
95 | * |
||
96 | * @param array $argv An array of parameters from the CLI in the argv format. |
||
97 | * @return ArgvInput |
||
98 | */ |
||
99 | public function getInput(array $argv = null) |
||
108 | |||
109 | /** |
||
110 | * Return's peridot as the sole command used by Peridot |
||
111 | * |
||
112 | * @param InputInterface $input |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getCommandName(InputInterface $input) |
||
119 | |||
120 | /** |
||
121 | * Load the configured DSL. |
||
122 | * |
||
123 | * @param $dsl |
||
124 | */ |
||
125 | public function loadDsl($dslPath) |
||
131 | |||
132 | /** |
||
133 | * Set the runner used by the Peridot application. |
||
134 | * |
||
135 | * @param RunnerInterface $runner |
||
136 | * @return $this |
||
137 | */ |
||
138 | public function setRunner(RunnerInterface $runner) |
||
143 | |||
144 | /** |
||
145 | * Get the RunnerInterface being used by the Peridot application. |
||
146 | * If one is not set, a default Runner will be used. |
||
147 | * |
||
148 | * @return RunnerInterface |
||
149 | */ |
||
150 | public function getRunner() |
||
161 | |||
162 | /** |
||
163 | * Return the Environment used by the Peridot application. |
||
164 | * |
||
165 | * @return Environment |
||
166 | */ |
||
167 | public function getEnvironment() |
||
171 | |||
172 | /** |
||
173 | * Return the configuration used by the Peridot application. |
||
174 | * |
||
175 | * @return Configuration |
||
176 | */ |
||
177 | public function getConfiguration() |
||
181 | |||
182 | /** |
||
183 | * Set the configuration object used by the Peridot application. |
||
184 | * |
||
185 | * @param Configuration $configuration |
||
186 | * @return $this |
||
187 | */ |
||
188 | public function setConfiguration(Configuration $configuration) |
||
193 | |||
194 | /** |
||
195 | * Return the peridot input definition defined by Environment |
||
196 | * |
||
197 | * @return InputDefinition |
||
198 | */ |
||
199 | protected function getDefaultInputDefinition() |
||
203 | |||
204 | /** |
||
205 | * Validate that a supplied configuration exists. |
||
206 | * |
||
207 | * @return void |
||
208 | */ |
||
209 | protected function validateConfiguration() |
||
216 | } |
||
217 |