private function BenchmarkCommand::getGitHash in Devel 8
Same name and namespace in other branches
- 8.3 webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getGitHash()
- 8.2 webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getGitHash()
- 4.x webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getGitHash()
Return value
string
1 call to BenchmarkCommand::getGitHash()
- BenchmarkCommand::execute in webprofiler/
src/ Command/ BenchmarkCommand.php - Executes the current command.
File
- webprofiler/
src/ Command/ BenchmarkCommand.php, line 228
Class
- BenchmarkCommand
- Class BenchmarkCommand
Namespace
Drupal\webprofiler\CommandCode
private function getGitHash() {
try {
$process = new Process('git rev-parse HEAD');
$process
->setTimeout(3600);
$process
->run();
$git_hash = $process
->getOutput();
} catch (\Exception $e) {
$git_hash = $this
->trans('commands.webprofiler.benchmark.messages.not_git');
}
return $git_hash;
}