diff options
Diffstat (limited to 'includes/core/Main.php')
-rw-r--r-- | includes/core/Main.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/includes/core/Main.php b/includes/core/Main.php new file mode 100644 index 0000000..1bf1062 --- /dev/null +++ b/includes/core/Main.php @@ -0,0 +1,16 @@ +<?php + +namespace WebCore; + +include "Metadata.php"; + +class Main { + public static function version(): string { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.git/refs/heads/trunk")) { + return substr(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.git/refs/heads/trunk"), 0, 8); + } else if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.version")) { + return substr(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.version"), 0, 8); + } + return "live"; + } +}
\ No newline at end of file |