1616 */
1717class CoreRequest implements Request
1818{
19+ //--------------------------------------------------------------------------------------------------------------------
20+ /**
21+ * Returns the accepted languages by the user agent.
22+ *
23+ * @return string|null
24+ *
25+ * @api
26+ * @since 1.0.0
27+ */
28+ public function getAcceptLanguage (): ?string
29+ {
30+ return $ _SERVER ['HTTP_ACCEPT_LANGUAGE ' ] ?? null ;
31+ }
32+
1933 //--------------------------------------------------------------------------------------------------------------------
2034 /**
2135 * Returns the method of the current request.
@@ -40,6 +54,21 @@ public function getMethod(): string
4054 return 'GET ' ;
4155 }
4256
57+ //--------------------------------------------------------------------------------------------------------------------
58+ /**
59+ * Returns the URL of the page (if any) which referred the user agent to the current page. This is set by the user
60+ * agent and cannot be trusted.
61+ *
62+ * @return string|null
63+ *
64+ * @api
65+ * @since 1.0.0
66+ */
67+ public function getReferrer (): ?string
68+ {
69+ return $ _SERVER ['HTTP_REFERER ' ] ?? null ;
70+ }
71+
4372 //--------------------------------------------------------------------------------------------------------------------
4473 /**
4574 * Returns the remote IP (this is always the next hop, not necessarily the user's IP address).
@@ -54,6 +83,20 @@ public function getRemoteIp(): ?string
5483 return $ _SERVER ['REMOTE_ADDR ' ] ?? null ;
5584 }
5685
86+ //--------------------------------------------------------------------------------------------------------------------
87+ /**
88+ * Returns the timestamp of the start of the request, with microsecond precision.
89+ *
90+ * @return float|null
91+ *
92+ * @api
93+ * @since 1.0.0
94+ */
95+ public function getRequestTime (): ?float
96+ {
97+ return $ _SERVER ['REQUEST_TIME_FLOAT ' ] ?? null ;
98+ }
99+
57100 //--------------------------------------------------------------------------------------------------------------------
58101 /**
59102 * Returns the requested relative URL after. It includes the query part if any.
0 commit comments