1 | <?php |
||
20 | class Application extends Console |
||
21 | { |
||
22 | /** |
||
23 | * Input definition for user specific arguments and options. |
||
24 | * |
||
25 | * @var InputDefinition |
||
26 | */ |
||
27 | private $userDefinition; |
||
28 | |||
29 | /** |
||
30 | * @var callable |
||
31 | */ |
||
32 | private $catchIO; |
||
33 | |||
34 | /** |
||
35 | * @var callable |
||
36 | */ |
||
37 | private $after; |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | protected function getDefaultInputDefinition() |
||
43 | { |
||
44 | $inputDefinition = parent::getDefaultInputDefinition(); |
||
45 | |||
46 | $inputDefinition->addOption( |
||
47 | new InputOption('--file', '-f', InputOption::VALUE_OPTIONAL, 'Specify Deployer file') |
||
48 | ); |
||
49 | |||
50 | return $inputDefinition; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | protected function getDefaultCommands() |
||
57 | { |
||
58 | $commands = parent::getDefaultCommands(); |
||
59 | |||
60 | if ($this->isPharArchive()) { |
||
61 | $commands[] = $this->selfUpdateCommand(); |
||
62 | } |
||
63 | |||
64 | return $commands; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | private function selfUpdateCommand() |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | protected function getDefaultHelperSet() |
||
90 | |||
91 | /** |
||
92 | * @return InputDefinition |
||
93 | */ |
||
94 | public function getUserDefinition() |
||
102 | |||
103 | /** |
||
104 | * Add user definition arguments and options to definition. |
||
105 | */ |
||
106 | public function addUserArgumentsAndOptions() |
||
111 | |||
112 | /** |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function isPharArchive() |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) |
||
150 | |||
151 | /** |
||
152 | * @param $callable |
||
153 | */ |
||
154 | public function catchIO($callable) |
||
158 | |||
159 | /** |
||
160 | * @param $callable |
||
161 | */ |
||
162 | public function afterRun($callable) |
||
166 | } |
||
167 |