Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15324 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13379 invoked by uid 1010); 9 Mar 2005 15:31:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13334 invoked from network); 9 Mar 2005 15:31:19 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 9 Mar 2005 15:31:19 -0000 X-Host-Fingerprint: 64.233.184.196 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.196:57715] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity HEAD r(5124)) with SMTP id 5D/E7-53294-4C61F224 for ; Wed, 09 Mar 2005 10:31:19 -0500 Received: by wproxy.gmail.com with SMTP id 37so207361wra for ; Wed, 09 Mar 2005 07:31:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=en2Dw+uCNaLDUqFgRoNZ/k7MGgIDAoKvzNWq6Fcv/mZOIY1eYnIwK3HOf6mSt2nFcR2k+eb56/vFsP3AC6UX7sn7q2VqyQsxaRwgW5UtUy5sHBgOsdZ+zfLiXXZGk6ABfrKNoDNXCQ8zbe3qE8x2re6nIG+2UrQuoQAVxbOneWI= Received: by 10.54.34.52 with SMTP id h52mr852344wrh; Wed, 09 Mar 2005 07:31:02 -0800 (PST) Received: by 10.54.44.57 with HTTP; Wed, 9 Mar 2005 07:31:00 -0800 (PST) Message-ID: <4e89b42605030907315a85ce74@mail.gmail.com> Date: Wed, 9 Mar 2005 10:31:00 -0500 Reply-To: Wez Furlong To: Stanislav Malyshev Cc: PHP Development In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <4e89b4260503090718503f9a5@mail.gmail.com> Subject: Re: [PHP-DEV] zend_stream_fixup From: kingwez@gmail.com (Wez Furlong) 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 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 >