* Version: 1.0 * Date: 2017-01-23 * Author: Michał Brzuchalski <[email protected]> * Status: Draft * First Published at: http://wiki.php.net/rfc/ommit-double-slash-in-user-stream-wrapper-uri
Regarding RFC 2396 defining URI Generic Syntax which specifies URI Syntactic Components:
> The URI syntax is dependent upon the scheme.
> The URI syntax does not require that the scheme-specific-part have > any general structure or set of semantics which is common among all > URI.
This RFC proposes to add new flag STREAM_IR_URI to use with stream_wrapper_register in a third parameter.
Passing new flag allows user defined Stream Wrapper class based on streamWrapper prototype to handle URI in their general syntax consisting of <scheme></scheme> and <scheme-specific-part></scheme-specific-part> whose interpretation depends on the scheme.
> <scheme></scheme>:<scheme-specific-part></scheme-specific-part>
stream_wrapper_register(&amp;amp&#59;&amp;&#35;35&#59;39&amp;&#35;59&#59;test&amp;amp&#59;&amp;&#35;35&#59;39&amp;&#35;59&#59;, MyStreamWrapper&amp;amp&#59;&amp;&#35;35&#59;58&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;58&amp;&#35;59&#59;class, STREAM_IS_URI)&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
file_exists(&amp;amp&#59;&amp;&#35;35&#59;39&amp;&#35;59&#59;test&amp;amp&#59;&amp;&#35;35&#59;58&amp;&#35;59&#59;file.txt&amp;amp&#59;&amp;&#35;35&#59;39&amp;&#35;59&#59;)&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
Output:
> Stating file: test:file.txt
No backward incompatible changes, when additional flag is missing all handled paths are checked in case of double slash existance after colon (<scheme></scheme>://).
next PHP 7.x
No impact.
No.
No.
STREAM_IS_URI = 2 - allows user Stream Wrapper to handle all wariety of URI's without double-slash after colon
This project requires a 2/3 majority. The vote is a straight Yes/No vote for accepting the RFC and merging the patch.