diff --git a/app/system/app_languages.php b/app/system/app_languages.php index 34aa9b8926..d91c386113 100644 --- a/app/system/app_languages.php +++ b/app/system/app_languages.php @@ -143,7 +143,7 @@ $text['label-switch']['uk'] = "перемикач"; $text['label-switch']['de-at'] = "Schalter"; $text['label-switch']['it-it'] = "Switch"; -$text['label-git_branch']['en-us'] = "Branch:"; +$text['label-git_branch']['en-us'] = "Branch"; $text['label-git_branch']['es-cl'] = "Rama"; $text['label-git_branch']['pt-pt'] = "Ramo"; $text['label-git_branch']['fr-fr'] = "Une succursale"; @@ -152,9 +152,9 @@ $text['label-git_branch']['pl'] = "Gałąź"; $text['label-git_branch']['sv-se'] = "Gren"; $text['label-git_branch']['uk'] = "філія"; $text['label-git_branch']['de-at'] = "Ast"; -$text['label-git_branch']['it-it'] = "Branch:"; +$text['label-git_branch']['it-it'] = "Branch"; -$text['label-git_commit']['en-us'] = "Commit:"; +$text['label-git_commit']['en-us'] = "Commit"; $text['label-git_commit']['es-cl'] = "Cometer"; $text['label-git_commit']['pt-pt'] = "cometer"; $text['label-git_commit']['fr-fr'] = "Commettre"; @@ -163,9 +163,9 @@ $text['label-git_commit']['pl'] = "Popełnić"; $text['label-git_commit']['sv-se'] = "Begå"; $text['label-git_commit']['uk'] = "здійснити"; $text['label-git_commit']['de-at'] = "Verpflichten"; -$text['label-git_commit']['it-it'] = "Commit:"; +$text['label-git_commit']['it-it'] = "Commit"; -$text['label-git_origin']['en-us'] = "Origin:"; +$text['label-git_origin']['en-us'] = "Origin"; $text['label-git_origin']['es-cl'] = "Origen"; $text['label-git_origin']['pt-pt'] = "Origem"; $text['label-git_origin']['fr-fr'] = "Origine"; @@ -174,7 +174,18 @@ $text['label-git_origin']['pl'] = "Pochodzenie"; $text['label-git_origin']['sv-se'] = "Ursprung"; $text['label-git_origin']['uk'] = "походження"; $text['label-git_origin']['de-at'] = "Herkunft"; -$text['label-git_origin']['it-it'] = "Origine:"; +$text['label-git_origin']['it-it'] = "Origine"; + +$text['label-git_status']['en-us'] = "Status"; +$text['label-git_status']['es-cl'] = "Estado de"; +$text['label-git_status']['pt-pt'] = "Status do"; +$text['label-git_status']['fr-fr'] = "Statut"; +$text['label-git_status']['pt-br'] = "Status do"; +$text['label-git_status']['pl'] = "Status"; +$text['label-git_status']['sv-se'] = "Status"; +$text['label-git_status']['uk'] = "Статус"; +$text['label-git_status']['de-at'] = "Status"; +$text['label-git_status']['it-it'] = "Stato"; $text['label-memcache_status']['en-us'] = "Memcache Status"; $text['label-memcache_status']['es-cl'] = "Estado de Memcache"; diff --git a/app/system/system.php b/app/system/system.php index 075ae9096c..96738976a8 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -89,20 +89,29 @@ $document['title'] = $text['title-sys-status']; if(file_exists($git_path)){ $git_exe = 'git'; if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') { $git_exe = shell_exec('which git'); } + shell_exec($git_exe.' --git-dir='.$git_path.' fetch'); $git_branch = shell_exec($git_exe.' --git-dir='.$git_path.' name-rev --name-only HEAD'); rtrim($git_branch); $git_commit = shell_exec($git_exe.' --git-dir='.$git_path.' rev-parse HEAD'); rtrim($git_commit); $git_origin = shell_exec($git_exe.' --git-dir='.$git_path.' config --get remote.origin.url'); - rtrim($git_commit); + rtrim($git_origin); + $git_origin = preg_replace('/\.git$/','',$git_origin); + $git_status = shell_exec($git_exe.' --git-dir='.$git_path.' status | grep "Your branch"'); + rtrim($git_status); + $git_age = shell_exec($git_exe.' --git-dir='.$git_path.' log --pretty=format:%at HEAD^!'); + rtrim($git_age); + $git_date = DateTime::createFromFormat('U', $git_age); + $git_age = $git_date->diff(new DateTime('now')); echo "