summaryrefslogtreecommitdiff
path: root/ext/dba/tests
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-11-10 22:07:17 +0000
committerMarcus Boerger <helly@php.net>2002-11-10 22:07:17 +0000
commit89b586d4156a270cc9c45fc6bcd42a7e1e59ca84 (patch)
tree97fe09dba181caf9ad4d5f4cc851aef5b2242910 /ext/dba/tests
parente19165b356cafabb545e578577c7242efe936f27 (diff)
downloadphp-git-89b586d4156a270cc9c45fc6bcd42a7e1e59ca84.tar.gz
Use 'l' to open database file with locking on .lck file.
Diffstat (limited to 'ext/dba/tests')
-rw-r--r--ext/dba/tests/dba_handler.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc
index 87a77b7873..acc8dd4e2a 100644
--- a/ext/dba/tests/dba_handler.inc
+++ b/ext/dba/tests/dba_handler.inc
@@ -1,6 +1,7 @@
<?php
echo "database handler: $handler\n";
- if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
+ @unlink($db_filename);
+ if (($db_file = @dba_open($db_filename, "nl", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
dba_insert("key2", "Content String 2", $db_file);
dba_insert("key3", "Third Content String", $db_file);
@@ -26,8 +27,8 @@
} else {
echo "Error creating database\n";
}
- $db_writer=dba_open($db_filename, "w", $handler);
- if (($dba_reader=dba_open($db_filename, "r", $handler))===false) {
+ $db_writer = @dba_open($db_filename, "wl", $handler);
+ if (($dba_reader = @dba_open($db_filename, "rlt", $handler))===false) {
echo "Cannot read during write operation\n";
} else {
echo "Read during write permitted\n";
@@ -43,7 +44,7 @@
} else {
die("Error reopening database\n");
}
- if (($db_file=dba_open($db_filename, "r", $handler))!==FALSE) {
+ if (($db_file = @dba_open($db_filename, "rd", $handler))!==FALSE) {
$key = dba_firstkey($db_file);
$res = array();
while($key) {