public function DrupalDataCollector::collect in Devel 4.x
Same name and namespace in other branches
- 8.3 webprofiler/src/DataCollector/DrupalDataCollector.php \Drupal\webprofiler\DataCollector\DrupalDataCollector::collect()
- 8 webprofiler/src/DataCollector/DrupalDataCollector.php \Drupal\webprofiler\DataCollector\DrupalDataCollector::collect()
- 8.2 webprofiler/src/DataCollector/DrupalDataCollector.php \Drupal\webprofiler\DataCollector\DrupalDataCollector::collect()
File
- webprofiler/
src/ DataCollector/ DrupalDataCollector.php, line 47
Class
- DrupalDataCollector
- Class DrupalDataCollector.
Namespace
Drupal\webprofiler\DataCollectorCode
public function collect(Request $request, Response $response, \Exception $exception = NULL) {
$this->data['version'] = Drupal::VERSION;
$this->data['profile'] = \Drupal::installProfile();
$this->data['config_url'] = (new Url('webprofiler.settings', [], [
'query' => $this->redirectDestination
->getAsArray(),
]))
->toString();
try {
$process = new Process("git log -1 --pretty=format:'%H - %s (%ci)' --abbrev-commit");
$process
->setTimeout(3600);
$process
->mustRun();
$this->data['git_commit'] = $process
->getOutput();
$process = new Process("git log -1 --pretty=format:'%h' --abbrev-commit");
$process
->setTimeout(3600);
$process
->mustRun();
$this->data['abbr_git_commit'] = $process
->getOutput();
} catch (ProcessFailedException $e) {
$this->data['git_commit'] = $this->data['git_commit_abbr'] = NULL;
} catch (RuntimeException $e) {
$this->data['git_commit'] = $this->data['git_commit_abbr'] = NULL;
}
}