summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-04-10 18:05:13 +0300
committerAndrew Dolgov <[email protected]>2023-04-10 18:05:13 +0300
commit6920c445877a0d9fb4d65c03fa382c8a84e1aea1 (patch)
tree861adb291ab8458a122ba18a208e584bb94cf2bd /classes
parent566d164053ee3bbc986d0136917dca1a978c2637 (diff)
better static version
Diffstat (limited to 'classes')
-rw-r--r--classes/config.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/classes/config.php b/classes/config.php
index 09f68ea07..48bbc2258 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -311,7 +311,7 @@ class Config {
static function get_version_html() : string {
$version = self::get_version(false);
- return sprintf("<span title=\"%s\">%s</span>", date("Y-m-d H:i:s", ($version['timestamp'] ?? 0)), $version['version']);
+ return sprintf("<span title=\"%s\n%s\">%s</span>", date("Y-m-d H:i:s", ($version['timestamp'] ?? 0)), $version['commit'], $version['version']);
}
/**
@@ -323,7 +323,15 @@ class Config {
if (empty($this->version)) {
$this->version["status"] = -1;
- if (PHP_OS === "Darwin") {
+ if (file_exists("$root_dir/version_static_official.txt")) {
+ list ($version, $timestamp, $commit) = explode(" ", file_get_contents("$root_dir/version_static_official.txt"));
+
+ $this->version["version"] = trim($version);
+ $this->version["timestamp"] = strtotime(trim($timestamp));
+ $this->version["commit"] = trim($commit);
+ $this->version["status"] = 0;
+
+ } else if (PHP_OS === "Darwin") {
$this->version["version"] = "UNKNOWN (Unsupported, Darwin)";
} else if (file_exists("$root_dir/version_static.txt")) {
$this->version["version"] = trim(file_get_contents("$root_dir/version_static.txt")) . " (Unsupported)";