1 | <?php |
||
27 | abstract class AbstractCommand extends BaseCommand |
||
28 | { |
||
29 | |||
30 | /** |
||
31 | * Raw path. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | private $_rawPath; |
||
36 | |||
37 | /** |
||
38 | * Whatever "path" argument accepts repository urls. |
||
39 | * |
||
40 | * @var boolean |
||
41 | */ |
||
42 | protected $pathAcceptsUrl = false; |
||
43 | |||
44 | /** |
||
45 | * Repository connector |
||
46 | * |
||
47 | * @var Connector |
||
48 | */ |
||
49 | protected $repositoryConnector; |
||
50 | |||
51 | /** |
||
52 | * Working directory. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $workingDirectory = null; |
||
57 | |||
58 | /** |
||
59 | * Working copy resolver. |
||
60 | * |
||
61 | * @var WorkingCopyResolver |
||
62 | */ |
||
63 | private $_workingCopyResolver = null; |
||
64 | |||
65 | /** |
||
66 | * Revision log factory. |
||
67 | * |
||
68 | * @var RevisionLogFactory |
||
69 | */ |
||
70 | private $_revisionLogFactory; |
||
71 | |||
72 | /** |
||
73 | * Command config. |
||
74 | * |
||
75 | * @var CommandConfig |
||
76 | */ |
||
77 | private $_commandConfig; |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | * |
||
82 | * @throws \RuntimeException When url was given instead of path. |
||
83 | */ |
||
84 | protected function initialize(InputInterface $input, OutputInterface $output) |
||
98 | |||
99 | /** |
||
100 | * Prepare dependencies. |
||
101 | * |
||
102 | * @return void |
||
103 | */ |
||
104 | protected function prepareDependencies() |
||
116 | |||
117 | /** |
||
118 | * Returns command setting value. |
||
119 | * |
||
120 | * @param string $name Name. |
||
121 | * |
||
122 | * @return mixed |
||
123 | */ |
||
124 | protected function getSetting($name) |
||
128 | |||
129 | /** |
||
130 | * Sets command setting value. |
||
131 | * |
||
132 | * @param string $name Name. |
||
133 | * @param mixed $value Value. |
||
134 | * |
||
135 | * @return void |
||
136 | */ |
||
137 | protected function setSetting($name, $value) |
||
141 | |||
142 | /** |
||
143 | * Returns revision log. |
||
144 | * |
||
145 | * @param string $repository_url Repository url. |
||
146 | * |
||
147 | * @return RevisionLog |
||
148 | */ |
||
149 | protected function getRevisionLog($repository_url) |
||
153 | |||
154 | /** |
||
155 | * Transforms string into list. |
||
156 | * |
||
157 | * @param string $string String. |
||
158 | * @param string $separator Separator. |
||
159 | * |
||
160 | * @return array |
||
161 | */ |
||
162 | protected function getList($string, $separator = ',') |
||
166 | |||
167 | /** |
||
168 | * Returns URL to the working copy. |
||
169 | * |
||
170 | * @return string |
||
171 | */ |
||
172 | protected function getWorkingCopyUrl() |
||
176 | |||
177 | /** |
||
178 | * Return working copy path. |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | protected function getWorkingCopyPath() |
||
186 | |||
187 | /** |
||
188 | * Returns all refs. |
||
189 | * |
||
190 | * @return array |
||
191 | */ |
||
192 | protected function getAllRefs() |
||
199 | |||
200 | /** |
||
201 | * Returns working copy path as used specified it. |
||
202 | * |
||
203 | * @return string |
||
204 | */ |
||
205 | protected function getRawPath() |
||
219 | |||
220 | } |
||
221 |