Server IP : 162.213.251.212 / Your IP : 18.218.131.11 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/allssztx/public_html/easybuyer/vendor/facade/ignition/src/Middleware/ |
Upload File : |
<?php namespace Facade\Ignition\Middleware; use Facade\FlareClient\Report; use ReflectionClass; use Symfony\Component\Process\Exception\RuntimeException; use Symfony\Component\Process\Process; class AddGitInformation { public function handle(Report $report, $next) { try { $report->group('git', [ 'hash' => $this->hash(), 'message' => $this->message(), 'tag' => $this->tag(), 'remote' => $this->remote(), ]); } catch (RuntimeException $exception) { } return $next($report); } public function hash(): ?string { return $this->command("git log --pretty=format:'%H' -n 1"); } public function message(): ?string { return $this->command("git log --pretty=format:'%s' -n 1"); } public function tag(): ?string { return $this->command('git describe --tags --abbrev=0'); } public function remote(): ?string { return $this->command('git config --get remote.origin.url'); } protected function command($command) { $process = (new ReflectionClass(Process::class))->hasMethod('fromShellCommandline') ? Process::fromShellCommandline($command, base_path()) : new Process($command, base_path()); $process->run(); return trim($process->getOutput()); } }