Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78538 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47021 invoked from network); 31 Oct 2014 21:01:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Oct 2014 21:01:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=willfitch@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=willfitch@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 66.111.4.27 as permitted sender) X-PHP-List-Original-Sender: willfitch@php.net X-Host-Fingerprint: 66.111.4.27 out3-smtp.messagingengine.com Received: from [66.111.4.27] ([66.111.4.27:39022] helo=out3-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/0D-15608-E98F3545 for ; Fri, 31 Oct 2014 16:01:18 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A71872064F for ; Fri, 31 Oct 2014 17:01:15 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Fri, 31 Oct 2014 17:01:15 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:content-type:mime-version :subject:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to; s=smtpout; bh=i6kBTuTQdIWxMUi7G6Unver c92E=; b=hB4AGVZwoCA47/Npn9S5Vk9i9vLekZOZVTyKdOWYnGEC7Wazs/zeVWJ NRjN+djQcNt/JQfNKajl3lWBrViGeZpx7JWBnZC04les74VWzNu3uu9uasq61Dkl Z30NTaqKrCPHlhSJyMQgu/P+Om/vLv0iEM7uiZwPEgGw5/IAeFrA= X-Sasl-enc: rKAT/tQLJNvt6dLJGoy8IrhVmW6G/Na/1Q678MLAfDc8 1414789275 Received: from wills-mbp.home (unknown [173.59.114.93]) by mail.messagingengine.com (Postfix) with ESMTPA id 5D762C0000E; Fri, 31 Oct 2014 17:01:15 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: Date: Fri, 31 Oct 2014 17:01:15 -0400 Cc: Rowan Collins , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <41EF28AA-2303-4900-A085-21AF58740351@php.net> References: <5452B87B.5040009@garfieldtech.com> <0B797CE3-7AFA-4330-9A98-D3CAFC6D6072@ajf.me> <5453B114.6050400@gmail.com> <5453C250.8090803@gmail.com> <5453D6D5.2070705@garfieldtech.com> <5453E492.6020304@gmail.com> To: Sherif Ramadan X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: willfitch@php.net (Will Fitch) > On Oct 31, 2014, at 4:51 PM, Sherif Ramadan = wrote: >=20 > On Fri, Oct 31, 2014 at 4:29 PM, Will Fitch wrote: >=20 >>=20 >> On Oct 31, 2014, at 4:21 PM, Sherif Ramadan >> wrote: >>=20 >>=20 >>=20 >> On Fri, Oct 31, 2014 at 4:16 PM, Will Fitch = wrote: >>=20 >>>=20 >>>=20 >>>=20 >>> While not too specific to Rowan, reiterating the pecl/http approach = is >>> indirectly what your asking for? I have mentioned this numerous = times, but >>> you haven=E2=80=99t responded with a reason not to take this = approach - which is an >>> RFC that was presented for discussion prior to yours. >>=20 >>=20 >> I'm trying to understand how pecl/http solves the aforementioned = problem >> any better? Again, I have no problem with competing ideas and it's = not as >> though one is prohibited from presenting an idea for the mere fact = that >> there exists a competing one. I'm just not seeing how pecl/http = solves the >> problem I intend to solve better. The reason I haven't responded to = you yet >> is because I'm stilling weighing the two to try and make sense of = whether >> or not these are in fact competing ideas or complimenting ones. >>=20 >> Please, feel free to weigh in with anything that contradicts or = concludes >> what I'm saying. I certainly don't expect to have all of the answers. >>=20 >>=20 >> What doesn=E2=80=99t pecl/http solve under your situation? The fact = that=E2=80=99s it=E2=80=99s >> not directly integrated as part of ZE and handling process? >>=20 >=20 >=20 > Well, you're the one suggesting an alternative. The onus is on you to = prove > that it solves the same problem, not me. However, I'll bite for the > purposes of moving the discussion along=E2=80=A6 I=E2=80=99m actually not suggesting an alternative - I=E2=80=99m = suggesting this RFC isn=E2=80=99t an option. >=20 > As far as I understand, pecl/http attempts to solve a much larger = scope of > problems than this RFC. Namely, dealing with HTTP messages in general, > whether they are a part of PHP's request/response model or not. i.e. = there > is no direct integration of the PHP request into pecl/http and as such = it > doesn't directly solve a problem such as properly parsing the HTTP = request > body during a PUT request and properly populating the $_FILES/$_POST > superglobals. It also doesn't solve similar problems where a transport > message body is sent entirely in JSON to PHP and PHP is responsible = for > handling. Sure, pecl/http solves a much larger scope of problems related to HTTP, = but that does not mean it can=E2=80=99t serve the purpose you=E2=80=99re = trying to accomplish. If your attempt is to force everyone into an = approach using the defined interfaces/classes in the RFC, this is going = nowhere. First of all, you=E2=80=99re assuming PHP is an OOP-only = language. =20 >=20 > Of course, yes, you can do accomplish this today with some hacks like = using > the php://input stream, but it's only up until recently that this = stream > has become reusable. It's also potentially creating some duplication, = but > albeit this isn't the only problem. You don=E2=80=99t need to tie into the input stream - use pecl/http... >=20 > This RFC also attempts to make it possible for users to directly apply > filters to input from the HTTP request so that they can simply = retrieve the > fitlered data from the HttpRequest object directly without having to = do > things like $foo =3D isset($_POST['foo']) ? filter_var($_POST['foo'], > FILTER_VAR_INT) : 0; // for example I understand why you=E2=80=99d want this in specific use-cases, but = don=E2=80=99t tie everyone to your needs. This isn=E2=80=99t a = requirement for a language. Plenty of frameworks can provide exactly = what you=E2=80=99re describing. >=20 > I have nothing against pecl/http. I think it's a very useful library = and > Mike seems to have put a great deal of work into it. I would gladly = vote it > into PHP core. I'm just not clear on how it solves the same problems = this > RFC attempts to solve. They can actually compliment each other in some > areas; I can see that. >=20 >=20 >=20 >>=20 >> I certainly have no problem with competing ideas either. However, the = only >> proposed patch in this RFC is a gist with PHP pseudocode. >>=20 >>=20 >>=20 >>=20 >=20 > It's not pseudocode since it's actually perfectly valid PHP code that = will > compile and run in the PHP interpreter. However, it is intended to > demonstrate the behavior. The pecl/http RFC is also further along as = it's > in discussion phase with an actual implementation. This RFC is merely = a > draft, with no actual implementation proposed yet (but that's not at = all > uncommon as many RFCs proposed in PHP did not provide an actual > implementation until after they were voted in: generators, list in = foreach, > and finally are among a small number that come to mind). So let's not = get > hung up on implementation being the barrier to entry for an RFC as = that's > never ever been the case in the past. My apologies. Please replace pseudocode with prototypes. >=20 > It is, however, entirely understandable that the RFC should explain = the > actual behavior and consequences as well as possible if it does not = provide > an actual implementation. This is just a very early stage discussion = to > gather ideas so that I can improve and finalize the RFC. I have not > actually placed the RFC into discussion or voting phase just yet. So = let's > not put the cart before the horse. I=E2=80=9Dm not suggesting you provide a patch, and I=E2=80=99m actually = glad you didn=E2=80=99t do the work yet. =20