diff options
author | Jo Michael <me@mynetx.net> | 2012-04-14 02:02:06 +0400 |
---|---|---|
committer | Jo Michael <me@mynetx.net> | 2012-04-14 02:02:06 +0400 |
commit | 7ce27bb3d52c20801930f1f5dfdc44a327ffef82 (patch) | |
tree | b5bbc7e3fbe54157524a167b30fcc33161fb4e62 /main.php | |
parent | e6626004155fbf2932c36e84bc3c251b2a76dce3 (diff) |
Show Git revision details in right main.php column (hover SHA1 to read commit message)
Diffstat (limited to 'main.php')
-rw-r--r-- | main.php | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -231,6 +231,13 @@ if ($GLOBALS['cfg']['VersionCheck'] && ! $GLOBALS['PMA_Config']->get('is_https') $class = 'jsversioncheck'; } PMA_printListItem(__('Version information') . ': ' . PMA_VERSION, 'li_pma_version', null, null, null, null, $class); + +// if running in Git repo, show revision and branch +$GLOBALS['PMA_Config']->checkGitRevision(); +if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT')) { + PMA_printGitRevision(); +} + PMA_printListItem(__('Documentation'), 'li_pma_docs', 'Documentation.html', null, '_blank'); PMA_printListItem(__('Wiki'), 'li_pma_wiki', PMA_linkURL('http://wiki.phpmyadmin.net/'), null, '_blank'); @@ -442,6 +449,51 @@ function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = nu } /** +* Prints details about the current Git commit revision +*/ +function PMA_printGitRevision() +{ + // if using a remote commit fast-forwarded, link to Github + $commit_hash = substr($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH'), 0, 7); + $commit_hash = '<strong title="' + . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_MESSAGE')) . '">' + . $commit_hash . '</strong>'; + $branch = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH'); + if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTECOMMIT')) { + $commit_hash = + '<a href="' + . PMA_linkURL('https://github.com/phpmyadmin/phpmyadmin/commit/' + . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH')) + . '" target="_blank">' . $commit_hash . '</a>'; + } + if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTEBRANCH')) { + $branch = + '<a href="' + . PMA_linkURL('https://github.com/phpmyadmin/phpmyadmin/tree/' + . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH')) + . '" target="_blank">' . $branch . '</a>'; + } + + PMA_printListItem(__('Git revision') . ': ' + . sprintf( + __('%s from %s branch'), $commit_hash, $branch) . ',<br /> ' + . sprintf( + __('committed on %s by %s'), + PMA_localisedDate(strtotime($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER')['date'])), + '<a href="' . PMA_linkURL('mailto:' . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER')['email']) . '">' + . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER')['name']) . '</a>') + . ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR') != $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER') + ? ', <br />' + . sprintf( + __('authored on %s by %s'), + PMA_localisedDate(strtotime($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR')['date'])), + '<a href="' . PMA_linkURL('mailto:' . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR')['email']) . '">' + . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR')['name']) . '</a>') + : ''), + 'li_pma_version_git', null, null, null); +} + +/** * Displays the footer */ require 'libraries/footer.inc.php'; |