mirror of
https://github.com/php/php-src.git
synced 2026-03-28 18:22:42 +01:00
With append mode it is only possible to write to the end of the file. It is not suitable for drivers like flatfile. Thus, if the file is created, the stream is closed and is reopened with r+b, otherwise r+ mode is used right away.
29 lines
525 B
PHP
29 lines
525 B
PHP
--TEST--
|
|
Bug #72885 flatfile: dba_fetch() fails to read replaced entry
|
|
--SKIPIF--
|
|
<?php
|
|
$handler = "flatfile";
|
|
require_once(dirname(__FILE__) .'/skipif.inc');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once(dirname(__FILE__) .'/test.inc');
|
|
|
|
$db = dba_open($db_filename, 'c', 'flatfile');
|
|
dba_insert('foo', 'bar', $db);
|
|
var_dump(dba_replace('foo', 'baz', $db));
|
|
var_dump(dba_fetch('foo', $db));
|
|
dba_close($db);
|
|
|
|
?>
|
|
===DONE===
|
|
--CLEAN--
|
|
<?php
|
|
require_once(dirname(__FILE__) .'/clean.inc');
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
string(3) "baz"
|
|
===DONE===
|