Skip to content

Commit d5a587d

Browse files
Évan Goujonlinux0r
authored andcommitted
Specify MySQL socket file via PMA_SOCKET and PMA_SOCKETS environment variables
Signed-off-by: Évan Goujon <evan.goujon@gmail.com>
1 parent 7a1cbfd commit d5a587d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

etc/phpmyadmin/config.inc.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
'PMA_VERBOSES',
1212
'PMA_PORT',
1313
'PMA_PORTS',
14+
'PMA_SOCKET',
15+
'PMA_SOCKETS',
1416
'PMA_USER',
1517
'PMA_PASSWORD',
1618
'PMA_ABSOLUTE_URI',
@@ -56,6 +58,11 @@
5658
$verbose = explode(',', $_ENV['PMA_VERBOSES']);
5759
$ports = explode(',', $_ENV['PMA_PORTS']);
5860
}
61+
if (!empty($_ENV['PMA_SOCKET'])) {
62+
$sockets = array($_ENV['PMA_SOCKET']);
63+
} elseif (!empty($_ENV['PMA_SOCKETS'])) {
64+
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
65+
}
5966

6067
/* Server settings */
6168
for ($i = 1; isset($hosts[$i - 1]); $i++) {
@@ -110,6 +117,12 @@
110117
$cfg['Servers'][$i]['compress'] = false;
111118
$cfg['Servers'][$i]['AllowNoPassword'] = true;
112119
}
120+
for ($i = 1; isset($sockets[$i - 1]); $i++) {
121+
if (isset($sockets[$i - 1])) {
122+
$cfg['Servers'][$i]['socket'] = $sockets[$i - 1];
123+
$cfg['Servers'][$i]['host'] = 'localhost';
124+
}
125+
}
113126
/*
114127
* Revert back to last configured server to make
115128
* it easier in config.user.inc.php

0 commit comments

Comments
 (0)