Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59109 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72085 invoked from network); 21 Mar 2012 06:46:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Mar 2012 06:46:38 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.199.177.89 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.199.177.89 il-mr1.zend.com Received: from [212.199.177.89] ([212.199.177.89:58107] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/70-03976-D49796F4 for ; Wed, 21 Mar 2012 01:46:38 -0500 Received: from il-gw1.zend.com (unknown [10.1.1.22]) by il-mr1.zend.com (Postfix) with ESMTP id E5E5660783; Wed, 21 Mar 2012 08:44:52 +0200 (IST) Received: from ws.home (10.1.10.34) by il-ex2.zend.net (10.1.1.22) with Microsoft SMTP Server (TLS) id 14.1.255.0; Wed, 21 Mar 2012 08:46:33 +0200 Message-ID: <4F697947.5060307@zend.com> Date: Wed, 21 Mar 2012 10:46:31 +0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Eric Stenson CC: "internals@lists.php.net" References: <3ADF645454450443973DDB04FC00A0E525885F35@TK5EX14MBXC296.redmond.corp.microsoft.com> In-Reply-To: <3ADF645454450443973DDB04FC00A0E525885F35@TK5EX14MBXC296.redmond.corp.microsoft.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.1.10.34] Subject: Re: [PHP-DEV] Q: ZEND_HANDLE_STREAM and wincache extension on PHP 5.4 From: dmitry@zend.com (Dmitry Stogov) Hi Eric, Sorry, I don't read @internals every day. Please CC me if you need quick answer. Really I don't see the reason why wincache stores the PHP file source. Storing compiled opcodes must be enough. To avoid re-reading of already cached file. opcode cache should override zend_stream_open() and return stream of type ZEND_HANDLE_FILENAME. Anyway, I don't see a way to fix PHP to support custom streams without BC break, because zend_streams doesn't provide handlers for seeking. The best solution would be handling shebang lines by parser/scanner. It even was done few years ago, but than was reverted. Thanks. Dmitry. On 03/15/2012 10:56 PM, Eric Stenson wrote: > PHP Internals folks-- > > My name is Eric Stenson, and I'm a developer at Microsoft working on IIS. > I've been given the task of upgrading our php_wincache extension to work > on PHP5.4, and I've run into a problem. > > The problem I'm running into is the php_cgi!main() on PHP5.4 has changed > behavior. The php_cgi!main() function is seeing us return a ZEND_HANDLE_STREAM, > and it's assuming that the zend_file_handle.handle.stream.handle (void *) > is a (php_stream*), when in fact it's php_wincache's (fcache_handle *). > It then attempts to access the php_stream.ops (a v-table-ish struct), which > is not in the fcache_handle, and it jumps off into an invalid address and > promptly AV's. > > I'm trying to understand why our php_wincache!fcache_useval() thinks it's > okay to set zend_file_handle.handle.stream.handle to (fcache_handle *). > I'm having trouble understanding what the responsibilities are of a PHP > extension that extends the file system as php_wincache does. Could you > point me at any developer documents for PHP extension developers that explains > what php_wincache *should* be doing? > > I'm very much a novice at PHP code, or writing a PHP extension, so I feel > like I'm flailing around without understanding what PHP extensions are > supposed to do. Any pointers, guidance, and architecture advice would be > massively helpful! > > Thank you! > --E. > >