]>
git.wh0rd.org - tt-rss.git/blob - include/version.php
2 define('VERSION_STATIC', '17.1');
4 function get_version() {
5 date_default_timezone_set('UTC');
6 $root_dir = dirname(dirname(__FILE__
));
8 if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/HEAD")) {
9 $head = trim(file_get_contents("$root_dir/.git/HEAD"));
14 if (preg_match("/^ref: (.*)/", $head, $matches)) {
17 $suffix = substr(trim(file_get_contents("$root_dir/.git/$ref")), 0, 7);
18 $timestamp = filemtime("$root_dir/.git/$ref");
20 define("GIT_VERSION_HEAD", $suffix);
21 define("GIT_VERSION_TIMESTAMP", $timestamp);
23 return VERSION_STATIC
. " ($suffix)";
26 $suffix = substr(trim($head), 0, 7);
27 $timestamp = filemtime("$root_dir/.git/HEAD");
29 define("GIT_VERSION_HEAD", $suffix);
30 define("GIT_VERSION_TIMESTAMP", $timestamp);
32 return VERSION_STATIC
. " ($suffix)";
37 return VERSION_STATIC
;
41 define('VERSION', get_version());