From 7b9038fc0bb17ad9eec99a447c1a9409e3d461ca Mon Sep 17 00:00:00 2001 From: Matthew Vale Date: Mon, 7 Dec 2015 17:32:20 +0000 Subject: [PATCH 1/3] changed label to text[*] --- app/system/app_languages.php | 10 ++++++++++ app/system/system.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/system/app_languages.php b/app/system/app_languages.php index f7a67d4e6c..f0c4985ccb 100644 --- a/app/system/app_languages.php +++ b/app/system/app_languages.php @@ -80,6 +80,16 @@ $text['label-os']['sv-se'] = "Operativsystem"; $text['label-os']['uk'] = "Операційна система "; $text['label-os']['de-at'] = "Betriebssystem"; +$text['label-version']['en-us'] = "Version"; +$text['label-version']['es-cl'] = ""; +$text['label-version']['pt-pt'] = ""; +$text['label-version']['fr-fr'] = ""; +$text['label-version']['pt-br'] = ""; +$text['label-version']['pl'] = ""; +$text['label-version']['sv-se'] = ""; +$text['label-version']['uk'] = ""; +$text['label-version']['de-at'] = ""; + $text['label-git_info']['en-us'] = "Git Information"; $text['label-git_info']['es-cl'] = ""; $text['label-git_info']['pt-pt'] = ""; diff --git a/app/system/system.php b/app/system/system.php index 59a42528b7..510f1aa4eb 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -78,7 +78,7 @@ $document['title'] = $text['title-sys-status']; if (permission_exists('system_view_info')) { echo "\n"; echo " \n"; - echo " Version\n"; + echo " ".$text['label-version']."\n"; echo " \n"; echo " \n"; echo " ".software_version()."\n"; From 47d8040fed7b4d248f4c15d25e7ddb87f2cdcd51 Mon Sep 17 00:00:00 2001 From: Matthew Vale Date: Mon, 7 Dec 2015 17:37:41 +0000 Subject: [PATCH 2/3] use $git_path to determine if it is a git install --- app/system/system.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/app/system/system.php b/app/system/system.php index 510f1aa4eb..84fa5e9ac6 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -86,22 +86,24 @@ $document['title'] = $text['title-sys-status']; echo "\n"; $git_path = normalize_path_to_os($_SERVER["DOCUMENT_ROOT"]."/.git"); - $git_branch = shell_exec('git --git-dir='.$git_path.' name-rev --name-only HEAD'); - rtrim($git_branch); - $git_commit = shell_exec('git --git-dir='.$git_path.' rev-parse HEAD'); - rtrim($git_commit); - $git_origin = shell_exec('git --git-dir='.$git_path.' config --get remote.origin.url'); - rtrim($git_commit); - echo "\n"; - echo " \n"; - echo " ".$text['label-git_info']."\n"; - echo " \n"; - echo " \n"; - echo " ".$text['label-git_branch']." ".$git_branch."
\n"; - echo " ".$text['label-git_commit']." ".$git_commit."
\n"; - echo " ".$text['label-git_origin']." ".$git_origin."
\n"; - echo " \n"; - echo "\n"; + if(file_exists($git_path)){ + $git_branch = shell_exec('git --git-dir='.$git_path.' name-rev --name-only HEAD'); + rtrim($git_branch); + $git_commit = shell_exec('git --git-dir='.$git_path.' rev-parse HEAD'); + rtrim($git_commit); + $git_origin = shell_exec('git --git-dir='.$git_path.' config --get remote.origin.url'); + rtrim($git_commit); + echo "\n"; + echo " \n"; + echo " ".$text['label-git_info']."\n"; + echo " \n"; + echo " \n"; + echo " ".$text['label-git_branch']." ".$git_branch."
\n"; + echo " ".$text['label-git_commit']." ".$git_commit."
\n"; + echo " ".$text['label-git_origin']." ".$git_origin."
\n"; + echo " \n"; + echo "\n"; + } echo "\n";