+ }
+//TODO: currently we just ignore options specified on the end of the DSN
+ if (preg_match('|^(.+?)\?(.+)$|', $matches[5], $database_name_options_matches)) {
+ $matches[5] = $database_name_options_matches[1];
+ $matches[7] = $database_name_options_matches[2];
+ }
+ if ($matches[8] === 'unix' && !empty($matches[9]))
+ $pdo_prefs_dsn = $matches[1] . ':unix_socket=' . $matches[9] . ';dbname=' . $matches[5];
+ else
+ $pdo_prefs_dsn = $matches[1] . ':host=' . $matches[4] . (!empty($matches[6]) ? ';port=' . $matches[6] : '') . ';dbname=' . $matches[5];