From 9238572dad1606dc3dab774028b791b99df7b745 Mon Sep 17 00:00:00 2001 From: alban Date: Sat, 22 Mar 2014 15:59:45 +0100 Subject: [PATCH] =?UTF-8?q?[fix]=C2=A0test=20bootstrap=20:=20broken=20mysq?= =?UTF-8?q?l=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit/bootstrap.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php index e2e40dd2..1d1d8205 100644 --- a/phpunit/bootstrap.php +++ b/phpunit/bootstrap.php @@ -88,27 +88,27 @@ if ( is_readable("my.cnf") ) { $mysqlConfigFile = file("my.cnf"); } else if(is_readable('my.cnf_generic')){ $mysqlConfigFile = file('my.cnf_generic'); - - foreach ($mysqlConfigFile as $line) { - if (preg_match('/^([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $matches)) { - switch ($matches[1]) { - case "user": - $user = $matches[2]; - break; - case "password": - $password = $matches[2]; - break; - case "database": - $database = $matches[2]; - break; - } - } - if (preg_match('/^#alternc_var ([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $matches)) { - $$matches[1] = $matches[2]; - } - } } +foreach ($mysqlConfigFile as $line) { + if (preg_match('/^([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $matches)) { + switch ($matches[1]) { + case "user": + $user = $matches[2]; + break; + case "password": + $password = $matches[2]; + break; + case "database": + $database = $matches[2]; + break; + } + } + if (preg_match('/^#alternc_var ([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $matches)) { + $$matches[1] = $matches[2]; + } +} + /** * Class for MySQL management in the bureau