Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78495 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26393 invoked from network); 30 Oct 2014 22:15:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Oct 2014 22:15:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.27 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.27 out3-smtp.messagingengine.com Received: from [66.111.4.27] ([66.111.4.27:57136] helo=out3-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/91-17925-E78B2545 for ; Thu, 30 Oct 2014 17:15:27 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4287720B29 for ; Thu, 30 Oct 2014 18:15:24 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 30 Oct 2014 18:15:24 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=bBM5uXdOA044+1hrTdcdbd 5lr+E=; b=TIQ9LJmIyHn7hPrRRTBQLucguo27ZMTsDRWb5qIYBhi5VDoxILL9dl 4XLZrtHD19efusySw21OsNI7M4dDqtGd9LpWO1Au0WLgmPi54elqO8lli+1FoyT/ +EI8hLVsNdc4C10XvdIiaoXn7+O6AeL2Hg+UmMGPGch6fDh2GOcaA= X-Sasl-enc: GHtO2eEHrs+oeLZcN3s5LFVrnNBLAgfGPcTajEhcqEIm 1414707324 Received: from Palantirs-MacBook-Pro-5.local (unknown [63.250.249.138]) by mail.messagingengine.com (Postfix) with ESMTPA id 0C1CB680099 for ; Thu, 30 Oct 2014 18:15:24 -0400 (EDT) Message-ID: <5452B87B.5040009@garfieldtech.com> Date: Thu, 30 Oct 2014 17:15:23 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: larry@garfieldtech.com (Larry Garfield) On 10/30/14, 1:23 PM, Sherif Ramadan wrote: > Hello Internals, > > I've been meaning to write up a full-blown RFC for introducing a new > standardized HTTP interface for PHP core for some time now. I figure now > with PHP 7 on the road map this might be a good time to start this > discussion since it involves breaking some backwards compatibility that may > have been out of the question in PHP 5. *snip* > I'm in the process of writing up a cleaner implementation to introduce in > the RFC, but in the mean time I'd like to open up to discussion and see > what others think or how they feel we might approach this problem more > cleanly. > > Thanks, > Sherif As you note, there's an enormous amount of existing and active discussion around PSR-7 on the FIG mailing list, and I would urge anyone pursuing such an effort for core to read through that discussion in detail. There are a lot of tricky bits that we have been hashing through that you don't want to hash through again, especially around supported use cases. In practice, honestly, I think userspace can experiment and innovate here better than internals can, at least for a while. The main place where core could help would be streams. One of the things we're still struggling with is supporting message bodies (request or response) that can be strings OR a stream, such as a file off disk that we don't want in memory all at once, OR a callable that generates output on the fly (say, reading records out of a DB and generating a CSV file). Part of the problem is that the native streams API, while powerful, is horribly annoying to work with. Michael Dowling has documented many of the issues with it from a request/response perspective here: http://mtdowling.com/blog/2014/07/03/a-case-for-higher-level-php-streams/ Honestly, I think one of the best things internals could do to help really robust request/response support for PHP 7 isn't writing a new interface, but improving the streams API in order to simplify the many use cases we've identified (and render the whole "detach" stuff we're looking at now unnecessary). --Larry Garfield