]> git.wh0rd.org - tt-rss.git/blame - include/version.php
update static version
[tt-rss.git] / include / version.php
CommitLineData
1d3a17c7 1<?php
393fc7d6 2 define('VERSION_STATIC', '16.1');
6316898f
AD
3
4 function get_version() {
50d4b30b 5 date_default_timezone_set('UTC');
6316898f
AD
6 $root_dir = dirname(dirname(__FILE__));
7
3cda9e2a 8 if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/refs/heads/master")) {
6316898f 9
3cda9e2a 10 $suffix = substr(trim(file_get_contents("$root_dir/.git/refs/heads/master")), 0, 7);
efcc5d36
AD
11 $timestamp = filemtime("$root_dir/.git/refs/heads/master");
12
13 define("GIT_VERSION_HEAD", $suffix);
14 define("GIT_VERSION_TIMESTAMP", $timestamp);
6316898f 15
9959acc8 16 return VERSION_STATIC . " ($suffix)";
6316898f
AD
17 } else {
18 return VERSION_STATIC;
19 }
20 }
21
22 define('VERSION', get_version());
da61567a 23?>