mysqli_phpinfo.phpt 1.8 KB

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