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