Re: Scheme identification in stream wrappers
| From: | Wez Furlong | Date: | Wed, 06 Apr 2005 12:41:35 +0000 |
| Subject: | Re: Scheme identification in stream wrappers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15856@lists.php.net to get a copy of this message | ||
You know, I could have sworn that I only looked for a : as the separator.
I seem to remember a discussion about this in the past, but don't
recall the details.
Would you mind searching the archives for the old php-dev mailing list
to see if you can find anything else on this matter?
--Wez.
On Apr 6, 2005 12:47 AM, Morgan L. Owens <packrat@nznet.gen.nz> wrote:
> 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
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>