public function DrupalDataCollector::collect in Devel 8.2
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()
- 4.x webprofiler/src/DataCollector/DrupalDataCollector.php \Drupal\webprofiler\DataCollector\DrupalDataCollector::collect()
File
- webprofiler/
src/ DataCollector/ DrupalDataCollector.php, line 46
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_get_profile();
$this->data['config_url'] = (new Drupal\Core\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;
}
}