]> git.wh0rd.org - tt-rss.git/blobdiff - include/version.php
update static version
[tt-rss.git] / include / version.php
index 7396f81e07130c4174efc2a7dcdd6ffcf7467e4d..dfef9da57a656329979ac3310f40e2e24555e589 100644 (file)
@@ -1,15 +1,19 @@
 <?php
-       define('VERSION_STATIC', '1.7.9');
+       define('VERSION_STATIC', '16.1');
 
        function get_version() {
                date_default_timezone_set('UTC');
                $root_dir = dirname(dirname(__FILE__));
 
-               if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/ORIG_HEAD")) {
+               if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/refs/heads/master")) {
 
-                       $suffix = substr(trim(file_get_contents("$root_dir/.git/ORIG_HEAD")), 0, 7);
+                       $suffix = substr(trim(file_get_contents("$root_dir/.git/refs/heads/master")), 0, 7);
+                       $timestamp = filemtime("$root_dir/.git/refs/heads/master");
 
-                       return VERSION_STATIC . ".$suffix";
+                       define("GIT_VERSION_HEAD", $suffix);
+                       define("GIT_VERSION_TIMESTAMP", $timestamp);
+
+                       return VERSION_STATIC . " ($suffix)";
                } else {
                        return VERSION_STATIC;
                }