|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-07 00:28 UTC] yohgaki@php.net
[2002-06-07 12:03 UTC] mogul-php at gelatinous dot com
[2002-06-07 12:13 UTC] derick@php.net
[2002-06-07 12:55 UTC] mogul-php at gelatinous dot com
[2002-06-20 14:42 UTC] sander@php.net
[2002-06-20 20:08 UTC] mogul-php at gelatinous dot com
[2002-06-28 17:05 UTC] mogul-php at gelatinous dot com
[2002-10-08 12:07 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
I wrote a custom output handler and registered it with ob_start(). The handler gets called if I call ob_end_flush() or when the script ends, as expected. If the handler tries to open a file that's in the same directory as the script, I get different behavior depending on whether ob_end_flush() was called or the script just ended. Here's code demonstrating the bug (replace 'fileinthisdir' with an actual file's name): <?php $explicit_ob_flush=false; function my_output_handler($string) { return (fopen('fileinthisdir', 'r') ? "Opened file!" : "Couldn't open file!"); } ob_start("my_output_handler"); ?> Hi, this is some text. <? if($explicit_ob_flush) { ob_end_flush(); } ?> This script won't find the file as is. Change $explicit_ob_flush to true, though, and it will. (Note that supplying a full pathname to the file works... This is a problem with relative paths, not absolute paths.) [I'm running RH 7.3 with all updates applied. My php is version 4.2.1 from the RH RawHide RPMs, recompiled to add --enable-xslt and --with-xslt-sablot but otherwise unmodified. The sablotron version is 0.90.]