@@ -41,50 +41,54 @@ public function getMethod();
41
41
public function setMethod ($ method );
42
42
43
43
/**
44
- * Retrieves the base request URL .
44
+ * Retrieves the absolute URI .
45
45
*
46
- * The base URL consists of:
46
+ * An absolute URI consists of minimally scheme and host, but can also
47
+ * contain:
47
48
*
48
- * - scheme
49
- * - authentication (if any)
50
- * - server name/host
49
+ * - authentication (user/pass) if provided
51
50
* - port (if non-standard)
51
+ * - path (if any)
52
+ * - query string (if present)
53
+ * - fragment (if present)
52
54
*
53
- * This method is provided for convenience, particularly when considering
54
- * server-side requests, where data such as the scheme and server name may
55
- * need to be computed from more than one environmental variable.
55
+ * If either of the scheme or host are not present, this method MUST return
56
+ * null.
56
57
*
57
58
* @link http://tools.ietf.org/html/rfc3986#section-4.3
58
- * @return string Returns the base URL as a string. The URL MUST include
59
- * the scheme and host; if the port is non-standard for the scheme,
60
- * the port MUST be included; authentication data MAY be provided.
59
+ * @return string|null Returns the absolute URL as a string. The URL MUST
60
+ * include the scheme and host; if the port is non-standard for the
61
+ * scheme, the port MUST be included; authentication data MAY be
62
+ * provided. If either host or scheme are missing, this method MUST
63
+ * return null.
61
64
*/
62
- public function getBaseUrl ();
65
+ public function getAbsoluteUri ();
63
66
64
67
/**
65
- * Sets the base request URL .
68
+ * Sets the absolute URI of the request .
66
69
*
67
- * The base URL MUST be a string, and MUST include the scheme and host.
70
+ * The absolute URI MUST be a string, and MUST include the scheme and host.
68
71
*
69
72
* If the port is non-standard for the scheme, the port MUST be provided.
70
73
*
71
74
* Authentication data MAY be provided.
72
75
*
73
- * If path, query string, or URL fragment are provided they SHOULD be
74
- * stripped; optionally, an error MAY be raised in such situations.
76
+ * Path, query string, and fragment are optional.
77
+ *
78
+ * When setting the absolute URI, the url (see getUrl() and setUrl()) MUST
79
+ * be updated.
75
80
*
76
81
* @link http://tools.ietf.org/html/rfc3986#section-4.3
77
- * @param string $url Base request URL .
82
+ * @param string $uri Absolute request URI .
78
83
* @return void
79
- * @throws \InvalidArgumentException If the URL is invalid.
84
+ * @throws \InvalidArgumentException If the URI is invalid.
80
85
*/
81
- public function setBaseUrl ( $ url );
86
+ public function setAbsoluteUri ( $ uri );
82
87
83
88
/**
84
89
* Retrieves the request URL.
85
90
*
86
- * The request URL is the same value as REQUEST_URI: the path and query
87
- * string ONLY.
91
+ * The request URL is the path and query string ONLY.
88
92
*
89
93
* @link http://tools.ietf.org/html/rfc7230#section-5.3
90
94
* @return string Returns the URL as a string. The URL MUST be an
@@ -99,6 +103,9 @@ public function getUrl();
99
103
* string) per RFC 7230 section 5.3; if other URL parts are present, the
100
104
* method MUST raise an exception OR remove those parts.
101
105
*
106
+ * When setting the URL, the absolute URI (see getAbsoluteUri() and
107
+ * setAbsoluteUri()) MUST be updated.
108
+ *
102
109
* @link http://tools.ietf.org/html/rfc7230#section-5.3
103
110
* @param string $url Request URL, with path and optionally query string.
104
111
* @return void
0 commit comments