mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
36b5ab15f4
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===
|