diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-05-06 14:21:18 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-05-06 14:21:18 +0200 |
commit | 914c3e0d8131837a085747d25d5948963f8256d4 (patch) | |
tree | 8b76327cfb35cc0c8d2da47c4c55c5f4e6b0d259 | |
parent | f51b6add6ab5b062ccfaa36326a1b19f128c6d30 (diff) |
Print last commit date as (git) version
-rw-r--r-- | program/include/rcube_output_html.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/program/include/rcube_output_html.php b/program/include/rcube_output_html.php index 237bc817b..37edb62b9 100644 --- a/program/include/rcube_output_html.php +++ b/program/include/rcube_output_html.php @@ -770,6 +770,13 @@ class rcube_output_html extends rcube_output if (preg_match('/Revision:\s(\d+)/', @shell_exec('svn info'), $regs)) $ver .= ' [SVN r'.$regs[1].']'; } + else if (is_file(INSTALL_PATH . '.git/index')) { + if (preg_match('/Date:\s+([^\n]+)/', @shell_exec('git log -1'), $regs)) { + if ($date = date('Ymd.Hi', strtotime($regs[1]))) { + $ver .= ' [GIT '.$date.']'; + } + } + } $content = html::quote($ver); } else if ($object == 'steptitle') { |