1 | <?php |
||
13 | class GitDataCollector extends DataCollector |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @param $repositoryCommitUrl |
||
18 | */ |
||
19 | public function __construct($repositoryCommitUrl) |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | public function reset() |
||
31 | |||
32 | /** |
||
33 | * Collect Git data for DebugBar (branch,commit,author,email,merge,date,message) |
||
34 | * |
||
35 | * @param Request $request |
||
36 | * @param Response $response |
||
37 | * @param \Exception $exception |
||
38 | */ |
||
39 | public function collect(Request $request, Response $response, \Exception $exception = null) |
||
150 | |||
151 | /** |
||
152 | * true if there is some data : used by the view |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | public function getGitData() |
||
162 | |||
163 | /** |
||
164 | * Actual branch name |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | public function getBranch() |
||
174 | |||
175 | /** |
||
176 | * Commit ID |
||
177 | * |
||
178 | * @return string |
||
179 | */ |
||
180 | public function getCommit() |
||
186 | |||
187 | /** |
||
188 | * Merge information |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | public function getMerge() |
||
198 | |||
199 | /** |
||
200 | * Author |
||
201 | * |
||
202 | * @return string |
||
203 | */ |
||
204 | public function getAuthor() |
||
210 | |||
211 | /** |
||
212 | * Author's email |
||
213 | * |
||
214 | * @return string |
||
215 | */ |
||
216 | public function getEmail() |
||
222 | |||
223 | /** |
||
224 | * Commit date |
||
225 | * |
||
226 | * @return string |
||
227 | */ |
||
228 | public function getDate() |
||
234 | |||
235 | /** |
||
236 | * Minutes since last commit |
||
237 | * |
||
238 | * @return string |
||
239 | */ |
||
240 | public function getTimeCommitIntervalMinutes() |
||
246 | |||
247 | /** |
||
248 | * Seconds since latest commit |
||
249 | * |
||
250 | * @return string |
||
251 | */ |
||
252 | public function getTimeCommitIntervalSeconds() |
||
258 | |||
259 | /** |
||
260 | * Commit message |
||
261 | * |
||
262 | * @return string |
||
263 | */ |
||
264 | public function getMessage() |
||
270 | |||
271 | /** |
||
272 | * Commit URL |
||
273 | * |
||
274 | * @return string |
||
275 | */ |
||
276 | public function getCommitUrl() |
||
282 | |||
283 | /** |
||
284 | * Checks and returns the data |
||
285 | * |
||
286 | * @param string $data |
||
287 | * @return string |
||
288 | */ |
||
289 | private function getData($data) |
||
295 | |||
296 | /** |
||
297 | * DataCollector name : used by service declaration into container.yml |
||
298 | * |
||
299 | * @return string |
||
300 | */ |
||
301 | public function getName() |
||
307 | |||
308 | /** |
||
309 | * change the icon color depending on the kernel version |
||
310 | * |
||
311 | * #3f3f3f < 2.8 |
||
312 | * #AAAAAA >= 2.8 |
||
313 | * |
||
314 | * @return string |
||
315 | */ |
||
316 | final public function getIconColor() |
||
323 | |||
324 | /** |
||
325 | * @return string |
||
326 | */ |
||
327 | private function getSymfonyVersion() |
||
334 | |||
335 | } |
||
336 |