summaryrefslogtreecommitdiff
path: root/include/version.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-12-20 18:05:55 +0300
committerAndrew Dolgov <[email protected]>2019-12-20 18:05:55 +0300
commit4b44103b849912714e2f044b62d158c8188f3a81 (patch)
tree2e7bf0ef01a34f4c89ddcf8db052a813ec57c55a /include/version.php
parent573784c316c44280fef319117720479c3dc052ed (diff)
parent63ee91c82e3fa17f5ade147aff8d319104b9e52e (diff)
Merge branch 'master' of git.fakecake.org:tt-rss into weblate-integration
Diffstat (limited to 'include/version.php')
-rw-r--r--include/version.php36
1 files changed, 0 insertions, 36 deletions
diff --git a/include/version.php b/include/version.php
deleted file mode 100644
index d1c5e03b5..000000000
--- a/include/version.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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 (file_exists("$root_dir/version_static.txt")) {
- $version = trim(file_get_contents("$root_dir/version_static.txt")) . " (Unsupported)";
- } else if (is_dir("$root_dir/.git")) {
- $rc = 0;
- $output = [];
-
- exec("git log --pretty='%ct %h' -n1 HEAD " . escapeshellarg($root_dir), $output, $rc);
-
- if ($rc == 0) {
- if (is_array($output) && count($output) > 0) {
- list ($timestamp, $commit) = explode(" ", $output[0], 2);
-
- $git_commit = $commit;
- $git_timestamp = $timestamp;
-
- $version = strftime("%y.%m", $timestamp) . "-$commit";
- }
- }
- }
-
- return $version;
- }
-
- define('VERSION', get_version());