dba_db4_017.phpt 814 B

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