rfc:replace_parse_url
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:replace_parse_url [2016/10/10 20:55] – bp1222 | rfc:replace_parse_url [2021/03/27 14:57] (current) – Move to inactive ilutov | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: Create URL Class ====== | + | ====== PHP RFC: Create |
- | * Version: 0.2 | + | * Version: 0.3 |
* Date: 2016-10-04 | * Date: 2016-10-04 | ||
* Author: David Walker (dave@mudsite.com) | * Author: David Walker (dave@mudsite.com) | ||
* Proposed version: PHP 7.2+ | * Proposed version: PHP 7.2+ | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 10: | Line 10: | ||
This RFC came about for an attempt to resolve [[https:// | This RFC came about for an attempt to resolve [[https:// | ||
- | The current implementation of '' | + | The current implementation of '' |
- | So, this RFC proposes creating two new classes, URLParser and URLBuilder. | + | So, this RFC proposes creating |
===== Proposal ===== | ===== Proposal ===== | ||
Line 19: | Line 19: | ||
class URL { | class URL { | ||
- | public __construct(string $url, string|URL $base); | + | public |
- | public getScheme() : ?string; | + | |
- | public getUsername() : ?string; | + | /** |
- | public getPassword() : ?string; | + | * $input - The string to be parsed |
- | public getHostname() : ?string; | + | * $base - (optional) If $url is relative, this is what it is relative to |
- | public getPort() : ?int; | + | * $encoding_override - (optional) we assume $url is a UTF-8 encoded string, you may change it here |
- | public getPath() : ?string; | + | * $url - (optional) A URL object that should be modified by the parsing of $input. |
- | public getQuery() : ?string; | + | * $state_override - (optional) begin parting the $input from a specific state. |
- | public getFragment() : ?string; | + | */ |
+ | static public function parse(string $input[, URL $base[, int $encoding_override[, | ||
+ | | ||
+ | public | ||
+ | public | ||
+ | public | ||
+ | public | ||
+ | public | ||
+ | public | ||
+ | public | ||
+ | public | ||
+ | |||
+ | public function getAll() : array; | ||
} | } | ||
Line 38: | Line 50: | ||
==== To Existing Extensions ==== | ==== To Existing Extensions ==== | ||
standard | standard | ||
- | |||
- | ===== Future Scope ===== | ||
- | Discussion brought forward the other half of this change being a URLBuilder class that is mutable. | ||
===== Open Issues ===== | ===== Open Issues ===== | ||
Line 47: | Line 56: | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
- | Vote to replace '' | ||
Requires 2/3 | Requires 2/3 | ||
Line 57: | Line 65: | ||
===== References ===== | ===== References ===== | ||
- | PR with working Implementation: |
rfc/replace_parse_url.1476132948.txt.gz · Last modified: 2017/09/22 13:28 (external edit)