]> git.wh0rd.org - tt-rss.git/blobdiff - include/version.php
1.15.3 to fix tag/version mismatch
[tt-rss.git] / include / version.php
index 65af7f452f102c9752faad6990d80e0b7bab3381..a7ca8a32b43faef7433b2afec41bad43401f29f6 100644 (file)
@@ -1,3 +1,19 @@
 <?php
-       define('VERSION', "1.7.4");
+       define('VERSION_STATIC', '1.15.3');
+
+       function get_version() {
+               date_default_timezone_set('UTC');
+               $root_dir = dirname(dirname(__FILE__));
+
+               if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/refs/heads/master")) {
+
+                       $suffix = substr(trim(file_get_contents("$root_dir/.git/refs/heads/master")), 0, 7);
+
+                       return VERSION_STATIC . ".$suffix";
+               } else {
+                       return VERSION_STATIC;
+               }
+       }
+
+       define('VERSION', get_version());
 ?>