Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78355 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56893 invoked from network); 26 Oct 2014 20:36:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2014 20:36:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=figureonecpr@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=figureonecpr@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: figureonecpr@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wg0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:34702] helo=mail-wg0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/00-56216-14B5D445 for ; Sun, 26 Oct 2014 15:36:18 -0500 Received: by mail-wg0-f49.google.com with SMTP id x13so612596wgg.32 for ; Sun, 26 Oct 2014 13:36:15 -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=KWG1FRlURmA6zLvIZ1QhyxvhqFc4HwZF6HpG8+49LE0=; b=jE5oLlHW66dZbtvj53XrOI2t4ChUUzECI5YqCY/6NG6Lo2TAeRSMPpEV2Pf15gX0J2 i/jKf3sSqvJYvd0cBKrprPOQMowRRYx+3wX/RFVkkIeahsdflZlbcm+DXzPA3/V7hvra fc/hPSCmjG/8aWmku6SJM2mg6E8WPS5ClsSYr4nRAU4NIqCW6WYbU474rpHroO3ajFLK EPAwJn8GtNPcJ2h5i9oGjKQwDnptvIThpXLIH4Gdi6uv0ofriI83imT4goh6Tz2YcsiH X8V1jcqtEsD4uLmwTSZznZkFiy0My1D5NxEwU39qIe6NSxWmqBvvufYtLeUYbPp/psQg GZ0A== MIME-Version: 1.0 X-Received: by 10.181.8.72 with SMTP id di8mr17737532wid.1.1414355775046; Sun, 26 Oct 2014 13:36:15 -0700 (PDT) Received: by 10.216.194.132 with HTTP; Sun, 26 Oct 2014 13:36:14 -0700 (PDT) In-Reply-To: References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> <8CB055D4-F164-4DF3-B019-684BAE7E016E@ajf.me> <543D47C1.9050009@lerdorf.com> <543D4CE1.5000109@lerdorf.com> <543D6864.10508@gmail.com> <543D85E6.2020507@lerdorf.com> <57b7a3681d6c2c7ae123c8921b2d19d6@mail.gmail.com> Date: Sun, 26 Oct 2014 16:36:14 -0400 Message-ID: To: Dave Cc: PHP internals list Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: figureonecpr@gmail.com (Sanford Whiteman) > The only way to do this in PHP now is write a userland function that parses > multipart form data, which is non-trivial. In addition to PECL HTTP, you might try PECL Mailparse, which is also going to be better-tested than anything written in userland. I sympathize with your overall point: even without a new superglobal, it would be cool to be able to reuse the same parser from $_POST. Still, just to put this out there: receiving multiparts via PUT can be part of a legit RESTful interface, but that doesn't mean that decoding multiparts should be automatic. It shouldn't be surprising that it PHP treats the entity as an opaque block of data by default, since it's perfectly RESTful for _the MIME-encoded body_ to be the stored resource. Imagine an e-mail archive that PUTs to /user/$username/sent/$messageid. Decoding the MIME message on resource create/update would be inappropriate in that case, a huge waste of resources. You might lazy-decode the resource only upon GET /user/$username/sent/$messageid/part/1. Within the same installation, you might want to decode other PUTs upon upload, so having a simple on/off for a new superglobal wouldn't work. -- S.