Laravel version update
Laravel version update
This commit is contained in:
39
vendor/sebastian/version/src/Version.php
vendored
39
vendor/sebastian/version/src/Version.php
vendored
@@ -15,8 +15,19 @@ namespace SebastianBergmann;
|
||||
*/
|
||||
class Version
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $path;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $release;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $version;
|
||||
|
||||
/**
|
||||
@@ -58,7 +69,8 @@ class Version
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param string $path
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
private function getGitInformation($path)
|
||||
@@ -67,11 +79,26 @@ class Version
|
||||
return false;
|
||||
}
|
||||
|
||||
$dir = getcwd();
|
||||
chdir($path);
|
||||
$returnCode = 1;
|
||||
$result = @exec('git describe --tags 2>&1', $output, $returnCode);
|
||||
chdir($dir);
|
||||
$process = proc_open(
|
||||
'git describe --tags',
|
||||
[
|
||||
1 => ['pipe', 'w'],
|
||||
2 => ['pipe', 'w'],
|
||||
],
|
||||
$pipes,
|
||||
$path
|
||||
);
|
||||
|
||||
if (!is_resource($process)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = trim(stream_get_contents($pipes[1]));
|
||||
|
||||
fclose($pipes[1]);
|
||||
fclose($pipes[2]);
|
||||
|
||||
$returnCode = proc_close($process);
|
||||
|
||||
if ($returnCode !== 0) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user