1<?php 2 if (!extension_loaded('dba')) die('skip dba extension not available'); 3 if (!function_exists('dba_handlers')) die ('skip dba_handlers() not available'); 4 if (!sizeof(dba_handlers())) die('skip no handlers installed'); 5 if (!isset($handler)) { 6 $handlers = dba_handlers(); 7 if (in_array('flatfile', $handlers)) { 8 $handler = 'flatfile'; 9 } else { 10 $handlers = array_diff($handlers, array('cdb', 'cdb_make')); /* these can only read OR write */ 11 if (count($handlers)==0) { 12 die('skip no handler available that can be used for the test'); 13 } 14 $handler = array_shift($handlers); 15 } 16 } else { 17 if (!in_array($handler, dba_handlers())) { 18 $HND = strtoupper($handler); 19 die("skip $HND handler not available"); 20 } 21 } 22 $HND = strtoupper($handler); 23?> 24