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:[EMAIL PROTECTED]" instead of "mailto://[EMAIL PROTECTED]", 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



Reply via email to