Lines Matching refs:handler
15 function check_skip(string $handler) {
20 if (!in_array($handler, $handlers)) {
21 $HND = strtoupper($handler);
22 die("skip $HND handler not available");
27 foreach (dba_handlers() as $handler) {
29 if ($handler !== 'cdb' && $handler !== 'cdb_make' && $handler !== 'inifile') {
30 echo 'Using handler: "', $handler, '"', \PHP_EOL;
31 return $handler;
46 function set_up_db_ex(string $handler, string $name, LockFlag $lock, bool $persistent = false) {
51 $db_file = $func($name, 'n'.$lock_flag, $handler);
72 function set_up_db(string $handler, string $name, LockFlag $lock = LockFlag::FileLock): void {
73 $db_file = set_up_db_ex($handler, $name, $lock);
74 // Close creation/truncation handler
89 function run_standard_tests_ex(string $handler, string $name, LockFlag $lock, bool $persistent = fa…
92 set_up_db($handler, $name, $lock);
93 $db_writer = dba_open($name, 'w'.$lock_flag, $handler);
128 $db_reader = @dba_open($name, 'r'.$lock_flag.$test_flag, $handler);
156 $db_reader = dba_open($name, 'r'.$lock_flag, $handler);
161 if (($db_file = dba_popen($db_filename, 'r'.($lock_flag==''?'':'-'), $handler))!==FALSE) {
162 if ($handler == 'dbm' || $handler == "tcadb") {
171 function run_creation_tests_ex(string $handler, string $file_suffix, string $pre_req): void
173 $db_name = $handler . $file_suffix;
179 $db = dba_open($db_name, $arg, $handler);
202 function run_creation_tests(string $handler): void
204 $extension = $handler === 'tcadb' ? 'tch' : 'db';
207 run_creation_tests_ex($handler, '_not_existing.'.$extension, '');
211 run_creation_tests_ex($handler, '_existing.'.$extension, 'dba_open($db_name, "n", $handler);');
215 … run_creation_tests_ex($handler, '_random.txt', 'file_put_contents($db_name, "Dummy contents");');
218 function clean_creation_tests(string $handler): void {
219 $db_name = $handler . '_not_existing.db';
221 $db_name = $handler . '_existing.db';
223 $db_name = $handler . '_random.txt';
227 function run_standard_tests(string $handler, string $name): void {
230 set_up_db($handler, $name, LockFlag::FileLock);
231 run_standard_tests_ex($handler, $name, LockFlag::FileLock);
236 set_up_db($handler, $name, LockFlag::DbLock);
237 run_standard_tests_ex($handler, $name, LockFlag::DbLock);
248 set_up_db($handler, $name, LockFlag::NoLock);
249 run_standard_tests_ex($handler, $name, LockFlag::NoLock);