Created
July 24, 2013 10:34
-
-
Save tairov/6069516 to your computer and use it in GitHub Desktop.
get git revision
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
public static function getGitRev() | |
{ | |
if (APPLICATION_ENV == 'local') return time(); | |
if (!isset(self::$_gitRev)) { | |
self::$_gitRev = 0; | |
self::$_gitRev = trim(@file_get_contents(APPLICATION_PATH . '/../.git/ORIG_HEAD')) ?: md5(time()); | |
} | |
return self::$_gitRev; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment