blob: defa152ce126aee4c13dc705fa2570bca7d02c77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<?php
function version() {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.version")) {
return substr(trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.version")), 0, 8);
} else if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.git/refs/heads/trunk")) {
return substr(trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.git/refs/heads/trunk")), 0, 8);
} else {
return "trunk";
}
}
function build() {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.build")) {
return substr(trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.build")), 0, 8);
} else {
return "dev";
}
}
|