diff options
Diffstat (limited to 'includes/functions.php')
-rw-r--r-- | includes/functions.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/includes/functions.php b/includes/functions.php new file mode 100644 index 0000000..470a740 --- /dev/null +++ b/includes/functions.php @@ -0,0 +1,11 @@ +<?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"; + } +}
\ No newline at end of file |