Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / display_git_revision.lib.php
blob939c84f3fbe64dc36b764238f97d6f8cb6ce8e95
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Displays form for password change
6 * @package PhpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
13 * Prints details about the current Git commit revision
15 * @return void
17 function PMA_printGitRevision()
19 if (! $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT')) {
20 $response = PMA_Response::getInstance();
21 $response->isSuccess(false);
22 return;
25 // load revision data from repo
26 $GLOBALS['PMA_Config']->checkGitRevision();
28 // if using a remote commit fast-forwarded, link to Github
29 $commit_hash = substr(
30 $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH'),
34 $commit_hash = '<strong title="'
35 . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_MESSAGE'))
36 . '">' . $commit_hash . '</strong>';
37 if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTECOMMIT')) {
38 $commit_hash = '<a href="'
39 . PMA_linkURL(
40 'https://github.com/phpmyadmin/phpmyadmin/commit/'
41 . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH')
43 . '" target="_blank">' . $commit_hash . '</a>';
46 $branch = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH');
47 if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTEBRANCH')) {
48 $branch = '<a href="'
49 . PMA_linkURL(
50 'https://github.com/phpmyadmin/phpmyadmin/tree/'
51 . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH')
53 . '" target="_blank">' . $branch . '</a>';
55 if ($branch !== false) {
56 $branch = sprintf(__('%1$s from %2$s branch'), $commit_hash, $branch);
57 } else {
58 $branch = $commit_hash . ' (' . __('no branch') . ')';
61 $committer = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER');
62 $author = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR');
63 PMA_printListItem(
64 __('Git revision') . ': '
65 . $branch . ',<br /> '
66 . sprintf(
67 __('committed on %1$s by %2$s'),
68 PMA_Util::localisedDate(strtotime($committer['date'])),
69 '<a href="' . PMA_linkURL('mailto:' . $committer['email']) . '">'
70 . htmlspecialchars($committer['name']) . '</a>'
72 . ($author != $committer
73 ? ', <br />'
74 . sprintf(
75 __('authored on %1$s by %2$s'),
76 PMA_Util::localisedDate(strtotime($author['date'])),
77 '<a href="' . PMA_linkURL('mailto:' . $author['email']) . '">'
78 . htmlspecialchars($author['name']) . '</a>'
80 : ''),
81 'li_pma_version_git', null, null, null