summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-04-10 19:53:49 +0300
committerAndrew Dolgov <[email protected]>2023-04-10 19:53:49 +0300
commit2420feb91fba0437441ebee381d0513c4d80bccd (patch)
tree86df56883e6a4e6daa44fffb9e8e5cbeb7448f99 /classes
parent8ccea1712e88cf79b973c0b5ec4792f525ed7465 (diff)
no more pointless txt files for version
Diffstat (limited to 'classes')
-rw-r--r--classes/config.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/classes/config.php b/classes/config.php
index 48bbc2258..8e202274f 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -323,12 +323,11 @@ class Config {
if (empty($this->version)) {
$this->version["status"] = -1;
- if (file_exists("$root_dir/version_static_official.txt")) {
- list ($version, $timestamp, $commit) = explode(" ", file_get_contents("$root_dir/version_static_official.txt"));
+ if (getenv("BUILD_TIMESTAMP") && getenv("CI_COMMIT_SHORT_SHA")) {
- $this->version["version"] = trim($version);
- $this->version["timestamp"] = strtotime(trim($timestamp));
- $this->version["commit"] = trim($commit);
+ $this->version["version"] = sprintf("%s-%s-%s", getenv("BUILD_TIMESTAMP"), getenv("CI_COMMIT_BRANCH"), getenv("CI_COMMIT_SHORT_SHA"));
+ $this->version["timestamp"] = strtotime(getenv("CI_COMMIT_TIMESTAMP"));
+ $this->version["commit"] = getenv("CI_COMMIT_SHA");
$this->version["status"] = 0;
} else if (PHP_OS === "Darwin") {