Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69507 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65148 invoked from network); 7 Oct 2013 15:50:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2013 15:50:40 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.215.169 mail-ea0-f169.google.com Received: from [209.85.215.169] ([209.85.215.169:38737] helo=mail-ea0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/C9-24156-F48D2525 for ; Mon, 07 Oct 2013 11:50:39 -0400 Received: by mail-ea0-f169.google.com with SMTP id k11so3399869eaj.28 for ; Mon, 07 Oct 2013 08:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=tRGjgn4kmmthiK/dq9hNK8WK9XMvawfjt8GT3rwYyiQ=; b=MWy/CSozZj+Q0XM7WMgpjG+ZP92COoRoTQVpl/PpytE4ePscKAH+Qb8kpTAfu245ui 1ioIP7d1JZRk3JW7CC10/QPa6edzoKZCmpFgWPHh51JhfTalv7NN1KLSv/7gTh9+/Zdv RUQRC+0kMdIbNcvmcX65sS3YLWQpPV6cBRoB2Jsve+eT2HCfS29UTlga5h4qJNPrfLn2 tsBvSkFEp8Jhk2bQxv6N180UIUzzTz7/JVUZ1JY1HSp6JibsfX47RmVHL5uIW2drYsi8 75/V6vA+f1j5lSf6KQIVK+uj+T2JodMaIPdaVKuM9gkA5gyJqe2dVSqmVzy9FaPw5ggr 1llw== X-Received: by 10.14.200.196 with SMTP id z44mr1365een.112.1381161036703; Mon, 07 Oct 2013 08:50:36 -0700 (PDT) Received: from [192.168.0.131] ([62.189.198.114]) by mx.google.com with ESMTPSA id m54sm64831710eex.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 08:50:36 -0700 (PDT) Message-ID: <5252D84B.5080802@gmail.com> Date: Mon, 07 Oct 2013 16:50:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: HTTP supergloblas and request body/query (was: Parsing PUT data) From: rowan.collins@gmail.com (Rowan Collins) Daniel Lowrey wrote (on 02/10/2013): > Something like the following would be an infinitely superior solution: > > interface HttpRequest { While having a quick look for userland parsing functions earlier, I came upon the PECL http extension, which includes this all-singing object: http://www.php.net/manual/en/class.httprequest.php As for this: > You can't efficiently model an HTTP request with associative arrays. Period. The fact is that for 99% of use cases, yes you can, and developers happily do so. PHP even allows the convenient field_name[]= and field_name[key]= notations for building multi-dimensional arrays. This is all a convenience wrapper, and a consistent low-level API would be good, but alternative high-level APIs can be built from a few fundamental building blocks (e.g. getting the basic raw request parts as strings, parsing strings in various form encodings) without building a whole HTTP framework into the core. Regards, -- Rowan Collins [IMSoP]