Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70377 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35893 invoked from network); 25 Nov 2013 15:29:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2013 15:29:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.47 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.215.47 mail-la0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:59009] helo=mail-la0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/B5-34377-3FC63925 for ; Mon, 25 Nov 2013 10:29:56 -0500 Received: by mail-la0-f47.google.com with SMTP id ep20so3096054lab.6 for ; Mon, 25 Nov 2013 07:29:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=w5ArRn+Pn5V5OgQo+amW6bhn+/0RuvoMg3zGrbsgTqc=; b=0TZ7Xvs+Ys7NupgZF+Ays+3a5F9G4+ArMpmJUzQL3eJYt/fieX9vdYX84mTB1pGIM1 Xis/sZ8+GH8ad+aJMzXiPHyxiLDfJR2aorSDGUTkZdT8qZef6aPADhS6rHgRMYATy/rw 9u/Kq2jUx9DzwXzrqyZ8MSUxExjvANxC7BA8s76Fh7jslZBbeRcJwkXKS5drAbIat60a QqaGpvbyaExx+uYr+dCju7/fT3o1ZgYBpL2VXgBP3oRO6MC8hP+gQy/wF85ALIQCT1hJ rj1b8vb02zbuOXqvr6W3GEQzcxZN1ApWIh1TRxBsVp467g/nGaVjMLBfFNkBP+1W03XM mejg== MIME-Version: 1.0 X-Received: by 10.112.205.164 with SMTP id lh4mr21929782lbc.15.1385393392673; Mon, 25 Nov 2013 07:29:52 -0800 (PST) Sender: mike.php.net@gmail.com Received: by 10.114.197.35 with HTTP; Mon, 25 Nov 2013 07:29:52 -0800 (PST) In-Reply-To: References: Date: Mon, 25 Nov 2013 16:29:52 +0100 X-Google-Sender-Auth: kHhcX3ZyLRyzo6oQd4qWyLu5SyU Message-ID: To: Ferenc Kovacs Cc: Yasuo Ohgaki , Julien Pauli , Adam Harvey , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [RFC] Slim POST data (was: PHP-5.6 and $HTTP_RAW_POST_DATA) From: mike@php.net (Michael Wallner) On 23 November 2013 22:40, Ferenc Kovacs wrote: > > > After thinking about this, I think I figured out a way to provide this > improvement in 5.6 without the BC break and marking the old behavior > deprecated so people using it can prepare for the removal of > $HTTP_RAW_POST_DATA. > before I describe it, here is some context, feel free to point out any > error/misunderstanding: > > $HTTP_RAW_POST_DATA is a global, but not a superglobal, which means we can't > really track and trigger an E_DEPRECATED when accessed, because that would > add an overhead for any access for global variables. > $HTTP_RAW_POST_DATA (up until the introduction of this improvement) will be > populated if enable_post_data_reading is not set to Off(this ini is present > since php 5.4) and any of these conditions are met: > > the always_populate_raw_post_data ini is set to true > php is provided with an unrecognized MIME/content type > > the change in master(which was then branched to 5.6) removed the > always_populate_raw_post_data ini settings and the $HTTP_RAW_POST_DATA > global, so it will be never automatically populated. > this breaks BC > > Here is what I would propose: > > reintroduce always_populate_raw_post_data, but turn it into an integer from > a bool to an entry, which can take -1/0/1 as possible values, where 0 and 1 > are the old On and Off behavior, and -1 would disable the population of > $HTTP_RAW_POST_DATA completely, this way people who want the performance > gain can opt-in. > reintroduce the population of the $HTTP_RAW_POST_DATA via reading the data > from the new stream which Mike introduced, this way we would keep BC for > those who doesn't explicitly opt-in for this new feature. > trigger an E_DEPRECATED error when the always_populate_raw_post_data ini > setting is (explicitly or implicitly via not specifying) is set to anything > else but -1, with an error message, which tells people that > $HTTP_RAW_POST_DATA will go away in the future. > > what do you think? Sounds doable! I'd implement the INI with 1, "On", 0, "Off", and -1, "Never" settings, if nobody objects (the first two for BC and "Never" to complement). -- Regards, Mike