Re: zend_stream_fixup

From: Date: Wed, 09 Mar 2005 15:31:00 +0000
Subject: Re: zend_stream_fixup
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-15324@lists.php.net to get a copy of this message
What are you trying to do exactly? The engine only needs to read from such a file handle and feed that data into its lexer and parser. --Wez. On Wed, 9 Mar 2005 17:22:58 +0200 (IST), Stanislav Malyshev <stas@zend.com> wrote: > WF>>The idea is that the zend engine should only call the functions in > WF>>zend_stream.c to access the script input. The fixup function is > > But file_handle is not used only for input. There are a lof of other > things that can be done with handle. Getting stat, for example, or > seeking. It's possible to do it with FILE * and with php_stream, but not > with the result of the fixup function. Actually, after fixup function it > is impossible to do anything but read and close with the handle. I think > it's very wrong. > > WF>>designed to promote FILE* or file descriptors up to something > WF>>compatible with its stdio stream reading functions. Filenames are > WF>>handed out to PHP and opened up using the streams layer. > WF>> > WF>>The rule for the fixup function is that it either errors out, or sets > WF>>up the zend_file_handle so that zend_stream_XXX functions will work. > > But this means if you get a file handle which is ZEND_HANDLE_STREAM, you > cannot use it as a stream - it might be result of stream open, in which > case handle is php_stream *, or result of fixup, in which case is't FILE > *. Don't you think it's wrong? > > -- > Stanislav Malyshev, Zend Products Engineer > stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115 >

« previous php.internals (#15324) next »