dba_db4_017.phpt 803 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. DBA DB4 file creation dba_open("cd")
  3. --EXTENSIONS--
  4. dba
  5. --SKIPIF--
  6. <?php
  7. $handler = "db4";
  8. require_once(__DIR__ .'/skipif.inc');
  9. ?>
  10. --FILE--
  11. <?php
  12. $handler = "db4";
  13. require_once(__DIR__ .'/test.inc');
  14. echo "database handler: $handler\n";
  15. if (($db_file = dba_open($db_filename, "cd", $handler)) !== FALSE) {
  16. if (file_exists($db_filename)) {
  17. echo "database file created\n";
  18. var_dump(dba_insert("key1", "This is a test insert", $db_file));
  19. echo dba_fetch("key1", $db_file), "\n";
  20. dba_close($db_file);
  21. } else {
  22. echo "File did not get created\n";
  23. }
  24. } else {
  25. echo "Error creating $db_filename\n";
  26. }
  27. ?>
  28. --CLEAN--
  29. <?php
  30. require(__DIR__ .'/clean.inc');
  31. ?>
  32. --EXPECT--
  33. database handler: db4
  34. database file created
  35. bool(true)
  36. This is a test insert