From 91ce168e2c835919581df602b33fdb56e8f21185 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Wed, 9 Mar 2011 01:22:33 +0100 Subject: add version information to footer --- inc/html.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/html.inc.php b/inc/html.inc.php index a580899..f8a5b62 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php @@ -34,10 +34,24 @@ EOT; function html_end() { global $CONFIG; + + $git = '/usr/bin/git'; + $changelog = $CONFIG['webdir'].'/doc/CHANGELOG'; + + $version = 'v?'; + if (file_exists($git) && is_dir($CONFIG['webdir'].'/.git')) { + chdir($CONFIG['webdir']); + $version = exec($git.' describe'); + } elseif (file_exists($changelog)) { + $changelog = file($changelog); + $version = explode(' ', $changelog[0]); + $version = 'v'.$version[0]; + } + echo << -- cgit v1.1