Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50901 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99616 invoked from network); 7 Dec 2010 16:05:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2010 16:05:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=nicobn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nicobn@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: nicobn@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:63238] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/54-04382-95B5EFC4 for ; Tue, 07 Dec 2010 11:05:46 -0500 Received: by wyb39 with SMTP id 39so57749wyb.29 for ; Tue, 07 Dec 2010 08:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=+zJskAhhkmRv4VPLa1s6KtodNZ1hB6K1GOwsEXnhC1g=; b=h3hn+1+fQ2NAF2tBPByo5Dphcg38FEAOc4UAXen5R0LpBsmuNGPB9i2Azceq0AFs99 WB9E9W7AFlqnlzzDi7RdkJ+8JWpO00VByl9Udis/wz+kLFltNwQSMrI90UCLPGTiRFWB 4hw7rGsnamrm4lJ02oVShcqrHOcC+YpUTwCBY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=p0G/N5SgAvy3TcqN06Yj2GVTXPN38Y7CmKJ8NiRtnB6FgXhuThd0/j3FC69kzR2XRX VsY/1iT2DNaWMYBVfQ5qcAkYlamQBdzcvfBbyG41C7cTPempOqX2+ik3xZuyX2BTxDMp jUcSPgPnRZextySzZy4/svU0wlZz/BE2o9Z4Y= MIME-Version: 1.0 Received: by 10.216.55.145 with SMTP id k17mr575431wec.48.1291737942808; Tue, 07 Dec 2010 08:05:42 -0800 (PST) Received: by 10.216.176.78 with HTTP; Tue, 7 Dec 2010 08:05:42 -0800 (PST) In-Reply-To: References: Date: Tue, 7 Dec 2010 11:05:42 -0500 Message-ID: To: Gustavo Lopes Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=0016e6dab4df3959c40496d42de7 Subject: Re: [PHP-DEV] [PATCH] Add option to disable POST data processing From: nicobn@gmail.com (=?ISO-8859-1?Q?Nicolas_A=2E_B=E9rard=2DNault?=) --0016e6dab4df3959c40496d42de7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, On Tue, Dec 7, 2010 at 2:08 AM, Gustavo Lopes wrote= : > The very simple attached patch adds an option to disable POST data > processing, which implies the data can only be read in a stream fashion > through php://input. > > As far as I know, PHP offers no way to inhibit processing RFC 1867 data a= nd > one has to use very hacky means to accomplish that. This is often require= d > (or at least convenient) in order to, e.g., proxy requests or handle file > uploads in memory. > > For other types of requests, the default processing of POST data may also > be a problem. Take a non-application/x-www-form-urlencoded POST requests > (say, some kind of RPC with a big XML payload) -- PHP is very memory > inefficient as it will hold the whole POST data into memory and duplicate= it > twice (from SG(request_info).post_data to $HTTP_RAW_POST_DATA -- even if > always_populate_raw_post_data=3D0 -- and SG(request_info).raw_post_data). > > This introduces a new ini setting, disable_post_data_processing, but it's= a > benign one. No incompatibilities between setups will arise because no one > will enable it globally (it would be insane), only selectively to the > scripts that require it. The reason for an ini setting is that it must be > set early in the request life. > > Thoughts? > > This is a very, very good idea as more and more requests will be in non-urlencoded format (e.g.: JSON), especially in REST architectures. A little performance boost would not do any harm. +1. > -- > Gustavo Lopes > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --=20 Nicolas A. B=E9rard-Nault (nicobn@gmail.com) --0016e6dab4df3959c40496d42de7--