From 431546710ee21b8c409c78a48d9fe54b4f3da3b6 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 18 Nov 2021 09:35:32 +0900 Subject: [PATCH 1/2] docs: add @TODO See #5344 --- system/HTTP/IncomingRequest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index 128d6ee1c432..3ac25b6df5fd 100755 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -64,6 +64,8 @@ class IncomingRequest extends Request * AFTER the script name. So, if hosted in a sub-folder this will * appear different than actual URL. If you need that use getPath(). * + * @TODO should be protected. Use getUri() instead. + * * @var URI */ public $uri; From 05ce6cb92a6822177a50f479620c6dd276c15ce7 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 18 Nov 2021 09:36:14 +0900 Subject: [PATCH 2/2] docs: don't use $request->uri See #5344 --- user_guide_src/source/concepts/http.rst | 2 +- user_guide_src/source/incoming/incomingrequest.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/concepts/http.rst b/user_guide_src/source/concepts/http.rst index 2696c91223d3..8ae030fc1811 100644 --- a/user_guide_src/source/concepts/http.rst +++ b/user_guide_src/source/concepts/http.rst @@ -75,7 +75,7 @@ is an object-oriented representation of the HTTP request. It provides everything $request = service('request'); // the URI being requested (i.e., /about) - $request->uri->getPath(); + $request->getUri()->getPath(); // Retrieve $_GET and $_POST variables $request->getGet('foo'); diff --git a/user_guide_src/source/incoming/incomingrequest.rst b/user_guide_src/source/incoming/incomingrequest.rst index e9f494961233..d08bf8470f70 100644 --- a/user_guide_src/source/incoming/incomingrequest.rst +++ b/user_guide_src/source/incoming/incomingrequest.rst @@ -249,13 +249,13 @@ The Request URL --------------- You can retrieve a :doc:`URI ` object that represents the current URI for this request through the -``$request->uri`` property. You can cast this object as a string to get a full URL for the current request:: +``$request->getUri()`` method. You can cast this object as a string to get a full URL for the current request:: - $uri = (string)$request->uri; + $uri = (string) $request->getUri(); The object gives you full abilities to grab any part of the request on it's own:: - $uri = $request->uri; + $uri = $request->getUri(); echo $uri->getScheme(); // http echo $uri->getAuthority(); // snoopy:password@example.com:88