]> granicus.if.org Git - php/commitdiff
MFH: info about handler used and use flatfile if available
authorMarcus Boerger <helly@php.net>
Fri, 15 Nov 2002 16:39:36 +0000 (16:39 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 15 Nov 2002 16:39:36 +0000 (16:39 +0000)
ext/dba/tests/dba001.phpt
ext/dba/tests/dba002.phpt
ext/dba/tests/dba003.phpt
ext/dba/tests/dba004.phpt
ext/dba/tests/dba005.phpt
ext/dba/tests/dba006.phpt
ext/dba/tests/dba007.phpt
ext/dba/tests/dba008.phpt
ext/dba/tests/skipif.inc
ext/dba/tests/test.inc

index 68d337337610ca1df4f36995e50fa94f6d329159..3d617fb2c231f1bd99a7a13f2f5f8cc354709320 100644 (file)
@@ -3,6 +3,7 @@ DBA File Creation Test
 --SKIPIF--
 <?php 
        require_once('skipif.inc');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index d4e4eb1710052f08110949eebacd9b4afa939a6f..3f862e38c5107155afeaed1b06e7d3560a36438d 100644 (file)
@@ -3,6 +3,7 @@ DBA Insert/Fetch Test
 --SKIPIF--
 <?php 
        require_once('skipif.inc');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index 5fdc622c1bc2c82708f9699bf16c1b8ae7505387..617ae91891ef6bb76205d8547543b66ef474e850 100644 (file)
@@ -3,6 +3,7 @@ DBA Insert/Replace/Fetch Test
 --SKIPIF--
 <?php 
        require_once('skipif.inc');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index 5403ae003309d24f3e117a69c4b90f502953eeb9..3b1f29c7dd6e230e42dc11b7420ceebbe6ae6c45 100644 (file)
@@ -3,6 +3,7 @@ DBA Multiple Insert/Fetch Test
 --SKIPIF--
 <?php 
        require_once('skipif.inc');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index d2b958ca61dc5f8fa6e5269a5a5861a01f74f60c..5a933c48f984be24feaf6042ad9219d7fedfb72a 100644 (file)
@@ -3,6 +3,7 @@ DBA FirstKey/NextKey Loop Test With 5 Items
 --SKIPIF--
 <?php 
        require_once('skipif.inc');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index a572a70f3b486c2bf3fb11cd622aeb063c49a357..efa36a5d0709b93047160b2751fce04bd9563a33 100644 (file)
@@ -3,6 +3,7 @@ DBA FirstKey/NextKey with 2 deletes
 --SKIPIF--
 <?php 
        require_once('skipif.inc');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index 65509bc2400a8cc1068f6251a864409262ea068f..0add3809aa0b6d965be54000080a07f9a093ea10 100644 (file)
@@ -4,6 +4,7 @@ DBA Multiple File Creation Test
 <?php 
        require_once('skipif.inc');
        if (!function_exists('dba_list')) die('skip dba_list() not available');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index a8bcafe8091603e9096fae2f4c6c8fae84cb8a41..340131c30b6535b8de8e36a53f3cd91f0452a389 100644 (file)
@@ -3,6 +3,7 @@ DBA magic_quotes_runtime Test
 --SKIPIF--
 <?php 
        require_once('skipif.inc');
+       die("info $HND handler used");
 ?>
 --FILE--
 <?php
index f4855b708b2985f48f0046ffa25fe76d46d34b40..141c907111108a2c2da4162c9a9f4d4ccbe83441 100644 (file)
@@ -2,14 +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);
 ?>
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 ');
                }