PageRenderTime 368ms CodeModel.GetById 91ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/mysqli/tests/mysqli_phpinfo.php

http://github.com/facebook/hiphop-php
PHP | 61 lines | 48 code | 12 blank | 1 comment | 12 complexity | 8c7273e0a4a26f21bfaa0b3b69d7104a MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. include("connect.inc");
  3. @ob_clean();
  4. ob_start();
  5. phpinfo();
  6. $phpinfo = ob_get_contents();
  7. ob_end_clean();
  8. /* all versions should at least dump this minimum information */
  9. if (!stristr($phpinfo, "mysqli support"))
  10. printf("[001] ext/mysqli should have exposed itself.\n");
  11. if (!stristr($phpinfo, "client api library version"))
  12. printf("[002] ext/mysqli should have exposed the library version.\n");
  13. if (!stristr($phpinfo, "mysqli.default_host"))
  14. printf("[003] php.ini setting mysqli.default_host not shown.\n");
  15. if (!stristr($phpinfo, "mysqli.default_port"))
  16. printf("[004] php.ini setting mysqli.default_port not shown.\n");
  17. if (!stristr($phpinfo, "mysqli.default_pw"))
  18. printf("[005] php.ini setting mysqli.default_pw not shown.\n");
  19. if (!stristr($phpinfo, "mysqli.default_socket"))
  20. printf("[006] php.ini setting mysqli.default_socket not shown.\n");
  21. if (!stristr($phpinfo, "mysqli.default_user"))
  22. printf("[007] php.ini setting mysqli.default_user not shown.\n");
  23. if (!stristr($phpinfo, "mysqli.max_links"))
  24. printf("[008] php.ini setting mysqli.max_links not shown.\n");
  25. if (!stristr($phpinfo, "mysqli.reconnect"))
  26. printf("[009] php.ini setting mysqli.reconnect not shown.\n");
  27. if ($IS_MYSQLND) {
  28. $expected = array(
  29. 'mysqlnd statistics',
  30. 'bytes_sent', 'bytes_received', 'packets_sent', 'packets_received',
  31. 'protocol_overhead_in', 'protocol_overhead_out', 'result_set_queries',
  32. 'non_result_set_queries', 'no_index_used', 'bad_index_used',
  33. 'buffered_sets', 'unbuffered_sets', 'ps_buffered_sets', 'ps_unbuffered_sets',
  34. 'flushed_normal_sets', 'flushed_ps_sets', 'rows_fetched_from_server',
  35. 'rows_fetched_from_client', 'rows_skipped', 'copy_on_write_saved',
  36. 'copy_on_write_performed', 'command_buffer_too_small', 'connect_success',
  37. 'connect_failure', 'connection_reused', 'explicit_close', 'implicit_close',
  38. 'disconnect_close', 'in_middle_of_command_close', 'explicit_free_result',
  39. 'implicit_free_result', 'explicit_stmt_close', 'implicit_stmt_close',
  40. 'size',
  41. 'mysqli.allow_local_infile',
  42. 'mysqli.allow_persistent', 'mysqli.max_persistent'
  43. );
  44. foreach ($expected as $k => $entry)
  45. if (!stristr($phpinfo, $entry))
  46. printf("[010] Could not find entry for '%s'\n", $entry);
  47. }
  48. print "done!";
  49. ?>