From d668184dc124aa72b06799c07b6ab5bddb1799f3 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 23 Mar 2018 05:11:51 +0100 Subject: Extend configuration options --- Applications/phpmyadmin/config.inc.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Applications/phpmyadmin/config.inc.php') diff --git a/Applications/phpmyadmin/config.inc.php b/Applications/phpmyadmin/config.inc.php index 46d5e70..1f1288b 100644 --- a/Applications/phpmyadmin/config.inc.php +++ b/Applications/phpmyadmin/config.inc.php @@ -59,6 +59,34 @@ if(getenv('DB_SERVICE_USER') != '') { $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; } +elseif(getenv('DB_SERVICE_HOST') != '') { + $i++; + $cfg['Servers'][$i]['extension'] = 'mysqli'; + $cfg['Servers'][$i]['host'] = getenv('DB_SERVICE_HOST'); + if (getenv('DB_SERVICE_PORT')) + $cfg['Servers'][$i]['port'] = getenv('DB_SERVICE_PORT'); + else + $cfg['Servers'][$i]['port'] = 3306; + + if (getenv('DB_SERVICE_CONTROL_USER')) { + $cfg['Servers'][$i]['controluser'] = getenv('DB_SERVICE_CONTROL_USER'); + $cfg['Servers'][$i]['controlpass'] = getenv('DB_SERVICE_CONTROL_PASSWORD'); + } +} + +if(getenv('DB_EXTRA_HOSTS') != '') { + $list = explode(",", getenv('DB_EXTRA_HOSTS')); + foreach ($list as $item) { + $pair = explode(":", $item); + if (!$pair[1]) $pair[1] = 3306; + + $i++; + $cfg['Servers'][$i]['extension'] = 'mysqli'; + $cfg['Servers'][$i]['host'] = $pair[0]; + $cfg['Servers'][$i]['port'] = $pair[1]; + } +} + /** * phpMyAdmin configuration storage settings. */ -- cgit v1.2.3