dba_db4_009.phpt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --TEST--
  2. DBA DB4 Multiple File Creation Test
  3. --EXTENSIONS--
  4. dba
  5. --SKIPIF--
  6. <?php
  7. $handler = "db4";
  8. require_once(__DIR__ .'/skipif.inc');
  9. die("info $HND handler used");
  10. ?>
  11. --FILE--
  12. <?php
  13. $handler = "db4";
  14. require_once(__DIR__ .'/test.inc');
  15. echo "database handler: $handler\n";
  16. $db_file1 = $db_filename1 = __DIR__.'/test1.dbm';
  17. $db_file2 = $db_filename2 = __DIR__.'/test2.dbm';
  18. if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
  19. echo "database file created\n";
  20. } else {
  21. echo "$db_file does not exist\n";
  22. }
  23. if (($db_file1=dba_open($db_file1, "n", $handler))!==FALSE) {
  24. echo "database file created\n";
  25. } else {
  26. echo "$db_file does not exist\n";
  27. }
  28. if (($db_file2=dba_open($db_file2, "n", $handler))!==FALSE) {
  29. echo "database file created\n";
  30. } else {
  31. echo "$db_file does not exist\n";
  32. }
  33. var_dump(dba_list());
  34. dba_close($db_file);
  35. @unlink($db_filename1);
  36. @unlink($db_filename2);
  37. ?>
  38. --CLEAN--
  39. <?php
  40. require(__DIR__ .'/clean.inc');
  41. ?>
  42. --EXPECTF--
  43. database handler: db4
  44. database file created
  45. database file created
  46. database file created
  47. array(3) {
  48. [%d]=>
  49. string(%d) "%stest0.dbm"
  50. [%d]=>
  51. string(%d) "%stest1.dbm"
  52. [%d]=>
  53. string(%d) "%stest2.dbm"
  54. }