special version reporting for git

This commit is contained in:
Andrew Dolgov 2013-04-23 20:22:55 +04:00
parent 1e253d1ec9
commit 6316898f8d
1 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,18 @@
<?php
define('VERSION', "1.7.8");
define('VERSION_STATIC', '1.7.8');
function get_version() {
$root_dir = dirname(dirname(__FILE__));
if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/ORIG_HEAD")) {
$suffix = date("Ymd", filemtime("$root_dir/.git/ORIG_HEAD"));
return VERSION_STATIC . ".$suffix";
} else {
return VERSION_STATIC;
}
}
define('VERSION', get_version());
?>