MFH?
On Fri, 15 Nov 2002, Marcus Boerger wrote:
>helly Fri Nov 15 11:11:51 2002 EDT
>
> Modified files:
> /php4/ext/dba/tests skipif.inc test.inc
> Log:
> Use flatfile if available.
> # This way we are using the internal library which we know about most.
>
>
>Index: php4/ext/dba/tests/skipif.inc
>diff -u php4/ext/dba/tests/skipif.inc:1.4 php4/ext/dba/tests/skipif.inc:1.5
>--- php4/ext/dba/tests/skipif.inc:1.4 Fri Nov 15 10:58:09 2002
>+++ php4/ext/dba/tests/skipif.inc Fri Nov 15 11:11:51 2002
>@@ -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: php4/ext/dba/tests/test.inc
>diff -u php4/ext/dba/tests/test.inc:1.7 php4/ext/dba/tests/test.inc:1.8
>--- php4/ext/dba/tests/test.inc:1.7 Mon Nov 11 07:00:58 2002
>+++ php4/ext/dba/tests/test.inc Fri Nov 15 11:11:51 2002
>@@ -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 ');
> }
>
>
>
>
--
<- For Sale! ->
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php