Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53708 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1467 invoked from network); 30 Jun 2011 20:44:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2011 20:44:10 -0000 Authentication-Results: pb1.pair.com header.from=michael@no-surprises.co.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=michael@no-surprises.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain no-surprises.co.uk designates 80.68.93.37 as permitted sender) X-PHP-List-Original-Sender: michael@no-surprises.co.uk X-Host-Fingerprint: 80.68.93.37 river.mgdm.net Received: from [80.68.93.37] ([80.68.93.37:46368] helo=river.mgdm.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/90-30696-810EC0E4 for ; Thu, 30 Jun 2011 16:44:09 -0400 Received: from [192.168.1.65] (87-194-154-8.bethere.co.uk [87.194.154.8]) (Authenticated sender: michael) by river.mgdm.net (Postfix) with ESMTPSA id 129C8168411 for ; Thu, 30 Jun 2011 21:44:06 +0100 (BST) Message-ID: <4E0CE015.80503@no-surprises.co.uk> Date: Thu, 30 Jun 2011 21:44:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: PHP internals Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Improvements to HTTP stream metadata From: michael@no-surprises.co.uk (Michael Maclean) 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; * 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. -- Cheers, Michael