@@ -194,7 +194,6 @@ public static function testPHPErrorMsg($start = true)
194194 /**
195195 * Test database connection
196196 *
197- * @param string $extension 'drizzle', 'mysql' or 'mysqli'
198197 * @param string $connect_type 'tcp' or 'socket'
199198 * @param string $host host name
200199 * @param string $port tcp port to use
@@ -206,7 +205,6 @@ public static function testPHPErrorMsg($start = true)
206205 * @return bool|array
207206 */
208207 public static function testDBConnection (
209- $ extension ,
210208 $ connect_type ,
211209 $ host ,
212210 $ port ,
@@ -219,6 +217,14 @@ public static function testDBConnection(
219217 $ socket = empty ($ socket ) || $ connect_type == 'tcp ' ? null : $ socket ;
220218 $ port = empty ($ port ) || $ connect_type == 'socket ' ? null : ': ' . $ port ;
221219 $ error = null ;
220+
221+ if (PMA_DatabaseInterface::checkDbExtension ('mysqli ' )) {
222+ $ extension = 'mysqli ' ;
223+ } else {
224+ $ extension = 'mysql ' ;
225+ }
226+
227+ // dead code (drizzle extension)
222228 if ($ extension == 'drizzle ' ) {
223229 while (1 ) {
224230 $ drizzle = @drizzle_create ();
@@ -315,7 +321,6 @@ public static function validateServer($path, $values)
315321 $ password = $ values ['Servers/1/nopassword ' ] ? null
316322 : $ values ['Servers/1/password ' ];
317323 $ test = static ::testDBConnection (
318- $ values ['Servers/1/extension ' ],
319324 $ values ['Servers/1/connect_type ' ],
320325 $ values ['Servers/1/host ' ],
321326 $ values ['Servers/1/port ' ],
@@ -365,7 +370,7 @@ public static function validatePMAStorage($path, $values)
365370 }
366371 if (! $ error ) {
367372 $ test = static ::testDBConnection (
368- $ values ['Servers/1/extension ' ], $ values [ ' Servers/1/ connect_type ' ],
373+ $ values ['Servers/1/connect_type ' ],
369374 $ values ['Servers/1/host ' ], $ values ['Servers/1/port ' ],
370375 $ values ['Servers/1/socket ' ], $ values ['Servers/1/controluser ' ],
371376 $ values ['Servers/1/controlpass ' ], 'Server_pmadb '
0 commit comments