Commit 26c6dff9 authored by Manfred Kutas's avatar Manfred Kutas

Merge pull request #3 in ZP/z-push from feature/ZP-636-show-git-info-in-log to develop

* commit '4f93756d':
  ZP-636 #comment read last commit from 'git log'. If git is not available only "GIT" will be displayed.
parents 1e51bf35 4f93756d
......@@ -6,7 +6,7 @@
*
* Created : 18.04.2008
*
* Copyright 2007 - 2013 Zarafa Deutschland GmbH
* Copyright 2007 - 2013, 2015 Zarafa Deutschland GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
......@@ -42,12 +42,13 @@
************************************************/
if (!defined("ZPUSH_VERSION")) {
if (file_exists(".svn/entries")) {
$svn = file(".svn/entries");
define("ZPUSH_VERSION", "SVN " . substr(trim($svn[4]),stripos($svn[4],"z-push")+7) ." r".trim($svn[3]));
$commit = exec("type git && git log --date=short --pretty=format:'%h/%ad' -1");
if(preg_match("/^[\da-f]+\/\d{4}-\d{2}-\d{2}$/i", $commit)) {
define("ZPUSH_VERSION", "GIT " . $commit);
}
else {
define("ZPUSH_VERSION", "GIT");
}
else
define("ZPUSH_VERSION", "SVN checkout");
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment