diff options
author | Andrew Dolgov <[email protected]> | 2019-12-05 13:23:54 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-12-05 13:23:54 +0300 |
commit | f30287be652295d18e632316a66866697c26638c (patch) | |
tree | 18bf35592426824682d9c106553a38688d4f4c7f /classes/rpc.php | |
parent | 6913158b8291c70cdab79641e771e2e89e11ac3e (diff) |
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
Diffstat (limited to 'classes/rpc.php')
-rwxr-xr-x | classes/rpc.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/classes/rpc.php b/classes/rpc.php index 84c9cfe92..af5bdf52c 100755 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -590,15 +590,20 @@ class RPC extends Handler_Protected { function checkforupdates() { $rv = []; - if (CHECK_FOR_UPDATES && $_SESSION["access_level"] >= 10 && defined("GIT_VERSION_TIMESTAMP")) { + $git_timestamp = false; + $git_commit = false; + + get_version($git_commit, $git_timestamp); + + if (CHECK_FOR_UPDATES && $_SESSION["access_level"] >= 10 && $git_timestamp) { $content = @fetch_file_contents(["url" => "https://srv.tt-rss.org/version.json"]); if ($content) { $content = json_decode($content, true); if ($content && isset($content["changeset"])) { - if ((int)GIT_VERSION_TIMESTAMP < (int)$content["changeset"]["timestamp"] && - GIT_VERSION_HEAD != $content["changeset"]["id"]) { + if ($git_timestamp < (int)$content["changeset"]["timestamp"] && + $git_commit != $content["changeset"]["id"]) { $rv = $content["changeset"]; } |