special version reporting for git
This commit is contained in:
parent
1e253d1ec9
commit
6316898f8d
|
@ -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());
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue