mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 02:05:56 +00:00
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
This commit is contained in:
@@ -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"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user