dba_db4_010.phpt 941 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. DBA DB4 magic_quotes_runtime Test
  3. --SKIPIF--
  4. <?php
  5. $handler = "db4";
  6. require_once(dirname(__FILE__) .'/skipif.inc');
  7. die("info $HND handler used");
  8. ?>
  9. --FILE--
  10. <?php
  11. $handler = "db4";
  12. require_once(dirname(__FILE__) .'/test.inc');
  13. echo "database handler: $handler\n";
  14. if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
  15. ini_set('magic_quotes_runtime', 0);
  16. dba_insert("key1", '"', $db_file);
  17. var_dump(dba_fetch("key1", $db_file));
  18. ini_set('magic_quotes_runtime', 1);
  19. var_dump(dba_fetch("key1", $db_file));
  20. dba_replace("key1", '\"', $db_file);
  21. var_dump(dba_fetch("key1", $db_file));
  22. ini_set('magic_quotes_runtime', 0);
  23. var_dump(dba_fetch("key1", $db_file));
  24. dba_close($db_file);
  25. } else {
  26. echo "Error creating database\n";
  27. }
  28. ?>
  29. --CLEAN--
  30. <?php
  31. require(dirname(__FILE__) .'/clean.inc');
  32. ?>
  33. --EXPECTF--
  34. database handler: db4
  35. string(1) """
  36. string(2) "\""
  37. string(2) "\""
  38. string(1) """