From 32a4dd5157aa63084318ee18159dec0ab4c26e05 Mon Sep 17 00:00:00 2001 From: Alexander Barsukov Date: Thu, 19 May 2022 16:02:57 +0300 Subject: [PATCH] added throwing exception --- version.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/version.inc.php b/version.inc.php index 884f299..367985a 100644 --- a/version.inc.php +++ b/version.inc.php @@ -90,8 +90,10 @@ 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; + exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . "/VERSION" , $out, $ret); + if($ret != 0) + throw new Exception("git error"); + $minutes = (time() - strtotime($out[0])) / 60; return ceil($minutes); } \ No newline at end of file