1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-29 13:31:28 +00:00

add support for custom version_static.txt for package maintainers

This commit is contained in:
Andrew Dolgov
2019-12-08 08:58:23 +03:00
parent 76dd74e0d9
commit 5907409a84

View File

@@ -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 = [];