-
-
Save reiaguilera/82d164c7211e299d63ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// forked from lukeoliff/QuickGit.php | |
class QuickGit { | |
private $version; | |
function __construct() { | |
exec('git describe --always',$version_mini_hash); | |
exec('git rev-list HEAD | wc -l',$version_number); | |
exec('git log -1',$line); | |
$this->version['short'] = "v1.".trim($version_number[0]).".".$version_mini_hash[0]; | |
$this->version['full'] = "v1.".trim($version_number[0]).".$version_mini_hash[0] (".str_replace('commit ','',$line[0]).")"; | |
} | |
public function output() { | |
return $this->version; | |
} | |
public function show() { | |
echo $this->version; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment