From 7240d4b1f377bd2e3b60498a11a6684467e76243 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 11 Feb 2023 13:47:30 +0900 Subject: [PATCH 01/11] docs: change text decoration --- user_guide_src/source/general/environments.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index bac1f4c394cb..e623d1754382 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -48,7 +48,7 @@ The simplest method to set the variable is in your :doc:`.env file `_. .. code-block:: apache @@ -62,7 +62,7 @@ nginx ----- Under nginx, you must pass the environment variable through the ``fastcgi_params`` -in order for it to show up under the `$_SERVER` variable. This allows it to work on the +in order for it to show up under the ``$_SERVER`` variable. This allows it to work on the virtual-host level, instead of using `env` to set it for the entire server, though that would work fine on a dedicated server. You would then modify your server config to something like: @@ -105,14 +105,14 @@ a fresh install: Effects On Default Framework Behavior ===================================== -There are some places in the CodeIgniter system where the ENVIRONMENT +There are some places in the CodeIgniter system where the ``ENVIRONMENT`` constant is used. This section describes how default framework behavior is affected. Error Reporting --------------- -Setting the ENVIRONMENT constant to a value of ``development`` will cause +Setting the ``ENVIRONMENT`` constant to a value of ``development`` will cause all PHP errors to be rendered to the browser when they occur. Conversely, setting the constant to ``production`` will disable all error output. Disabling error reporting in production is a From 36f17a9aba067a419b773d2d66d6f26948a6e32c Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 11 Feb 2023 13:48:02 +0900 Subject: [PATCH 02/11] docs: update apache docs link --- user_guide_src/source/general/environments.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index e623d1754382..f847ce9e3398 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -49,7 +49,7 @@ Apache ------ This server variable can be set in your **.htaccess** file or Apache -config using `SetEnv `_. +config using `SetEnv `_. .. code-block:: apache From a375cefd92da0790e1630ddbad72494c94991b72 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 11 Feb 2023 13:48:25 +0900 Subject: [PATCH 03/11] docs: replace nginx with Nginx --- user_guide_src/source/general/environments.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index f847ce9e3398..00661c5c86dd 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -58,10 +58,10 @@ config using `SetEnv .. _environment-nginx: -nginx +Nginx ----- -Under nginx, you must pass the environment variable through the ``fastcgi_params`` +Under Nginx, you must pass the environment variable through the ``fastcgi_params`` in order for it to show up under the ``$_SERVER`` variable. This allows it to work on the virtual-host level, instead of using `env` to set it for the entire server, though that would work fine on a dedicated server. You would then modify your server config to something @@ -80,7 +80,7 @@ like: } } -Alternative methods are available for nginx and other servers, or you can +Alternative methods are available for Nginx and other servers, or you can remove this logic entirely and set the constant based on the server's IP address (for instance). From 5acce4d3588d30b3ab5b980e08493b876f1dfe3f Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 11 Feb 2023 13:48:50 +0900 Subject: [PATCH 04/11] docs: replace On with on --- user_guide_src/source/general/environments.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 00661c5c86dd..c95041865f54 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -102,7 +102,7 @@ a fresh install: * production.php * testing.php -Effects On Default Framework Behavior +Effects on Default Framework Behavior ===================================== There are some places in the CodeIgniter system where the ``ENVIRONMENT`` From fe9be1b8b892f670280afe0b9a68a13603030fd7 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 12 Feb 2023 09:03:44 +0900 Subject: [PATCH 05/11] docs: add link to page --- user_guide_src/source/libraries/uri.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst index 5e400874f548..f772840b0046 100644 --- a/user_guide_src/source/libraries/uri.rst +++ b/user_guide_src/source/libraries/uri.rst @@ -31,7 +31,7 @@ The Current URI --------------- Many times, all you really want is an object representing the current URL of this request. -You can use one of the functions available in the **url_helper**: +You can use one of the functions available in the :doc:`../helpers/url_helper`: .. literalinclude:: uri/004.php From 9e6fb5d43bcabc4a69fbd4a1f672e037e6ae7178 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 12 Feb 2023 09:04:20 +0900 Subject: [PATCH 06/11] docs: change text decoration --- user_guide_src/source/libraries/uri.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst index f772840b0046..a795cff51ad8 100644 --- a/user_guide_src/source/libraries/uri.rst +++ b/user_guide_src/source/libraries/uri.rst @@ -37,7 +37,7 @@ You can use one of the functions available in the :doc:`../helpers/url_helper`: You must pass ``true`` as the first parameter, otherwise, it will return the string representation of the current URL. This URI is based on the path (relative to your ``baseURL``) as determined by the current request object and -your settings in ``Config\App`` (baseURL, indexPage, and forceGlobalSecureRequests). +your settings in ``Config\App`` (``baseURL``, ``indexPage``, and ``forceGlobalSecureRequests``). Assuming that you're in a controller that extends ``CodeIgniter\Controller`` you can get this relative path: .. literalinclude:: uri/005.php @@ -174,7 +174,7 @@ you can use the ``stripQuery()`` and ``keepQuery()`` methods to change the actua Fragment -------- -Fragments are the portion at the end of the URL, preceded by the pound-sign (#). In HTML URLs these are links +Fragments are the portion at the end of the URL, preceded by the pound-sign (``#``). In HTML URLs these are links to an on-page anchor. Media URI's can make use of them in various other ways. .. literalinclude:: uri/022.php From eb527d6fd6761ada83e0797fe3ae8504f1cbd18f Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 12 Feb 2023 09:05:23 +0900 Subject: [PATCH 07/11] docs: fix incorrect output The getPath() returns the path starting with `/`. But if you set the path `another/path`, it returns `another/path`. --- user_guide_src/source/libraries/uri/016.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/libraries/uri/016.php b/user_guide_src/source/libraries/uri/016.php index a9e680ac38de..f9d82a86759d 100644 --- a/user_guide_src/source/libraries/uri/016.php +++ b/user_guide_src/source/libraries/uri/016.php @@ -2,5 +2,5 @@ $uri = new \CodeIgniter\HTTP\URI('http://www.example.com/some/path'); -echo $uri->getPath(); // 'some/path' -echo $uri->setPath('another/path')->getPath(); // 'another/path' +echo $uri->getPath(); // '/some/path' +echo $uri->setPath('/another/path')->getPath(); // '/another/path' From 17fa375648ec158449d455337a5208937c3ac4bb Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 12 Feb 2023 09:07:57 +0900 Subject: [PATCH 08/11] docs: add empty line --- user_guide_src/source/libraries/uri.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst index a795cff51ad8..d399e286ef8d 100644 --- a/user_guide_src/source/libraries/uri.rst +++ b/user_guide_src/source/libraries/uri.rst @@ -36,6 +36,7 @@ You can use one of the functions available in the :doc:`../helpers/url_helper`: .. literalinclude:: uri/004.php You must pass ``true`` as the first parameter, otherwise, it will return the string representation of the current URL. + This URI is based on the path (relative to your ``baseURL``) as determined by the current request object and your settings in ``Config\App`` (``baseURL``, ``indexPage``, and ``forceGlobalSecureRequests``). Assuming that you're in a controller that extends ``CodeIgniter\Controller`` you can get this relative path: From fdef54957009b75dca6e11121b9064ddf3951ad6 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 12 Feb 2023 09:08:19 +0900 Subject: [PATCH 09/11] docs: replace "i" with "I" --- user_guide_src/source/libraries/uri.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst index d399e286ef8d..e0a35e283e8d 100644 --- a/user_guide_src/source/libraries/uri.rst +++ b/user_guide_src/source/libraries/uri.rst @@ -96,7 +96,7 @@ If you do not want to display the port, pass in ``true`` as the only parameter: .. note:: If the current port is the default port for the scheme it will never be displayed. -Userinfo +UserInfo -------- The userinfo section is simply the username and password that you might see with an FTP URI. While you can get From 7411c64ba980efa2e2342efd7398a3b07caaed5a Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 12 Feb 2023 09:09:03 +0900 Subject: [PATCH 10/11] docs: add section titles --- user_guide_src/source/libraries/uri.rst | 26 ++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst index e0a35e283e8d..33bb43a40588 100644 --- a/user_guide_src/source/libraries/uri.rst +++ b/user_guide_src/source/libraries/uri.rst @@ -139,24 +139,40 @@ can be used to manipulate it: Query ----- -The query variables can be manipulated through the class using simple string representations. Query values can only +The query variables can be manipulated through the class using simple string representations. + +Getting/Setting Query +^^^^^^^^^^^^^^^^^^^^^ + +Query values can only be set as a string currently. .. literalinclude:: uri/017.php +The ``setQuery()`` method overwrite any existing query variables. + .. note:: Query values cannot contain fragments. An InvalidArgumentException will be thrown if it does. +Setting Query from Array +^^^^^^^^^^^^^^^^^^^^^^^^ + You can set query values using an array: .. literalinclude:: uri/018.php -The ``setQuery()`` and ``setQueryArray()`` methods overwrite any existing query variables. You can add a value to the +The ``setQueryArray()`` method overwrite any existing query variables. + +Adding Query Value +^^^^^^^^^^^^^^^^^^ + +You can add a value to the query variables collection without destroying the existing query variables with the ``addQuery()`` method. The first parameter is the name of the variable, and the second parameter is the value: .. literalinclude:: uri/019.php -**Filtering Query Values** +Filtering Query Values +^^^^^^^^^^^^^^^^^^^^^^ You can filter the query values returned by passing an options array to the ``getQuery()`` method, with either an *only* or an *except* key: @@ -164,6 +180,10 @@ You can filter the query values returned by passing an options array to the ``ge .. literalinclude:: uri/020.php This only changes the values returned during this one call. If you need to modify the URI's query values more permanently, + +Changing Query Values +^^^^^^^^^^^^^^^^^^^^^ + you can use the ``stripQuery()`` and ``keepQuery()`` methods to change the actual object's query variable collection: .. literalinclude:: uri/021.php From d8954a14af119d24cea9ed8cf38dd10e3b13ab42 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 13 Feb 2023 15:31:03 +0900 Subject: [PATCH 11/11] docs: replace "query variables" with "query data" --- user_guide_src/source/libraries/uri.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst index 33bb43a40588..43e77e0626e2 100644 --- a/user_guide_src/source/libraries/uri.rst +++ b/user_guide_src/source/libraries/uri.rst @@ -139,7 +139,7 @@ can be used to manipulate it: Query ----- -The query variables can be manipulated through the class using simple string representations. +The query data can be manipulated through the class using simple string representations. Getting/Setting Query ^^^^^^^^^^^^^^^^^^^^^