Skip to content

Commit

Permalink
Allow to specify verbose names
Browse files Browse the repository at this point in the history
Fixes #54

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Sep 22, 2016
1 parent 55a4594 commit fc12c99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -85,8 +85,10 @@ Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma

* ``PMA_ARBITRARY`` - when set to 1 connection to the arbitrary server will be allowed
* ``PMA_HOST`` - define address/host name of the MySQL server
* ``PMA_VERBOSE`` - define verbose name of the MySQL server
* ``PMA_PORT`` - define port of the MySQL server
* ``PMA_HOSTS`` - define comma separated list of address/host names of the MySQL servers
* ``PMA_VERBOSES`` - define comma separated list of verbose names of the MySQL servers
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username to use for config authentication method
* ``PMA_ABSOLUTE_URI`` - define user-facing URI

Expand Down
5 changes: 5 additions & 0 deletions config.inc.php
Expand Up @@ -36,13 +36,18 @@
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = explode(',', $_ENV['PMA_HOSTS']);
$verbose = explode(',', $_ENV['PMA_VERBOSES']);
}

/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($_ENV['PMA_PORT'])) {
$cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT'];
}
Expand Down

0 comments on commit fc12c99

Please sign in to comment.