php-src/ext/dba/tests/dba_optimize.phpt

43 lines
860 B
Plaintext
Raw Normal View History

2010-03-02 04:33:18 +08:00
--TEST--
DBA Optimize Test
2021-06-11 20:33:54 +08:00
--EXTENSIONS--
dba
2010-03-02 04:33:18 +08:00
--SKIPIF--
<?php
require_once __DIR__ .'/skipif.inc';
die("info $HND handler used");
?>
2010-03-02 04:33:18 +08:00
--FILE--
<?php
require_once(__DIR__ .'/test.inc');
2010-03-02 04:33:18 +08:00
echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
dba_insert("key2", "Content String 2", $db_file);
$a = dba_firstkey($db_file);
$i=0;
while($a) {
$a = dba_nextkey($db_file);
$i++;
}
echo $i;
for ($i=1; $i<3; $i++) {
echo dba_exists("key$i", $db_file) ? "Y" : "N";
}
echo "\n";
var_dump(dba_optimize($db_file));
dba_close($db_file);
} else {
echo "Error creating database\n";
}
?>
--CLEAN--
2018-09-17 01:16:42 +08:00
<?php
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
2010-03-02 04:33:18 +08:00
database handler: flatfile
2YY
bool(true)