1--TEST--
2mysqli_get_host_info()
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11    require_once 'connect.inc';
12    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
13        printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
14            $host, $user, $db, $port, $socket);
15        exit(1);
16    }
17
18    if (!is_string($info = mysqli_get_host_info($link)) || ('' === $info))
19        printf("[003] Expecting string/any_non_empty, got %s/%s\n", gettype($info), $info);
20
21    if ($host != 'localhost' && $host != '127.0.0.1' && $port != '' && $host != "" && strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
22        /* this should be a TCP/IP connection and not a Unix Socket (or SHM or Named Pipe) */
23        if (!stristr($info, "TCP/IP"))
24            printf("[004] Should be a TCP/IP connection but mysqlnd says '%s'\n", $info);
25    }
26    print "done!";
27?>
28--EXPECT--
29done!
30