Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78490 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16427 invoked from network); 30 Oct 2014 20:50:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Oct 2014 20:50:02 -0000 Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wg0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:61736] helo=mail-wg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/92-04091-974A2545 for ; Thu, 30 Oct 2014 15:50:01 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so5198427wgh.15 for ; Thu, 30 Oct 2014 13:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HkGXW6NFfs02wWNtQSP94h4vA2T3q6RfwB53ajwAFug=; b=uncrLmqbdvvucOIjcYAiJ71ILSR//3FkJpkxZiF25YFW77xoQLQVCngtxEKHGj+Wr9 IsTsmikMb2Zi80dtGkSEAkboPYc9Gperve7eX4q0r61wViFlNJBmWGM3CgApdQ2+nuWz ofFNXBQqsIoW8eSHcj0h8RvvoLA1EB94x4WkK6HJHUOIt85y993cF0JKf/L8bdPbDRkQ SXYCO6d2A+W1ZsxLIzRxcR41flWuo2l5su0+9CBrxd5G7uEmtHJZXS+INY8SVQjOVdi9 EM6b/aDJPHAaNKUBAmRNTkraS6l5ncpkBGRW0bPj7byghd8GkgMGU9SKs6MmW8oNIlAJ NFhw== MIME-Version: 1.0 X-Received: by 10.180.212.110 with SMTP id nj14mr4190996wic.45.1414702198138; Thu, 30 Oct 2014 13:49:58 -0700 (PDT) Received: by 10.216.123.4 with HTTP; Thu, 30 Oct 2014 13:49:58 -0700 (PDT) In-Reply-To: References: <36B5E957-01C0-40F2-B4CE-5B02D11ACA14@ajf.me> Date: Thu, 30 Oct 2014 16:49:58 -0400 Message-ID: To: Andrea Faulds Cc: Florian Margaine , PHP Internals Content-Type: multipart/alternative; boundary=001a11c34160fbad110506aa055b Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: theanomaly.is@gmail.com (Sherif Ramadan) --001a11c34160fbad110506aa055b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Oct 30, 2014 at 4:42 PM, Andrea Faulds wrote: > > > On 30 Oct 2014, at 20:33, Sherif Ramadan > wrote: > > > > Yes, this proposal is intended to do two things. 1) Fix the > aforementioned problems. > > By the sounds of things, it doesn=E2=80=99t fix these problems, it just a= dds a new > interface which lacks them. That=E2=80=99s not the same thing. > > No, the interface makes it possible to implement your own behavior, but it does not prevent PHP from implementing default behavior. In that PHP would implement its own HttpRequest class, for example, which the user can then extend to override default behavior or modify it as they see fit for their particular use case. This is much like the Session interface, which makes it possible to change session storage mechanisms in userland, but still have a confirming method of session handling in PHP. > > 2) Improve upon the capabilities of PHP's request handling for future > use cases through a unified interface. > > What unified interface? You=E2=80=99re allowing anyone and everyone to im= plement > their own request handling. > Yes, by allowing this you make it extensible. However, having the interface is what makes it possible to unify the efforts of dealing with the HTTP messages both in userland and in PHP internals. > > > If you consider all of the major existing PHP frameworks today there is > always some form of HttpRequest class handling these things and almost al= l > of them do it slightly differently. What's worse, is they are all very > inefficient implementations that I believe can be done far more efficient= ly > in php-src. A lost of them are also unnecessarily complex. I think all of > this can be simplified if the interface is just laid out in a > straight-forward manner and then userland implementations will find less > and less reason to over-engineer the implementation. > > The only reason an implementation of HttpRequest would be inefficient is > because it has to work-around problems with $_GET and $_POST. Problems we > could simply fix. > So the fix to something like PUT/DELETE requests is to add yet another superglobal. However, this is still a very rigid fix that requires continuous maintenance and fulfilling feature requests on the part of internals. Think of implementing a new session handler for every session storage mechanism in PHP. This is a lot of unneeded effort when we can just expose the session interface to userland and make it extensible by nature. The alternative is far more useful and less closed up (preventing future problems to fix). Let's not also ignore the fact that such features have been forsaken by PHP internals for years. I have bug reports dating back to 2010 that have asked for such features that have long been unanswered. So the current desire to fix anything along these lines appears to be minimal, if not non-existent, right now. > > -- > Andrea Faulds > http://ajf.me/ > > > > > --001a11c34160fbad110506aa055b--