Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53709 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6727 invoked from network); 30 Jun 2011 21:29:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2011 21:29:47 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.113 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.113 smtp113.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.113] ([67.192.241.113:46954] helo=smtp113.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/20-04352-9CAEC0E4 for ; Thu, 30 Jun 2011 17:29:46 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp21.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 8982624086F; Thu, 30 Jun 2011 17:29:42 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp21.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 4F57A240851; Thu, 30 Jun 2011 17:29:42 -0400 (EDT) Message-ID: <4E0CEAC5.3070800@sugarcrm.com> Date: Thu, 30 Jun 2011 14:29:41 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Michael Maclean CC: PHP internals References: <4E0CE015.80503@no-surprises.co.uk> In-Reply-To: <4E0CE015.80503@no-surprises.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Improvements to HTTP stream metadata From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! On 6/30/11 1:44 PM, Michael Maclean wrote: > Hi, > Currently, if you open an HTTP stream using fopen(), and then call > stream_get_meta_data() on it, you obtain an associative array within > which as another with the key 'wrapper_data'. Inside that, there is a > list of the HTTP headers from the server response. I'd like to make this > a little more useful as currently I don't believe there's a way to get > the response code from the remote end without parsing those headers > yourself. While this isn't hard, I'd like to make the following changes: > > * move the current contents of the wrapper_data array to a key called > 'headers' within wrapper_data; This means breaking every script in existence that uses this data now. Probably not a good idea. Maybe we should think about a BC way to do the same. > * Add a 'response_code' key, with the server response code as an integer > * Optionally, add things like the mime type of the response. > > Anyone got any thoughts on this? I appreciate it'd be a BC break, but I > think it might be useful. > -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227