1--TEST-- 2DBA CDB handler test 3--SKIPIF-- 4<?php 5$handler = 'cdb'; 6require_once(__DIR__ .'/skipif.inc'); 7die('info CDB does not support replace or delete'); 8?> 9--FILE-- 10<?php 11 12$handler = 'cdb'; 13require_once(__DIR__ .'/test.inc'); 14 15echo "Test 0\n"; 16 17if (($db_file = dba_open($db_filename, 'n', $handler))!==FALSE) { 18 var_dump(dba_insert("key1", "Content String 1", $db_file)); 19 var_dump(dba_replace("key1", "New Content String", $db_file)); 20 var_dump(dba_fetch("key1", $db_file)); 21 var_dump(dba_firstkey($db_file)); 22 var_dump(dba_delete("key1", $db_file)); 23 var_dump(dba_optimize($db_file)); 24 var_dump(dba_sync($db_file)); 25 dba_close($db_file); 26} 27else { 28 echo "Failed to open DB\n"; 29} 30 31unlink($db_filename); 32 33echo "Test 1\n"; 34 35if (($db_file = dba_open($db_filename, 'c', $handler))!==FALSE) { 36 dba_insert("key1", "Content String 1", $db_file); 37 dba_close($db_file); 38} 39else { 40 echo "Failed to open DB\n"; 41} 42 43echo "Test 2\n"; 44 45if (($db_file = dba_open($db_filename, 'r', $handler))!==FALSE) { 46 dba_insert("key1", "Content String 1", $db_file); 47 dba_close($db_file); 48} 49else { 50 echo "Failed to open DB\n"; 51} 52 53echo "Test 3\n"; 54 55if (($db_file = dba_open($db_filename, 'w', $handler))!==FALSE) { 56 echo dba_fetch("key1", $db_file), "\n"; 57 dba_close($db_file); 58} 59else { 60 echo "Failed to open DB\n"; 61} 62 63?> 64--CLEAN-- 65<?php 66require(__DIR__ .'/clean.inc'); 67?> 68--EXPECTF-- 69Test 0 70bool(true) 71bool(false) 72bool(false) 73bool(false) 74bool(false) 75bool(true) 76bool(true) 77Test 1 78 79Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: cdb: Update operations are not supported in %sdba_cdb_001.php on line %d 80Failed to open DB 81Test 2 82 83Warning: dba_insert(): You cannot perform a modification to a database without proper access in %sdba_cdb_001.php on line %d 84Test 3 85 86Warning: dba_open(%stest0.dbm,w): Driver initialization failed for handler: cdb: Update operations are not supported in %sdba_cdb_001.php on line %d 87Failed to open DB 88