Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82548 invoked from network); 1 Nov 2014 12:41:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2014 12:41:03 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:38236] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/31-63593-DD4D4545 for ; Sat, 01 Nov 2014 07:41:01 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 66057B00085; Sat, 1 Nov 2014 08:40:58 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tDo-nx0EtbV4; Sat, 1 Nov 2014 08:40:58 -0400 (EDT) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id B9A93B00068; Sat, 1 Nov 2014 08:40:57 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: <5453D6D5.2070705@garfieldtech.com> Date: Sat, 1 Nov 2014 12:40:55 +0000 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <5452B87B.5040009@garfieldtech.com> <0B797CE3-7AFA-4330-9A98-D3CAFC6D6072@ajf.me> <5453B114.6050400@gmail.com> <5453C250.8090803@gmail.com> <5453D6D5.2070705@garfieldtech.com> To: Larry Garfield X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: ajf@ajf.me (Andrea Faulds) > On 31 Oct 2014, at 18:37, Larry Garfield = wrote: >=20 > I think the root problem is that you're solving an issue that doesn't = exist. >=20 > You're talking about providing alternate ways to parse the raw HTTP = stream into user-accessible variables, ie, by pushing them into an = object of a known interface rather than/in addition to the superglobals. >=20 > In my 15 years of writing PHP I have never wanted to change the way = the raw HTTP is parsed. I have, however, frequently wanted to have the = data accessible in a more logical, semantic, and HTTP-correct way. = ($_GET is not about HTTP GET, it's about URI query parameters. $_POST = isn't about HTTP POST, it's about application/x-www-form-encoded. Etc.) = And I've wanted that information available in a non-global, = OOP-injectable way. But I've never once had any desire to change the way = an application/x-www-form-encoded is parsed. >=20 > Implementation problems aside, your proposal is not solving an extant = problem. >=20 > If we want to improve PHP's HTTP handling, then having an object that = exposes the HTTP request in a more logical fashion would be far more = useful, and/or providing that data in a more logical way so that someone = in user-space can provide that data in a logical fashion (eg, via a = PSR-7-implementing object.) I already stated in an earlier email what I = felt would be most beneficial for internals to do toward that goal = (specifically, clean up the streams API so that we can use it directly = from an OOP world rather than a 1980s C world.) >=20 > IF internals wanted to add implementation, not just improving streams, = something like the following would be much more useful: >=20 > $request =3D http_get_request(PHP_STDIN); // or something >=20 > Where $request is an object that implements the PSR-7 RequestInterface = (or at least the read-only parts of it), or something similar. Then = implementers can compose that object however they want. >=20 > Although at least for the near term I think it's better to not do that = and just do the lower-level plumbing to make FIG's work with PSR-7 = easier. This sums up my thoughts on this very well. Nobody needs to change how = we parse the data. We just need better access to the results of the = parsing. -- Andrea Faulds http://ajf.me/