Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15841 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76244 invoked by uid 1010); 6 Apr 2005 04:48:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76228 invoked from network); 6 Apr 2005 04:48:08 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 6 Apr 2005 04:48:08 -0000 X-Host-Fingerprint: 202.27.216.34 bo.nznet.gen.nz Linux 2.4/2.6 Received: from ([202.27.216.34:35395] helo=bo.nznet.gen.nz) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id A1/A2-19272-50A63524 for ; Wed, 06 Apr 2005 00:48:06 -0400 Received: from [127.0.0.1] (ms1-36.nznet.gen.nz [202.27.216.165]) by bo.nznet.gen.nz (8.11.6/8.11.6) with ESMTP id j364ll401956 for ; Wed, 6 Apr 2005 16:47:47 +1200 Message-ID: <425369FD.1000800@nznet.gen.nz> Date: Wed, 06 Apr 2005 16:47:57 +1200 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-nz, en-gb, en-au, en, en-us MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Scheme identification in stream wrappers From: packrat@nznet.gen.nz ("Morgan L. Owens") It was suggested I post this here. In PHP, the character sequence "://" separates the protocol name from the protocol-specific part of a stream name. Clearly, the intention is that these stream names are URLs (i.e., URIs that actually provide a location for the identified resource). However, the URI specification (RFC 3986) states that the scheme delimiter is merely ":", and that "://" is only applicable for _some_ URI formats. There are URLs in common use that do not use "://" (e.g., mailto:), and in fact support for "zlib:" is a hardwired exception in the present code. May I propose that the parser which parses out the scheme from the rest of the URL look only for the initial ":" in the stream name, rather than "://". Existing uses of stream wrappers will continue to function, since the name of the scheme won't actually change, and it's the wrapper author's responsibility to parse the rest of the URL anyway; but it will become possible to correctly write, e.g., "mailto:eric@example.com" instead of "mailto://eric@example.com", or (to use the example used in the manual to describe stream_wrapper_register()) "var:myvar" instead of "var://myvar". This would also make use of parse_url() more consistent as, for example, parse_url('var:myvar') will put the name of myvar into the path element of the returned array, instead of mistakenly putting it in the host element. MLO