dba_db4_013.phpt 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --TEST--
  2. DBA DB4 File open("rl") & Insert 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. if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
  17. echo "database file created\n";
  18. dba_close($db_file);
  19. }
  20. if (($db_file = dba_popen($db_filename, "rl", $handler)) !== FALSE) {
  21. echo "database file opened\n";
  22. dba_insert("key1", "This is a test insert", $db_file);
  23. echo dba_fetch("key1", $db_file), "\n";
  24. dba_close($db_file);
  25. } else {
  26. echo "Error creating $db_filename\n";
  27. }
  28. ?>
  29. --CLEAN--
  30. <?php
  31. require(__DIR__ .'/clean.inc');
  32. ?>
  33. --EXPECTF--
  34. database handler: db4
  35. database file created
  36. database file opened
  37. Warning: dba_insert(): You cannot perform a modification to a database without proper access in %sdba_db4_013.php on line %d