Merge branch 'PHP-7.4'

* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
This commit is contained in:
Peter Kokot 2019-03-15 23:36:47 +01:00
commit 6426420f61
2816 changed files with 5578 additions and 5578 deletions

View file

@ -5,13 +5,13 @@ get_included_files() tests
var_dump(get_included_files()); var_dump(get_included_files());
include(dirname(__FILE__)."/014.inc"); include(__DIR__."/014.inc");
var_dump(get_included_files()); var_dump(get_included_files());
include_once(dirname(__FILE__)."/014.inc"); include_once(__DIR__."/014.inc");
var_dump(get_included_files()); var_dump(get_included_files());
include(dirname(__FILE__)."/014.inc"); include(__DIR__."/014.inc");
var_dump(get_included_files()); var_dump(get_included_files());
echo "Done\n"; echo "Done\n";

View file

@ -151,7 +151,7 @@ foreach ($array_variables as $array_var) {
echo "\n*** Testing unset(), empty() & isset() with resource variables ***\n"; echo "\n*** Testing unset(), empty() & isset() with resource variables ***\n";
$fp = fopen(__FILE__, "r"); $fp = fopen(__FILE__, "r");
$dfp = opendir( dirname(__FILE__) ); $dfp = opendir( __DIR__ );
$resources = array ( $resources = array (
$fp, $fp,
$dfp $dfp

View file

@ -15,7 +15,7 @@ class debugfilter extends php_user_filter {
stream_filter_register("myfilter","debugfilter"); stream_filter_register("myfilter","debugfilter");
$fp = fopen(dirname(__FILE__)."/test.txt","w"); $fp = fopen(__DIR__."/test.txt","w");
stream_filter_append($fp, "myfilter"); stream_filter_append($fp, "myfilter");
stream_filter_append($fp, "myfilter"); stream_filter_append($fp, "myfilter");
stream_filter_append($fp, "myfilter"); stream_filter_append($fp, "myfilter");
@ -24,8 +24,8 @@ print "Done.\n";
fclose($fp); fclose($fp);
// Uncommenting the following 'print' line causes the segfault to stop occurring // Uncommenting the following 'print' line causes the segfault to stop occurring
// print "2\n"; // print "2\n";
readfile(dirname(__FILE__)."/test.txt"); readfile(__DIR__."/test.txt");
unlink(dirname(__FILE__)."/test.txt"); unlink(__DIR__."/test.txt");
?> ?>
--EXPECT-- --EXPECT--
Done. Done.

View file

@ -23,14 +23,14 @@ class Loader {
var_dump("flush!"); var_dump("flush!");
} }
function stream_close() { function stream_close() {
@unlink(dirname(__FILE__)."/bug38779.txt"); @unlink(__DIR__."/bug38779.txt");
var_dump("close!"); var_dump("close!");
} }
} }
stream_wrapper_register('Loader', 'Loader'); stream_wrapper_register('Loader', 'Loader');
$fp = fopen ('Loader://qqq.php', 'r'); $fp = fopen ('Loader://qqq.php', 'r');
$filename = dirname(__FILE__)."/bug38779.txt"; $filename = __DIR__."/bug38779.txt";
$fp1 = fopen($filename, "w"); $fp1 = fopen($filename, "w");
fwrite($fp1, "<"."?php blah blah?".">"); fwrite($fp1, "<"."?php blah blah?".">");
fclose($fp1); fclose($fp1);
@ -42,9 +42,9 @@ echo "Done\n";
--CLEAN-- --CLEAN--
<?php <?php
$filename = dirname(__FILE__)."/bug38779.txt"; $filename = __DIR__."/bug38779.txt";
if (file_exists($filename)) { if (file_exists($filename)) {
@unlink(dirname(__FILE__)."/bug38779.txt"); @unlink(__DIR__."/bug38779.txt");
} }
?> ?>
--EXPECTF-- --EXPECTF--

View file

@ -3,11 +3,11 @@ Bug #39542 (Behaviour of require_once/include_once different to < 5.2.0)
--FILE-- --FILE--
<?php <?php
$oldcwd = getcwd(); $oldcwd = getcwd();
chdir(dirname(__FILE__)); chdir(__DIR__);
if (substr(PHP_OS, 0, 3) == 'WIN') { if (substr(PHP_OS, 0, 3) == 'WIN') {
set_include_path(dirname(__FILE__).'/bug39542;.'); set_include_path(__DIR__.'/bug39542;.');
} else { } else {
set_include_path(dirname(__FILE__).'/bug39542:.'); set_include_path(__DIR__.'/bug39542:.');
} }
spl_autoload_register(function ($class) { spl_autoload_register(function ($class) {

View file

@ -7,7 +7,7 @@ if (extension_loaded("readline")) die("skip Test doesn't support readline");
--FILE-- --FILE--
<?php <?php
$php = getenv('TEST_PHP_EXECUTABLE'); $php = getenv('TEST_PHP_EXECUTABLE');
$cmd = "\"$php\" -n -d memory_limit=4M -a \"".dirname(__FILE__)."\"/bug40236.inc"; $cmd = "\"$php\" -n -d memory_limit=4M -a \"".__DIR__."\"/bug40236.inc";
echo `$cmd`; echo `$cmd`;
?> ?>
--EXPECTF-- --EXPECTF--

View file

@ -3,7 +3,7 @@ Bug #52508 (newline problem with parse_ini_file+INI_SCANNER_RAW)
--FILE-- --FILE--
<?php <?php
$file = dirname(__FILE__) .'/bug52508.ini'; $file = __DIR__ .'/bug52508.ini';
file_put_contents($file, "a = 1"); file_put_contents($file, "a = 1");

View file

@ -2,7 +2,7 @@
Bug #63741 (Crash when autoloading from spl) Bug #63741 (Crash when autoloading from spl)
--FILE-- --FILE--
<?php <?php
file_put_contents(dirname(__FILE__)."/bug63741.tmp.php", file_put_contents(__DIR__."/bug63741.tmp.php",
<<<'EOT' <<<'EOT'
<?php <?php
if (isset($autoloading)) if (isset($autoloading))
@ -41,10 +41,10 @@ else
EOT EOT
); );
include dirname(__FILE__)."/bug63741.tmp.php"; include __DIR__."/bug63741.tmp.php";
?> ?>
--CLEAN-- --CLEAN--
<?php unlink(dirname(__FILE__)."/bug63741.tmp.php"); ?> <?php unlink(__DIR__."/bug63741.tmp.php"); ?>
--EXPECT-- --EXPECT--
autoloading... autoloading...
OK! OK!

View file

@ -11,7 +11,7 @@ class test {
?> ?>
DATA; DATA;
$filename = dirname(__FILE__)."/cc003.dat"; $filename = __DIR__."/cc003.dat";
file_put_contents($filename, $class_data); file_put_contents($filename, $class_data);
function foo($v = test::val) { function foo($v = test::val) {

View file

@ -6,7 +6,7 @@ variables_order="egpcs"
<?php <?php
function test() { function test() {
include dirname(__FILE__)."/globals.inc"; include __DIR__."/globals.inc";
} }
test(); test();

View file

@ -4,18 +4,18 @@ __HALT_COMPILER(); 2 files
<?php <?php
$text = "<?php echo 'test'; var_dump(__COMPILER_HALT_OFFSET__); __HALT_COMPILER(); ?> $text = "<?php echo 'test'; var_dump(__COMPILER_HALT_OFFSET__); __HALT_COMPILER(); ?>
hi there"; hi there";
file_put_contents(dirname(__FILE__) . '/test1.php', $text); file_put_contents(__DIR__ . '/test1.php', $text);
$text = "<?php echo 'test2'; var_dump(__COMPILER_HALT_OFFSET__); __HALT_COMPILER(); ?> $text = "<?php echo 'test2'; var_dump(__COMPILER_HALT_OFFSET__); __HALT_COMPILER(); ?>
hi there 2"; hi there 2";
file_put_contents(dirname(__FILE__) . '/test2.php', $text); file_put_contents(__DIR__ . '/test2.php', $text);
include dirname(__FILE__) . '/test1.php'; include __DIR__ . '/test1.php';
include dirname(__FILE__) . '/test2.php'; include __DIR__ . '/test2.php';
?> ?>
==DONE== ==DONE==
--CLEAN-- --CLEAN--
<?php <?php
unlink(dirname(__FILE__) . '/test1.php'); unlink(__DIR__ . '/test1.php');
unlink(dirname(__FILE__) . '/test2.php'); unlink(__DIR__ . '/test2.php');
?> ?>
--EXPECT-- --EXPECT--
testint(73) testint(73)

View file

@ -122,7 +122,7 @@ function prepareLine($op1, $op2, $cmp, $operator) {
return $line; return $line;
} }
$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php'; $filename = __DIR__ . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
$file = fopen($filename, "w"); $file = fopen($filename, "w");
fwrite($file, "<?php\n"); fwrite($file, "<?php\n");
@ -148,7 +148,7 @@ if($c === 0) {
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php'; $fl = __DIR__ . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
@unlink($fl); @unlink($fl);
?> ?>
--EXPECT-- --EXPECT--

View file

@ -6,7 +6,7 @@ session.save_handler=files
--SKIPIF-- --SKIPIF--
<?php <?php
include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); include(__DIR__.'/../../ext/session/tests/skipif.inc');
?> ?>
--FILE-- --FILE--

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
unset() CV 6 (indirect unset() of global variable in session_unset()) unset() CV 6 (indirect unset() of global variable in session_unset())
--SKIPIF-- --SKIPIF--
<?php include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); ?> <?php include(__DIR__.'/../../ext/session/tests/skipif.inc'); ?>
--INI-- --INI--
session.auto_start=0 session.auto_start=0
session.save_handler=files session.save_handler=files

View file

@ -5,7 +5,7 @@ bzread() tests
--FILE-- --FILE--
<?php <?php
$fd = bzopen(dirname(__FILE__)."/003私はガラスを食べられます.txt.bz2","r"); $fd = bzopen(__DIR__."/003私はガラスを食べられます.txt.bz2","r");
var_dump(bzread($fd, 0)); var_dump(bzread($fd, 0));
var_dump(bzread($fd, -10)); var_dump(bzread($fd, -10));
var_dump(bzread($fd, 1)); var_dump(bzread($fd, 1));

View file

@ -5,7 +5,7 @@ bzread() tests
--FILE-- --FILE--
<?php <?php
$fd = bzopen(dirname(__FILE__)."/003.txt.bz2","r"); $fd = bzopen(__DIR__."/003.txt.bz2","r");
var_dump(bzread($fd, 0)); var_dump(bzread($fd, 0));
var_dump(bzread($fd, -10)); var_dump(bzread($fd, -10));
var_dump(bzread($fd, 1)); var_dump(bzread($fd, 1));

View file

@ -5,12 +5,12 @@ bzread() tests with invalid files
--FILE-- --FILE--
<?php <?php
$fd = bzopen(dirname(__FILE__)."/004_1.txt.bz2","r"); $fd = bzopen(__DIR__."/004_1.txt.bz2","r");
var_dump(bzerror($fd)); var_dump(bzerror($fd));
var_dump(bzerrstr($fd)); var_dump(bzerrstr($fd));
var_dump(bzerrno($fd)); var_dump(bzerrno($fd));
$fd2 = bzopen(dirname(__FILE__)."/004_2.txt.bz2","r"); $fd2 = bzopen(__DIR__."/004_2.txt.bz2","r");
var_dump(bzerror($fd2)); var_dump(bzerror($fd2));
var_dump(bzerrstr($fd2)); var_dump(bzerrstr($fd2));
var_dump(bzerrno($fd2)); var_dump(bzerrno($fd2));

View file

@ -21,6 +21,6 @@ $tests = <<<TESTS
\$blaat === \$blaat2 \$blaat === \$blaat2
TESTS; TESTS;
include(dirname(__FILE__) . '/../../../tests/quicktester.inc'); include(__DIR__ . '/../../../tests/quicktester.inc');
--EXPECT-- --EXPECT--
OK OK

View file

@ -8,7 +8,7 @@ if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present";
<?php <?php
$text= "Xin chào cộng đồng PHP"; $text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt"); $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.txt");
$fso = new COM("Scripting.FileSystemObject"); $fso = new COM("Scripting.FileSystemObject");
$fh = $fso->OpenTextFile($fpath, 2, true); $fh = $fso->OpenTextFile($fpath, 2, true);
@ -31,7 +31,7 @@ if (!$result) {
--CLEAN-- --CLEAN--
<?php <?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt"); $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.txt");
if (file_exists($fpath)) { if (file_exists($fpath)) {
unlink($fpath); unlink($fpath);

View file

@ -15,7 +15,7 @@ try {
<?php <?php
$text= "Xin chào cộng đồng PHP"; $text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx"); $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.docx");
com_load_typelib('Word.Application'); com_load_typelib('Word.Application');
@ -49,7 +49,7 @@ if (!$result) {
--CLEAN-- --CLEAN--
<?php <?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx"); $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.docx");
if (file_exists($fpath)) { if (file_exists($fpath)) {
unlink($fpath); unlink($fpath);

View file

@ -5,7 +5,7 @@ Bug #48203 (Crash when CURLOPT_STDERR is set to regular file)
--FILE-- --FILE--
<?php <?php
include 'server.inc'; include 'server.inc';
$fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w'); $fp = fopen(__DIR__ . '/bug48203.tmp', 'w');
$ch = curl_init(); $ch = curl_init();
@ -22,7 +22,7 @@ echo "Ok\n";
?> ?>
--CLEAN-- --CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?> <?php @unlink(__DIR__ . '/bug48203.tmp'); ?>
--EXPECTF-- --EXPECTF--
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
%A %A

View file

@ -8,7 +8,7 @@ include 'skipif.inc';
<?php <?php
include 'server.inc'; include 'server.inc';
function checkForClosedFilePointer($target_url, $curl_option, $description) { function checkForClosedFilePointer($target_url, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w'); $fp = fopen(__DIR__ . '/bug48203.tmp', 'w');
$ch1 = curl_init(); $ch1 = curl_init();
$ch2 = curl_init(); $ch2 = curl_init();
@ -65,7 +65,7 @@ foreach($options_to_check as $option) {
?> ?>
--CLEAN-- --CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?> <?php @unlink(__DIR__ . '/bug48203.tmp'); ?>
--EXPECTF-- --EXPECTF--
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d

View file

@ -11,7 +11,7 @@ if(substr(PHP_OS, 0, 3) == 'WIN' ) {
<?php <?php
function checkForClosedFilePointer($host, $curl_option, $description) { function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+'); $fp = fopen(__DIR__ . '/bug54798.tmp', 'w+');
$ch = curl_init(); $ch = curl_init();
@ -54,7 +54,7 @@ foreach($options_to_check as $option) {
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?> <?php @unlink(__DIR__ . '/bug54798.tmp'); ?>
--EXPECTF-- --EXPECTF--
%a %a
%aOk for CURLOPT_STDERR %aOk for CURLOPT_STDERR

View file

@ -8,7 +8,7 @@ include 'skipif.inc';
<?php <?php
function checkForClosedFilePointer($host, $curl_option, $description) { function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+'); $fp = fopen(__DIR__ . '/bug54798.tmp', 'w+');
$ch = curl_init(); $ch = curl_init();
@ -51,7 +51,7 @@ foreach($options_to_check as $option) {
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?> <?php @unlink(__DIR__ . '/bug54798.tmp'); ?>
--EXPECTF-- --EXPECTF--
%AOk for CURLOPT_STDERR %AOk for CURLOPT_STDERR

View file

@ -5,7 +5,7 @@ Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
?> ?>
--FILE-- --FILE--
<?php <?php
$base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948"; $base_dir = __DIR__ . DIRECTORY_SEPARATOR . "bug61948";
mkdir($base_dir . DIRECTORY_SEPARATOR . "foo", 0755, true); mkdir($base_dir . DIRECTORY_SEPARATOR . "foo", 0755, true);
ini_set("open_basedir", $base_dir); ini_set("open_basedir", $base_dir);
@ -18,7 +18,7 @@ Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
$base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948"; $base_dir = __DIR__ . DIRECTORY_SEPARATOR . "bug61948";
rmdir("$base_dir/foo"); rmdir("$base_dir/foo");
rmdir($base_dir); rmdir($base_dir);
?> ?>

View file

@ -7,7 +7,7 @@ if (!extension_loaded('curl')) print 'skip';
--FILE-- --FILE--
<?php <?php
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'file://'. dirname(__FILE__) . DIRECTORY_SEPARATOR .'curl_testdata1.txt'); curl_setopt($ch, CURLOPT_URL, 'file://'. __DIR__ . DIRECTORY_SEPARATOR .'curl_testdata1.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
$mh = curl_multi_init(); $mh = curl_multi_init();

View file

@ -18,7 +18,7 @@ Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEA
include 'server.inc'; include 'server.inc';
$host = curl_cli_server_start(); $host = curl_cli_server_start();
$temp_file = dirname(__FILE__) . '/body.tmp'; $temp_file = __DIR__ . '/body.tmp';
$url = "{$host}/get.inc?test=getpost"; $url = "{$host}/get.inc?test=getpost";
$ch = curl_init(); $ch = curl_init();
$f_file = fopen($temp_file, "w") or die("failed to open file\n"); $f_file = fopen($temp_file, "w") or die("failed to open file\n");
@ -32,7 +32,7 @@ Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEA
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
unlink(dirname(__FILE__) . '/body.tmp'); unlink(__DIR__ . '/body.tmp');
?> ?>
--EXPECTF-- --EXPECTF--
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d

View file

@ -11,7 +11,7 @@ include 'server.inc';
$host = curl_cli_server_start(); $host = curl_cli_server_start();
$ch = curl_init($host); $ch = curl_init($host);
$temp_file = dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp'; $temp_file = __DIR__ . '/curl_file_deleted_before_curl_close.tmp';
if (file_exists($temp_file)) { if (file_exists($temp_file)) {
unlink($temp_file); // file should not exist before test unlink($temp_file); // file should not exist before test
} }
@ -33,7 +33,7 @@ echo "Closed correctly\n";
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
unlink(dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp'); unlink(__DIR__ . '/curl_file_deleted_before_curl_close.tmp');
?> ?>
--EXPECT-- --EXPECT--
Closed correctly Closed correctly

View file

@ -17,7 +17,7 @@ Rein Velt (rein@velt.org)
include 'server.inc'; include 'server.inc';
$host = curl_cli_server_start(); $host = curl_cli_server_start();
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.inc?test=getpost&get_param=Hello%20World"); curl_setopt($ch1, CURLOPT_URL, "{$host}/get.inc?test=getpost&get_param=Hello%20World");
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt"); curl_setopt($ch2, CURLOPT_URL, "file://".__DIR__. DIRECTORY_SEPARATOR . "curl_testdata2.txt");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);

View file

@ -19,7 +19,7 @@ function custom_readfunction($oCurl, $hReadHandle, $iMaxOut)
return $sData; return $sData;
} }
$sFileBase = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION'; $sFileBase = __DIR__.DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sReadFile = $sFileBase.'_in.tmp'; $sReadFile = $sFileBase.'_in.tmp';
$sWriteFile = $sFileBase.'_out.tmp'; $sWriteFile = $sFileBase.'_out.tmp';
$sWriteUrl = 'file://'.$sWriteFile; $sWriteUrl = 'file://'.$sWriteFile;
@ -43,7 +43,7 @@ var_dump($sOutput);
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
$sFileBase = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION'; $sFileBase = __DIR__.DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sReadFile = $sFileBase.'_in.tmp'; $sReadFile = $sFileBase.'_in.tmp';
$sWriteFile = $sFileBase.'_out.tmp'; $sWriteFile = $sFileBase.'_out.tmp';
unlink($sReadFile); unlink($sReadFile);

View file

@ -3,13 +3,13 @@ Bug #36436 (DBA problem with Berkeley DB4)
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
$db = dba_popen($db_filename, 'c', 'db4'); $db = dba_popen($db_filename, 'c', 'db4');
@ -27,7 +27,7 @@ dba_close($db);
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
resource(%d) of type (dba persistent) resource(%d) of type (dba persistent)

View file

@ -3,7 +3,7 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'cdb_make'; $handler = 'cdb_make';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
@ -12,7 +12,7 @@ function isLittleEndian() {
return 0x00FF === current(unpack('v', pack('S',0x00FF))); return 0x00FF === current(unpack('v', pack('S',0x00FF)));
} }
$db_file = dirname(__FILE__) .'/129php.cdb'; $db_file = __DIR__ .'/129php.cdb';
if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) { if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) {
if (isLittleEndian() === FALSE) { if (isLittleEndian() === FALSE) {

View file

@ -3,13 +3,13 @@ Bug #48240 (DBA Segmentation fault dba_nextkey)
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
$db = dba_open($db_filename, 'c', 'db4'); $db = dba_open($db_filename, 'c', 'db4');
@ -21,7 +21,7 @@ dba_close($db);
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
bool(false) bool(false)

View file

@ -3,7 +3,7 @@ Bug #49125 (Error in dba_exists C code)
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
@ -11,7 +11,7 @@ Bug #49125 (Error in dba_exists C code)
error_reporting(E_ALL); error_reporting(E_ALL);
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
$db = dba_popen($db_filename, 'c', 'db4'); $db = dba_popen($db_filename, 'c', 'db4');
@ -24,7 +24,7 @@ dba_close($db);
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
bool(true) bool(true)

View file

@ -2,14 +2,14 @@
Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write) Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write)
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
error_reporting(E_ALL); error_reporting(E_ALL);
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
$db = dba_popen($db_filename, 'c'); $db = dba_popen($db_filename, 'c');
@ -29,7 +29,7 @@ dba_close($db);
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
integer integer

View file

@ -2,7 +2,7 @@
Bug #72157 (use-after-free caused by dba_open) Bug #72157 (use-after-free caused by dba_open)
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -3,12 +3,12 @@ Bug #72885 flatfile: dba_fetch() fails to read replaced entry
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "flatfile"; $handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
$db = dba_open($db_filename, 'c', 'flatfile'); $db = dba_open($db_filename, 'c', 'flatfile');
dba_insert('foo', 'bar', $db); dba_insert('foo', 'bar', $db);
@ -20,7 +20,7 @@ dba_close($db);
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require_once(dirname(__FILE__) .'/clean.inc'); require_once(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
bool(true) bool(true)

View file

@ -2,12 +2,12 @@
DBA File Creation Test DBA File Creation Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created\n"; echo "database file created\n";
@ -18,7 +18,7 @@ DBA File Creation Test
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA Insert/Fetch Test DBA Insert/Fetch Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "This is a test insert", $db_file); dba_insert("key1", "This is a test insert", $db_file);
@ -19,7 +19,7 @@ DBA Insert/Fetch Test
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA Insert/Replace/Fetch Test DBA Insert/Replace/Fetch Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "This is a test insert", $db_file); dba_insert("key1", "This is a test insert", $db_file);
@ -21,7 +21,7 @@ DBA Insert/Replace/Fetch Test
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA Multiple Insert/Fetch Test DBA Multiple Insert/Fetch Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file); dba_insert("key1", "Content String 1", $db_file);
@ -25,7 +25,7 @@ DBA Multiple Insert/Fetch Test
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA FirstKey/NextKey Loop Test With 5 Items DBA FirstKey/NextKey Loop Test With 5 Items
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file); dba_insert("key1", "Content String 1", $db_file);
@ -32,7 +32,7 @@ DBA FirstKey/NextKey Loop Test With 5 Items
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA FirstKey/NextKey with 2 deletes DBA FirstKey/NextKey with 2 deletes
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file); dba_insert("key1", "Content String 1", $db_file);
@ -34,7 +34,7 @@ DBA FirstKey/NextKey with 2 deletes
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,16 +2,16 @@
DBA Multiple File Creation Test DBA Multiple File Creation Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
if (!function_exists('dba_list')) die('skip dba_list() not available'); if (!function_exists('dba_list')) die('skip dba_list() not available');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
$db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm'; $db_file1 = $db_filename1 = __DIR__.'/test1.dbm';
$db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm'; $db_file2 = $db_filename2 = __DIR__.'/test2.dbm';
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created\n"; echo "database file created\n";
} else { } else {
@ -35,7 +35,7 @@ DBA Multiple File Creation Test
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA dba_popen Test DBA dba_popen Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
print("info $HND handler used"); print("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db=dba_popen($db_file, "n", $handler))!==FALSE) { if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
echo "Opened\n"; echo "Opened\n";
@ -26,7 +26,7 @@ DBA dba_popen Test
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA with array keys DBA with array keys
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert(array("", "name0") , "Content String 1", $db_file); dba_insert(array("", "name0") , "Content String 1", $db_file);
@ -37,7 +37,7 @@ if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA argument tests DBA argument tests
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
var_dump(dba_open($db_file, 'n')); var_dump(dba_open($db_file, 'n'));
var_dump(dba_open($db_file, 'n', 'bogus')); var_dump(dba_open($db_file, 'n', 'bogus'));
@ -17,7 +17,7 @@ var_dump(dba_open($db_file, 'n', $handler, 2, 3, 4, 5, 6, 7, 8));
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: flatfile database handler: flatfile

View file

@ -3,14 +3,14 @@ DBA dba.default_handler tests
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "flatfile"; $handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--INI-- --INI--
dba.default_handler=flatfile dba.default_handler=flatfile
--FILE-- --FILE--
<?php <?php
$handler = "flatfile"; $handler = "flatfile";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
echo "Test 1\n"; echo "Test 1\n";
@ -28,7 +28,7 @@ var_dump(dba_open($db_filename, 'n'));
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: flatfile database handler: flatfile

View file

@ -2,12 +2,12 @@
DBA with array key with empty array DBA with array key with empty array
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
@ -19,7 +19,7 @@ if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -2,12 +2,12 @@
DBA with array key with array containing too many elements DBA with array key with array containing too many elements
--SKIPIF-- --SKIPIF--
<?php <?php
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
@ -19,7 +19,7 @@ if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: %s database handler: %s

View file

@ -3,14 +3,14 @@ DBA with persistent connections
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "flatfile"; $handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "flatfile"; $handler = "flatfile";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
echo "Test 1\n"; echo "Test 1\n";
@ -51,7 +51,7 @@ echo dba_fetch("key2", $db_file1), "\n";
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: flatfile database handler: flatfile

View file

@ -3,13 +3,13 @@ DBA lock modifier error message test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "flatfile"; $handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "flatfile"; $handler = "flatfile";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
$db_file1 = dba_popen($db_filename, 'n-t', 'flatfile'); $db_file1 = dba_popen($db_filename, 'n-t', 'flatfile');
@ -18,7 +18,7 @@ $db_file1 = dba_popen($db_filename, 'n-t', 'flatfile');
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: flatfile database handler: flatfile

View file

@ -3,19 +3,19 @@ DBA CDB handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'cdb'; $handler = 'cdb';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die('info CDB does not support replace or delete'); die('info CDB does not support replace or delete');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'cdb'; $handler = 'cdb';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
require_once(dirname(__FILE__) .'/dba_handler.inc'); require_once(__DIR__ .'/dba_handler.inc');
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: cdb database handler: cdb

View file

@ -3,14 +3,14 @@ DBA CDB handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'cdb'; $handler = 'cdb';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die('info CDB does not support replace or delete'); die('info CDB does not support replace or delete');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'cdb'; $handler = 'cdb';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "Test 0\n"; echo "Test 0\n";
@ -64,7 +64,7 @@ else {
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
Test 0 Test 0

View file

@ -3,16 +3,16 @@ DBA CDB_MAKE handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'cdb_make'; $handler = 'cdb_make';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die('info CDB_MAKE does not support reading'); die('info CDB_MAKE does not support reading');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'cdb_make'; $handler = 'cdb_make';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
// print md5 checksum of test.cdb which is generated by cdb_make program // print md5 checksum of test.cdb which is generated by cdb_make program
var_dump(md5_file(dirname(__FILE__).'/test.cdb')); var_dump(md5_file(__DIR__.'/test.cdb'));
if (($db_make=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_make=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("1", "1", $db_make); dba_insert("1", "1", $db_make);
dba_insert("2", "2", $db_make); dba_insert("2", "2", $db_make);
@ -32,7 +32,7 @@ DBA CDB_MAKE handler test
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: cdb_make database handler: cdb_make

View file

@ -3,13 +3,13 @@ DBA CDB handler test (read only)
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'cdb_make'; $handler = 'cdb_make';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
echo "database handler: cdb\n"; echo "database handler: cdb\n";
$handler = 'cdb'; $handler = 'cdb';
$db_file = dirname(__FILE__).'/test.cdb'; $db_file = __DIR__.'/test.cdb';
if (($db_file=dba_open($db_file, "r", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "r", $handler))!==FALSE) {
// read key sequence // read key sequence
$a = dba_firstkey($db_file); $a = dba_firstkey($db_file);

View file

@ -3,13 +3,13 @@ DBA DB1 handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'db1'; $handler = 'db1';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'db1'; $handler = 'db1';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--EXPECT-- --EXPECT--

View file

@ -3,13 +3,13 @@ DBA DB2 handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'db2'; $handler = 'db2';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'db2'; $handler = 'db2';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--EXPECT-- --EXPECT--

View file

@ -3,13 +3,13 @@ DBA DB3 handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'db3'; $handler = 'db3';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'db3'; $handler = 'db3';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--EXPECT-- --EXPECT--

View file

@ -3,18 +3,18 @@ DBA DB4 handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'db4'; $handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
require_once(dirname(__FILE__) .'/dba_handler.inc'); require_once(__DIR__ .'/dba_handler.inc');
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation open("c") & Insert Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) { if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
echo "database file created\n"; echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation open("n") & Insert Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) { if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
echo "database file created\n"; echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File Creation open("c") with existing file
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents")); var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -33,7 +33,7 @@ echo "$s\n";
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 Truncate Existing File open("n")
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents")); var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -31,7 +31,7 @@ if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation popen("c") & Insert Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) { if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
echo "database file created\n"; echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation popen("n") & Insert Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) { if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
echo "database file created\n"; echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File Creation popen("c") with existing invalid file
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents")); var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -29,7 +29,7 @@ if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 Truncate Existing File popen("n")
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents")); var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -31,7 +31,7 @@ if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,16 +3,16 @@ DBA DB4 Multiple File Creation Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
$db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm'; $db_file1 = $db_filename1 = __DIR__.'/test1.dbm';
$db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm'; $db_file2 = $db_filename2 = __DIR__.'/test2.dbm';
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created\n"; echo "database file created\n";
} else { } else {
@ -36,7 +36,7 @@ dba_close($db_file);
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: db4 database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 with repeated key
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) { if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
var_dump(dba_insert("key1", "Content String 1", $db_file)); var_dump(dba_insert("key1", "Content String 1", $db_file));
@ -25,7 +25,7 @@ if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation open("rl")
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "rl", $handler)) !== FALSE) { if (($db_file = dba_open($db_filename, "rl", $handler)) !== FALSE) {
echo "database file created\n"; echo "database file created\n";
@ -22,7 +22,7 @@ if (($db_file = dba_open($db_filename, "rl", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File open("rl") & Insert Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) { if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
@ -30,7 +30,7 @@ if (($db_file = dba_popen($db_filename, "rl", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File open("wl") & Insert Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "wl", $handler)) !== FALSE) { if (($db_file = dba_open($db_filename, "wl", $handler)) !== FALSE) {
@ -23,7 +23,7 @@ if (($db_file = dba_open($db_filename, "wl", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File open("wl") & Insert Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) { if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
@ -30,7 +30,7 @@ if (($db_file = dba_popen($db_filename, "wl", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File Creation popen("c") with existing valid file
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) { if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
@ -45,7 +45,7 @@ if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 file creation dba_open("cd")
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "cd", $handler)) !== FALSE) { if (($db_file = dba_open($db_filename, "cd", $handler)) !== FALSE) {
@ -28,7 +28,7 @@ if (($db_file = dba_open($db_filename, "cd", $handler)) !== FALSE) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 with persistent connections
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
echo "Test 1\n"; echo "Test 1\n";
@ -51,7 +51,7 @@ echo dba_fetch("key2", $db_file1), "\n";
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--XFAIL-- --XFAIL--
Test 6 crashes with dba pointer of NULL, bug http://bugs.php.net/bug.php?id=51278 Test 6 crashes with dba pointer of NULL, bug http://bugs.php.net/bug.php?id=51278

View file

@ -3,13 +3,13 @@ DBA DB4 Handler Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler="db4"; $handler="db4";
require(dirname(__FILE__) .'/skipif.inc'); require(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler="db4"; $handler="db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
function check($h) function check($h)
@ -40,7 +40,7 @@ foreach ($h as $key => $val) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTREGEX-- --EXPECTREGEX--
database handler: db4 database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 Optimize Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file); dba_insert("key1", "Content String 1", $db_file);
@ -29,7 +29,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?> <?php exit(0); ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 Sync Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = "db4"; $handler = "db4";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file); dba_insert("key1", "Content String 1", $db_file);
@ -29,7 +29,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?> <?php exit(0); ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: db4 database handler: db4

View file

@ -3,18 +3,18 @@ DBA DBM handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'dbm'; $handler = 'dbm';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'dbm'; $handler = 'dbm';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: dbm database handler: dbm

View file

@ -3,18 +3,18 @@ DBA FlatFile handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'flatfile'; $handler = 'flatfile';
require_once(dirname(__FILE__) .'/skipif.inc'); require_once(__DIR__ .'/skipif.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'flatfile'; $handler = 'flatfile';
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
require_once(dirname(__FILE__) .'/dba_handler.inc'); require_once(__DIR__ .'/dba_handler.inc');
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: flatfile database handler: flatfile

View file

@ -3,14 +3,14 @@ DBA GDBM handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'gdbm'; $handler = 'gdbm';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'gdbm'; $handler = 'gdbm';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
$lock_flag = ''; // lock in library $lock_flag = ''; // lock in library
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
// Read during write is system dependent. Important is that there is no deadlock // Read during write is system dependent. Important is that there is no deadlock
?> ?>

View file

@ -3,13 +3,13 @@ DBA Handler Test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler="flatfile"; $handler="flatfile";
require(dirname(__FILE__) .'/skipif.inc'); require(__DIR__ .'/skipif.inc');
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
$handler="flatfile"; $handler="flatfile";
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
function check($h) function check($h)
@ -48,7 +48,7 @@ foreach ($h as $key => $val) {
?> ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: flatfile database handler: flatfile

View file

@ -3,18 +3,18 @@ DBA INIFILE handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'inifile'; $handler = 'inifile';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'inifile'; $handler = 'inifile';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECT-- --EXPECT--
database handler: inifile database handler: inifile

View file

@ -3,19 +3,19 @@ DBA LMDB handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'lmdb'; $handler = 'lmdb';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'lmdb'; $handler = 'lmdb';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
$lock_flag = ''; // lock in library $lock_flag = ''; // lock in library
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require_once dirname(__FILE__) .'/clean.inc'; require_once __DIR__ .'/clean.inc';
?> ?>
--EXPECTF-- --EXPECTF--
database handler: lmdb database handler: lmdb

View file

@ -3,13 +3,13 @@ DBA NDBM handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'ndbm'; $handler = 'ndbm';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'ndbm'; $handler = 'ndbm';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--EXPECT-- --EXPECT--

View file

@ -2,12 +2,12 @@
DBA Optimize Test DBA Optimize Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file); dba_insert("key1", "Content String 1", $db_file);
@ -34,7 +34,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?> <?php exit(0); ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: flatfile database handler: flatfile

View file

@ -3,19 +3,19 @@ DBA QDBM handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'qdbm'; $handler = 'qdbm';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$handler = 'qdbm'; $handler = 'qdbm';
require_once dirname(__FILE__) .'/test.inc'; require_once __DIR__ .'/test.inc';
$lock_flag = ''; // lock in library $lock_flag = ''; // lock in library
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: qdbm database handler: qdbm

View file

@ -2,7 +2,7 @@
DBA Split Test DBA Split Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--

View file

@ -2,12 +2,12 @@
DBA Sync Test DBA Sync Test
--SKIPIF-- --SKIPIF--
<?php <?php
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
die("info $HND handler used"); die("info $HND handler used");
?> ?>
--FILE-- --FILE--
<?php <?php
require_once(dirname(__FILE__) .'/test.inc'); require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n"; echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file); dba_insert("key1", "Content String 1", $db_file);
@ -34,7 +34,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?> <?php exit(0); ?>
--CLEAN-- --CLEAN--
<?php <?php
require(dirname(__FILE__) .'/clean.inc'); require(__DIR__ .'/clean.inc');
?> ?>
--EXPECTF-- --EXPECTF--
database handler: flatfile database handler: flatfile

View file

@ -3,20 +3,20 @@ DBA TCADB handler test
--SKIPIF-- --SKIPIF--
<?php <?php
$handler = 'tcadb'; $handler = 'tcadb';
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php
$lock_flag = 'l'; $lock_flag = 'l';
$db_filename = $db_file = dirname(__FILE__) .'/test0.tch'; $db_filename = $db_file = __DIR__ .'/test0.tch';
@unlink($db_filename); @unlink($db_filename);
@unlink($db_filename.'.lck'); @unlink($db_filename.'.lck');
require_once dirname(__FILE__) .'/dba_handler.inc'; require_once __DIR__ .'/dba_handler.inc';
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
<?php <?php
$db_filename = $db_file = dirname(__FILE__) .'/test0.tch'; $db_filename = $db_file = __DIR__ .'/test0.tch';
@unlink($db_filename); @unlink($db_filename);
@unlink($db_filename.'.lck'); @unlink($db_filename.'.lck');
?> ?>

View file

@ -5,7 +5,7 @@ Knut Urdalen <knut@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/ #PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF-- --SKIPIF--
<?php <?php
require_once dirname(__FILE__) .'/skipif.inc'; require_once __DIR__ .'/skipif.inc';
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -9,7 +9,7 @@ Lev Radin <prokurator@gmail.com>
<?php <?php
$doc = new DOMDocument; $doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book.xml"); $doc->load(__DIR__."/book.xml");
var_dump($doc->implementation); var_dump($doc->implementation);

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE-- --FILE--
<?php <?php
$doc = new DOMDocument(); $doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/test.html"); $result = $doc->loadHTMLFile(__DIR__ . "/test.html");
assert($result === true); assert($result === true);
?> ?>
--EXPECT-- --EXPECT--

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE-- --FILE--
<?php <?php
$doc = new DOMDocument(); $doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/ffff/test.html"); $result = $doc->loadHTMLFile(__DIR__ . "/ffff/test.html");
assert($result === false); assert($result === false);
?> ?>
--EXPECTF-- --EXPECTF--

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE-- --FILE--
<?php <?php
$doc = new DOMDocument(); $doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/empty.html"); $result = $doc->loadHTMLFile(__DIR__ . "/empty.html");
assert($result === true); assert($result === true);
?> ?>
--EXPECTF-- --EXPECTF--

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE-- --FILE--
<?php <?php
$doc = new DOMDocument(); $doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/not_well.html"); $result = $doc->loadHTMLFile(__DIR__ . "/not_well.html");
assert($result === true); assert($result === true);
?> ?>
--EXPECT-- --EXPECT--

View file

@ -9,7 +9,7 @@ Lev Radin <prokurator@gmail.com>
<?php <?php
$doc = new DOMDocument; $doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book.xml"); $doc->load(__DIR__."/book.xml");
var_dump($doc->preserveWhiteSpace); var_dump($doc->preserveWhiteSpace);

View file

@ -10,14 +10,14 @@ Lev Radin <prokurator@gmail.com>
echo "Load document with preserveWhiteSpace on\n"; echo "Load document with preserveWhiteSpace on\n";
$doc = new DOMDocument; $doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book.xml"); $doc->load(__DIR__."/book.xml");
echo $doc->saveXML(); echo $doc->saveXML();
echo "\nLoad document with preserveWhiteSpace off\n"; echo "\nLoad document with preserveWhiteSpace off\n";
$doc = new DOMDocument; $doc = new DOMDocument;
$doc->preserveWhiteSpace = false; $doc->preserveWhiteSpace = false;
$doc->load(dirname(__FILE__)."/book.xml"); $doc->load(__DIR__."/book.xml");
echo $doc->saveXML(); echo $doc->saveXML();
?> ?>

Some files were not shown because too many files have changed in this diff Show more