summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-12-08 08:58:23 +0300
committerAndrew Dolgov <[email protected]>2019-12-08 08:58:23 +0300
commit5907409a84b83dd1ac19ec11ef18cab1000da486 (patch)
treec6473d2a90ecb4c15cbf88360d393c802f019e9a /include
parent76dd74e0d94f38fb605f46b4a3ebe03700d00bb7 (diff)
add support for custom version_static.txt for package maintainers
Diffstat (limited to 'include')
-rw-r--r--include/version.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/version.php b/include/version.php
index 1851dea20..72bed3bd4 100644
--- a/include/version.php
+++ b/include/version.php
@@ -1,12 +1,18 @@
<?php
+ /* for package maintainers who don't use git: if version_static.txt exists in tt-rss root
+ directory, its contents are displayed instead of git commit-based version, this could be generated
+ based on source git tree commit used when creating the package */
+
function get_version(&$git_commit = false, &$git_timestamp = false) {
$version = "UNKNOWN (Unsupported)";
date_default_timezone_set('UTC');
$root_dir = dirname(dirname(__FILE__));
- if (is_dir("$root_dir/.git")) {
+ if (file_exists("$root_dir/version_static.txt")) {
+ $version = file_get_contents("$root_dir/version_static.txt") . " (Unsupported)";
+ } else if (is_dir("$root_dir/.git")) {
$rc = 0;
$output = [];