summaryrefslogtreecommitdiff
path: root/include/version.php
blob: 07b6c4a00ebfb14862d5a8192c2786600c11d446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
	define('VERSION_STATIC', '1.7.8');

	function get_version() {
		$root_dir = dirname(dirname(__FILE__));

		if (is_dir("$root_dir/.git") && file_exists("$root_dir/.git/ORIG_HEAD")) {

			$suffix = date("Ymd", filemtime("$root_dir/.git/ORIG_HEAD"));

			return VERSION_STATIC . ".$suffix";
		} else {
			return VERSION_STATIC;
		}
	}

	define('VERSION', get_version());
?>