]> granicus.if.org Git - php/commitdiff
Use flatfile if available.
authorMarcus Boerger <helly@php.net>
Fri, 15 Nov 2002 16:11:51 +0000 (16:11 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 15 Nov 2002 16:11:51 +0000 (16:11 +0000)
# This way we are using the internal library which we know about most.

ext/dba/tests/skipif.inc
ext/dba/tests/test.inc

index 050158703565e0772ff14bffe31b7cbbb60f1853..141c907111108a2c2da4162c9a9f4d4ccbe83441 100644 (file)
@@ -2,15 +2,19 @@
        if (!extension_loaded('dba')) die('skip dba extension not available');
        if (!function_exists('dba_handlers')) die ('skip dba_handlers() not available');
        if (!sizeof(dba_handlers())) die('skip no handlers installed');
-       // CDB currently supports only reading 
        $handler = dba_handlers(); 
-       if ($handler[0]=='cdb') {
+       if (in_array('flatfile', $handler)) {
+               $handler = 'flatfile';
+       } elseif ($handler[0]=='cdb') { // CDB currently supports only reading 
                if (count($handler)==1) {
                        die('skip CDB currently supports only reading');
                }
                if ($handler[1]=='cdb_make' && count($handler)==2) {
                        die('skip CDB currently supports only reading and creating');
                }
+               $handler = $handler[1];
+       } else {
+               $handler = $handler[0];
        }
-       $HND = strtoupper($handler[0]);
+       $HND = strtoupper($handler);
 ?>
index e280226f683c161ef686adcf4c32c232b231deca..402096dbe961d5dbae08c1ecce5b1d5435c6646f 100644 (file)
@@ -1,8 +1,9 @@
 <?php
        $db_filename = $db_file = dirname(__FILE__).'/test0.dbm';
        $handler = dba_handlers(); 
-       // CDB currently supports only reading 
-       if ($handler[0]=='cdb') {
+       if (in_array('flatfile', $handler)) {
+               $handler = 'flatfile';
+       } elseif ($handler[0]=='cdb') { // CDB currently supports only reading 
                if (count($handler)==1) {
                        die('CDB currently supports only reading ');
                }