Commit 1ee21f08 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-950 Changed method to determine ZP_VERSION so it contains the branch,

tag, offset and commit id, fixed access description.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 0f1c5977
...@@ -1237,7 +1237,7 @@ class TimezoneUtil { ...@@ -1237,7 +1237,7 @@ class TimezoneUtil {
// That's ugly and needs a proper fix. But for now this method can convert // That's ugly and needs a proper fix. But for now this method can convert
// - Europe/Berlin // - Europe/Berlin
// - W Europe Standard Time // - W Europe Standard Time
// to "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" // to "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"
// which is more correct than the hardcoded default of (GMT+00:00...) // which is more correct than the hardcoded default of (GMT+00:00...)
$tzName = ''; $tzName = '';
foreach (self::$phptimezones as $tzn => $phptzs) { foreach (self::$phptimezones as $tzn => $phptzs) {
...@@ -1296,11 +1296,11 @@ class TimezoneUtil { ...@@ -1296,11 +1296,11 @@ class TimezoneUtil {
} }
/** /**
* Pack timezone info for Sync * Pack timezone info for Sync.
* *
* @param array $tz * @param array $tz
* *
* @access private * @access public
* @return string * @return string
*/ */
static public function GetSyncBlobFromTZ($tz) { static public function GetSyncBlobFromTZ($tz) {
......
...@@ -42,11 +42,13 @@ ...@@ -42,11 +42,13 @@
************************************************/ ************************************************/
if (!defined("ZPUSH_VERSION")) { if (!defined("ZPUSH_VERSION")) {
$commit = exec("type git && git log --date=short --pretty=format:'%h/%ad' -1"); $path = escapeshellarg(dirname(realpath($_SERVER['SCRIPT_FILENAME'])));
if(preg_match("/^[\da-f]+\/\d{4}-\d{2}-\d{2}$/i", $commit)) { $branch = trim(exec("hash git && cd $path >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \"s/* \(.*\)/\\1/\""));
define("ZPUSH_VERSION", "GIT " . $commit); $version = exec("hash git && cd $path >/dev/null 2>&1 && git describe --always &2>/dev/null");
if ($branch && $version) {
define("ZPUSH_VERSION", $branch .'-'. $version);
} }
else { else {
define("ZPUSH_VERSION", "GIT"); define("ZPUSH_VERSION", "GIT");
} }
} }
\ 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