From d30c122f3745862d1b73ed7eac1170fef7ddc158 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 15 Feb 2019 22:10:31 +0000 Subject: [PATCH] possible handling of mysql socket file --- tests/bootstrap.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ed0446f3..58198367 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -55,11 +55,18 @@ if (getenv('DATABASE') == 'mysql') { $config = parse_ini_file($expand_tilde('~/.my.cnf')); - var_dump($config); - if (empty($config)) { $config = ['user'=>'root', 'host' => '127.0.0.1', 'password' => '']; } + + if (isset($config['socket'])) { + $CONF['database_socket'] = $config['socket']; + Config::write('database_socket', $config['socket']); + } else { + $CONF['database_host'] = $config['host']; + Config::write('database_host', $config['host']); + } + $CONF['database_type'] = 'mysql'; $CONF['database_user'] = $config['user']; $CONF['database_pass'] = $config['password'];