From 5ffb3af9911b2c210717d6a3855106b0621be91a Mon Sep 17 00:00:00 2001 From: Alexander Barsukov Date: Wed, 18 May 2022 22:49:51 +0300 Subject: [PATCH] added lifetime calculation for VERSION file --- version.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/version.inc.php b/version.inc.php index 0ba6e55..884f299 100644 --- a/version.inc.php +++ b/version.inc.php @@ -86,3 +86,12 @@ function get_inc_game_version() return $string; } +function get_version_file_lifetime() +{ + global $GAME_ROOT; + + exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . "/VERSION" , $creating_timestamp); + $minutes = (time() - strtotime($creating_timestamp[0])) / 60; + + return ceil($minutes); +} \ No newline at end of file