From f30287be652295d18e632316a66866697c26638c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 5 Dec 2019 13:23:54 +0300 Subject: versioning changes - remove VERSION_STATIC - https://community.tt-rss.org/t/versioning-changes-for-trunk/2974 - report git commit/timestamp properly by invoking git instead of trying to parse .git/HEAD etc - remove git-related global constants used when checking for updates --- include/version.php | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) (limited to 'include/version.php') diff --git a/include/version.php b/include/version.php index db5c2ec80..1851dea20 100644 --- a/include/version.php +++ b/include/version.php @@ -1,43 +1,30 @@ 0) { + list ($timestamp, $commit) = explode(" ", $output[0], 2); - return VERSION_STATIC . " ($suffix)"; + $git_commit = $commit; + $git_timestamp = $timestamp; - } else { - $suffix = substr(trim($head), 0, 7); - $timestamp = filemtime("$root_dir/.git/HEAD"); - - define("GIT_VERSION_HEAD", $suffix); - define("GIT_VERSION_TIMESTAMP", $timestamp); - - return VERSION_STATIC . " ($suffix)"; + $version = strftime("%y.%m", $timestamp) . "-$commit"; } } } - return VERSION_STATIC; - + return $version; } define('VERSION', get_version()); -- cgit v1.2.3