1--TEST--
2phpinfo() mysqli section
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10    include("connect.inc");
11
12    @ob_clean();
13    ob_start();
14    phpinfo();
15    $phpinfo = ob_get_contents();
16    ob_end_clean();
17
18    /* all versions should at least dump this minimum information */
19    if (!stristr($phpinfo, "mysqli support"))
20        printf("[001] ext/mysqli should have exposed itself.\n");
21
22    if (!stristr($phpinfo, "client api library version"))
23        printf("[002] ext/mysqli should have exposed the library version.\n");
24
25    if (!stristr($phpinfo, "mysqli.default_host"))
26        printf("[003] php.ini setting mysqli.default_host not shown.\n");
27
28    if (!stristr($phpinfo, "mysqli.default_port"))
29        printf("[004] php.ini setting mysqli.default_port not shown.\n");
30
31    if (!stristr($phpinfo, "mysqli.default_pw"))
32        printf("[005] php.ini setting mysqli.default_pw not shown.\n");
33
34    if (!stristr($phpinfo, "mysqli.default_socket"))
35        printf("[006] php.ini setting mysqli.default_socket not shown.\n");
36
37    if (!stristr($phpinfo, "mysqli.default_user"))
38        printf("[007] php.ini setting mysqli.default_user not shown.\n");
39
40    if (!stristr($phpinfo, "mysqli.max_links"))
41        printf("[008] php.ini setting mysqli.max_links not shown.\n");
42
43    if (!stristr($phpinfo, "mysqli.reconnect"))
44        printf("[009] php.ini setting mysqli.reconnect not shown.\n");
45
46    if ($IS_MYSQLND) {
47        $expected = array(
48            'size',
49            'mysqli.allow_local_infile',
50            'mysqli.allow_persistent', 'mysqli.max_persistent'
51        );
52        foreach ($expected as $k => $entry)
53            if (!stristr($phpinfo, $entry))
54                printf("[010] Could not find entry for '%s'\n", $entry);
55    }
56
57    print "done!";
58?>
59--EXPECT--
60done!
61