require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: cdb
5YYYYY
["key5"]=>
string(23) "The last content string"
}
+--NO-LOCK--
+5YYYYY
+Content String 2
+array(5) {
+ ["key1"]=>
+ string(16) "Content String 1"
+ ["key2"]=>
+ string(16) "Content String 2"
+ ["key3"]=>
+ string(20) "Third Content String"
+ ["key4"]=>
+ string(22) "Another Content String"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: db2
3NYNYY
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: db3
3NYNYY
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: db4
3NYNYY
["key5"]=>
string(23) "The last content string"
}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: dbm
3NYNYY
["key5"]=>
string(23) "The last content string"
}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: flatfile
3NYNYY
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
// Read during write is system dependant. Important is that there is no deadlock
?>
+===DONE===
--EXPECTF--
database handler: gdbm
3NYNYY
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
-}
\ No newline at end of file
+}
+===DONE===
<?php
- echo "database handler: $handler\n";
+
+echo "database handler: $handler\n";
+
+do {
if (($db_file = dba_open($db_filename, 'n'.$lock_flag, $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
dba_insert("key2", "Content String 2", $db_file);
dba_close($dba_reader);
}
if (($db_file = dba_popen($db_filename, 'r'.($handler!='gdbm'?'-':''), $handler))!==FALSE) {
- }
+ }
+
+ if ($lock_flag == '') {
+ break;
+ } else {
+ echo "--NO-LOCK--\n";
+ $lock_flag = '';
+ }
+} while(1);
+
?>
\ No newline at end of file
require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: inifile
3NYNYY
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
require_once('test.inc');
require_once('dba_handler.inc');
?>
+===DONE===
--EXPECT--
database handler: ndbm
3NYNYY
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===