1 | <?php |
||
22 | abstract class AbstractCommand extends Command |
||
23 | { |
||
24 | const FOLDER_RESOURCES = '/../../app/Resources/config/'; |
||
25 | |||
26 | /** |
||
27 | * @var InputInterface |
||
28 | */ |
||
29 | protected $oInput; |
||
30 | |||
31 | /** |
||
32 | * @var OutputInterface |
||
33 | */ |
||
34 | protected $oOutput; |
||
35 | |||
36 | /** |
||
37 | * @var ContainerBuilder |
||
38 | */ |
||
39 | private static $oContainer; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | private static $sHomeDir = ''; |
||
45 | |||
46 | /** |
||
47 | * Executes the current command. |
||
48 | * |
||
49 | * This method is not abstract because you can use this class |
||
50 | * as a concrete class. In this case, instead of defining the |
||
51 | * execute() method, you set the code to execute by passing |
||
52 | * a Closure to the setCode() method. |
||
53 | * |
||
54 | * @param InputInterface $oInput An InputInterface instance |
||
55 | * @param OutputInterface $oOutput An OutputInterface instance |
||
56 | * |
||
57 | * @return integer null or 0 if everything went fine, or an error code |
||
58 | * |
||
59 | * @throws \LogicException When this abstract method is not implemented |
||
60 | * |
||
61 | * @see setCode() |
||
62 | */ |
||
63 | 10 | protected function execute(InputInterface $oInput, OutputInterface $oOutput) |
|
80 | |||
81 | /** |
||
82 | * @return int |
||
83 | */ |
||
84 | abstract protected function process(); |
||
85 | |||
86 | /** |
||
87 | * @return ContainerBuilder |
||
88 | */ |
||
89 | protected function getContainer() |
||
110 | |||
111 | /** |
||
112 | * @return bool |
||
113 | */ |
||
114 | 3 | protected function isAppRunable() |
|
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | 1 | protected function getHomeDir() |
|
151 | |||
152 | /** |
||
153 | * @return string |
||
154 | */ |
||
155 | 1 | protected function getCacheDir() |
|
162 | |||
163 | /** |
||
164 | * @return string |
||
165 | */ |
||
166 | protected function getWorkingDir() |
||
170 | |||
171 | /** |
||
172 | * @param string $sPath |
||
173 | * @param string $sFile |
||
174 | * @param ContainerBuilder $oContainer |
||
175 | */ |
||
176 | private function loadParameterConfig($sPath, $sFile, $oContainer) |
||
185 | } |