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);
143 $db_reader = @dba_open($name, 'r'.$lock_flag.$test_flag, $handler);
171 $db_reader = dba_open($name, 'r'.$lock_flag, $handler);
176 if (($db_file = dba_popen($db_filename, 'r'.($lock_flag==''?'':'-'), $handler))!==FALSE) {
177 if ($handler == 'dbm' || $handler == "tcadb") {
186 function run_creation_tests_ex(string $handler, string $file_suffix, string $pre_req): void
188 $db_name = $handler . $file_suffix;
194 $db = dba_open($db_name, $arg, $handler);
217 function run_creation_tests(string $handler): void
219 $extension = $handler === 'tcadb' ? 'tch' : 'db';
222 run_creation_tests_ex($handler, '_not_existing.'.$extension, '');
226 run_creation_tests_ex($handler, '_existing.'.$extension, 'dba_open($db_name, "n", $handler);');
230 … run_creation_tests_ex($handler, '_random.txt', 'file_put_contents($db_name, "Dummy contents");');
233 function clean_creation_tests(string $handler): void {
234 $db_name = $handler . '_not_existing.db';
236 $db_name = $handler . '_existing.db';
238 $db_name = $handler . '_random.txt';
242 function run_standard_tests(string $handler, string $name): void {
245 set_up_db($handler, $name, LockFlag::FileLock);
246 run_standard_tests_ex($handler, $name, LockFlag::FileLock);
251 set_up_db($handler, $name, LockFlag::DbLock);
252 run_standard_tests_ex($handler, $name, LockFlag::DbLock);
263 set_up_db($handler, $name, LockFlag::NoLock);
264 run_standard_tests_ex($handler, $name, LockFlag::NoLock);