php-src/ext/mysqli/tests/skipifconnectfailure.inc
Ulf Wendel 3a11ec8ba1 Same as for HEAD: Trying to skip tests if they can't connect to the
DB server. Note the environment variable MYSQL_TEST_SKIP_CONNECT_FAILURE
to control if you want tests that can't connect to fail or to be skipped.
2007-10-12 12:06:07 +00:00

11 lines
330 B
PHP
Executable File

<?php
require_once('connect.inc');
if ($skip_on_connect_failure) {
include_once('connect.inc');
$link = @mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!is_object($link))
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
mysqli_close($link);
}
?>