public static getGitVersion ( ) : string | ||
리턴 | string | Like "1.9.4" or "2.3.0" |
public static function getGitVersion()
{
$gitInfo = self::getGitInfo();
if (empty($gitInfo)) {
throw new \Exception("Git not available");
} else {
return $gitInfo['git-version'];
}
}
/** * @return string "ok", "no-git" or "wrong-version" */ private function tryGit() { try { $gitVersion = SystemInfo::getGitVersion(); return self::gitMatchesMinimumRequiredVersion($gitVersion) ? "ok" : "wrong-version"; } catch (Exception $e) { return "no-git"; } }