From 74fe8646cd6a16d3c06fd918c7130a2e7beec8ee Mon Sep 17 00:00:00 2001 From: totoprayogo1916 Date: Wed, 15 Mar 2023 16:14:41 +0700 Subject: [PATCH 01/18] replace `mixed` in `system\HTTP\IncomingRequest.php` --- system/HTTP/IncomingRequest.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index 008a865bcdcd..eca5bfdd6421 100755 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -572,7 +572,7 @@ public function getDefaultLocale(): string * * @param array|string|null $index * @param int|null $filter Filter constant - * @param mixed $flags + * @param array|int|null $flags * * @return array|bool|float|int|stdClass|string|null */ @@ -707,7 +707,7 @@ public function getRawInput() * @param int|null $filter Filter Constant * @param array|int|null $flags Option * - * @return mixed + * @return array|bool|int|object|null */ public function getRawInputVar($index = null, ?int $filter = null, $flags = null) { @@ -759,9 +759,9 @@ public function getRawInputVar($index = null, ?int $filter = null, $flags = null * * @param array|string|null $index Index for item to fetch from $_GET. * @param int|null $filter A filter name to apply. - * @param mixed|null $flags + * @param array|int|null $flags * - * @return mixed + * @return array|bool|string|null */ public function getGet($index = null, $filter = null, $flags = null) { @@ -773,9 +773,9 @@ public function getGet($index = null, $filter = null, $flags = null) * * @param array|string|null $index Index for item to fetch from $_POST. * @param int|null $filter A filter name to apply - * @param mixed $flags + * @param array|int|null $flags * - * @return mixed + * @return array|bool|string|null */ public function getPost($index = null, $filter = null, $flags = null) { @@ -787,9 +787,9 @@ public function getPost($index = null, $filter = null, $flags = null) * * @param array|string|null $index Index for item to fetch from $_POST or $_GET * @param int|null $filter A filter name to apply - * @param mixed $flags + * @param array|int|null $flags * - * @return mixed + * @return array|bool|string|null */ public function getPostGet($index = null, $filter = null, $flags = null) { @@ -809,9 +809,9 @@ public function getPostGet($index = null, $filter = null, $flags = null) * * @param array|string|null $index Index for item to be fetched from $_GET or $_POST * @param int|null $filter A filter name to apply - * @param mixed $flags + * @param array|int|null $flags * - * @return mixed + * @return array|bool|string|null */ public function getGetPost($index = null, $filter = null, $flags = null) { @@ -831,9 +831,9 @@ public function getGetPost($index = null, $filter = null, $flags = null) * * @param array|string|null $index Index for item to be fetched from $_COOKIE * @param int|null $filter A filter name to be applied - * @param mixed $flags + * @param array|int|null $flags * - * @return mixed + * @return array|bool|string|null */ public function getCookie($index = null, $filter = null, $flags = null) { From 9b2eadedbc888a61d25f52b916336fb0fb2f4e38 Mon Sep 17 00:00:00 2001 From: totoprayogo1916 Date: Thu, 16 Mar 2023 23:29:32 +0700 Subject: [PATCH 02/18] update docs --- .../source/incoming/incomingrequest.rst | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/user_guide_src/source/incoming/incomingrequest.rst b/user_guide_src/source/incoming/incomingrequest.rst index f54b1f9ff741..bbcc7cdf0125 100644 --- a/user_guide_src/source/incoming/incomingrequest.rst +++ b/user_guide_src/source/incoming/incomingrequest.rst @@ -321,7 +321,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_REQUEST`` if no parameters supplied, otherwise the REQUEST value if found, or null if not - :rtype: mixed|null + :rtype: array|bool|float|int|stdClass|string|null The first parameter will contain the name of the REQUEST item you are looking for: @@ -360,7 +360,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_GET`` if no parameters supplied, otherwise the GET value if found, or null if not - :rtype: mixed|null + :rtype: array|bool|string|null This method is identical to ``getVar()``, only it fetches GET data. @@ -372,7 +372,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_POST`` if no parameters supplied, otherwise the POST value if found, or null if not - :rtype: mixed|null + :rtype: array|bool|string|null This method is identical to ``getVar()``, only it fetches POST data. @@ -385,7 +385,7 @@ The methods provided by the parent classes that are available are: `here `__. :returns: ``$_POST`` and ``$_GET`` combined if no parameters specified (prefer POST value on conflict), otherwise looks for POST value, if nothing found looks for GET value, if no value found returns null - :rtype: mixed|null + :rtype: array|bool|string|null This method works pretty much the same way as ``getPost()`` and ``getGet()``, only combined. It will search through both POST and GET streams for data, looking first in POST, and @@ -405,7 +405,7 @@ The methods provided by the parent classes that are available are: `here `__. :returns: ``$_GET`` and ``$_POST`` combined if no parameters specified (prefer GET value on conflict), otherwise looks for GET value, if nothing found looks for POST value, if no value found returns null - :rtype: mixed|null + :rtype: array|bool|string|null This method works pretty much the same way as ``getPost()`` and ``getGet()``, only combined. It will search through both GET and POST streams for data, looking first in GET, and @@ -419,13 +419,13 @@ The methods provided by the parent classes that are available are: .. php:method:: getCookie([$index = null[, $filter = null[, $flags = null]]]) :noindex: - :param mixed $index: COOKIE name + :param array|string|null $index: COOKIE name :param int $filter: The type of filter to apply. A list of filters can be found `here `__. :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_COOKIE`` if no parameters supplied, otherwise the COOKIE value if found or null if not - :rtype: mixed + :rtype: array|bool|string|null This method is identical to ``getPost()`` and ``getGet()``, only it fetches cookie data: @@ -442,13 +442,13 @@ The methods provided by the parent classes that are available are: .. php:method:: getServer([$index = null[, $filter = null[, $flags = null]]]) :noindex: - :param mixed $index: Value name + :param array|string|null $index: Value name :param int $filter: The type of filter to apply. A list of filters can be found `here `__. :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_SERVER`` item value if found, null if not - :rtype: mixed + :rtype: array|bool|string|null This method is identical to the ``getPost()``, ``getGet()`` and ``getCookie()`` methods, only it fetches getServer data (``$_SERVER``): @@ -465,7 +465,7 @@ The methods provided by the parent classes that are available are: :param int $filter: The type of filter to apply. A list of filters can be found `here `__. :returns: The User Agent string, as found in the SERVER data, or null if not found. - :rtype: mixed + :rtype: CodeIgniter\\HTTP\\UserAgent This method returns the User Agent string from the SERVER data: From cc7be623caca99c301966eebf29fb6eef6359717 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 11:32:21 +0900 Subject: [PATCH 03/18] docs: improve expression --- 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 c95041865f54..e0251aff9c0a 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -22,7 +22,7 @@ By default, CodeIgniter comes with the ``ENVIRONMENT`` constant set to use the value provided in ``$_SERVER['CI_ENVIRONMENT']``, otherwise defaulting to ``production``. This can be set in several ways depending on your server setup. -.. note:: The environment ``testing`` is the special one for PHPUnit testing. +.. note:: The environment ``testing`` is reserved for PHPUnit testing. It has special conditions built into the framework at various places to assist with that. You can't use it for your development. From 41de8815a5f6c758a57fd538b1674d5663e9b9df Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 11:36:47 +0900 Subject: [PATCH 04/18] docs: move the sentence --- user_guide_src/source/general/environments.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index e0251aff9c0a..25a34e25c64b 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -20,7 +20,7 @@ The ENVIRONMENT Constant By default, CodeIgniter comes with the ``ENVIRONMENT`` constant set to use the value provided in ``$_SERVER['CI_ENVIRONMENT']``, otherwise defaulting to -``production``. This can be set in several ways depending on your server setup. +``production``. .. note:: The environment ``testing`` is reserved for PHPUnit testing. It has special conditions built into the framework at various places to assist with that. @@ -30,6 +30,8 @@ the value provided in ``$_SERVER['CI_ENVIRONMENT']``, otherwise defaulting to > php spark env +This can be set in several ways depending on your server setup. + .env ---- From 2467bb4ec55e4cb9b277f987b87f080f007c94e0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 11:37:05 +0900 Subject: [PATCH 05/18] docs: improve link --- user_guide_src/source/general/configuration.rst | 2 ++ user_guide_src/source/general/environments.rst | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/general/configuration.rst b/user_guide_src/source/general/configuration.rst index bce8c1d602f5..aefcad81809d 100644 --- a/user_guide_src/source/general/configuration.rst +++ b/user_guide_src/source/general/configuration.rst @@ -63,6 +63,8 @@ One of today's best practices for application setup is to use Environment Variab Environment Variables should also be used for anything private such as passwords, API keys, or other sensitive data. +.. _dotenv-file: + Environment Variables and CodeIgniter ===================================== diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 25a34e25c64b..e5c01c5ce06e 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -35,7 +35,7 @@ This can be set in several ways depending on your server setup. .env ---- -The simplest method to set the variable is in your :doc:`.env file `. +The simplest method to set the variable is in your :ref:`.env file `. .. code-block:: ini From 96cffc2665bb41ecb8a185ebfd40cad1f98a5547 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:08:15 +0900 Subject: [PATCH 06/18] docs: change section title level --- user_guide_src/source/general/environments.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index e5c01c5ce06e..7d7cb460193d 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -104,8 +104,9 @@ a fresh install: * production.php * testing.php +************************************* Effects on Default Framework Behavior -===================================== +************************************* There are some places in the CodeIgniter system where the ``ENVIRONMENT`` constant is used. This section describes how default framework behavior From b0ba1287cc793ab879cc8367734202f4bf4c5581 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:09:51 +0900 Subject: [PATCH 07/18] docs: add "The Defined Environments" --- user_guide_src/source/general/environments.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 7d7cb460193d..ed341e85c3ce 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -13,6 +13,20 @@ tools loaded that you don't in production environments, etc. :local: :depth: 2 +************************ +The Defined Environments +************************ + +By default, CodeIgniter has three environments defined. + +- ``production`` for production +- ``development`` for development +- ``testing`` for PHPUnit testing + +The environment ``testing`` is reserved for PHPUnit testing. It has special +conditions built into the framework at various places to assist with that. +You can't use it for your development. + .. _environment-constant: The ENVIRONMENT Constant From c5739f07ed2fd9ff42e9da24f670a0af78e64130 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:10:15 +0900 Subject: [PATCH 08/18] add section title --- user_guide_src/source/general/environments.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index ed341e85c3ce..4926f51804b4 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -27,6 +27,10 @@ The environment ``testing`` is reserved for PHPUnit testing. It has special conditions built into the framework at various places to assist with that. You can't use it for your development. +******************* +Setting Environment +******************* + .. _environment-constant: The ENVIRONMENT Constant From ae6f7278e827743ec5a172d3654b0f9561ab622e Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:11:11 +0900 Subject: [PATCH 09/18] docs: add "Adding Environments" --- user_guide_src/source/general/environments.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 4926f51804b4..66d0e9087b47 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -108,8 +108,14 @@ In addition to affecting some basic framework behavior (see the next section), you may use this constant in your own development to differentiate between which environment you are running in. +******************* +Adding Environments +******************* + +To add custom environments, you just need to add boot files for them. + Boot Files ----------- +========== CodeIgniter requires that a PHP script matching the environment's name is located under **APPPATH/Config/Boot**. These files can contain any customizations that @@ -122,6 +128,12 @@ a fresh install: * production.php * testing.php +For example, if you want to add ``staging`` environment for staging, all you need +to do is: + +1. copy **APPPATH/Config/Boot/production.php** to **staging.php**. +2. customize settings in **staging.php** if you want. + ************************************* Effects on Default Framework Behavior ************************************* From 89bd1710e4758ca8d0b98c295137730c4ac86bd6 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:12:02 +0900 Subject: [PATCH 10/18] docs: add "Confirming the Current Environment" --- user_guide_src/source/general/environments.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 66d0e9087b47..36615f64153d 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -44,10 +44,6 @@ the value provided in ``$_SERVER['CI_ENVIRONMENT']``, otherwise defaulting to It has special conditions built into the framework at various places to assist with that. You can't use it for your development. -.. note:: You can check the current environment by ``spark env`` command:: - - > php spark env - This can be set in several ways depending on your server setup. .env @@ -134,6 +130,16 @@ to do is: 1. copy **APPPATH/Config/Boot/production.php** to **staging.php**. 2. customize settings in **staging.php** if you want. +********************************** +Confirming the Current Environment +********************************** + +To confirm the current environment, simply echo the constant ``ENVIRONMENT``. + +You can also check the current environment by ``spark env`` command:: + + > php spark env + ************************************* Effects on Default Framework Behavior ************************************* From 98fd9e999b91861bcbd4d1aa130b4607abc98269 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:13:05 +0900 Subject: [PATCH 11/18] docs: delete descriptions that are no longer needed --- user_guide_src/source/general/environments.rst | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 36615f64153d..b466d92f7f2c 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -36,13 +36,9 @@ Setting Environment The ENVIRONMENT Constant ======================== -By default, CodeIgniter comes with the ``ENVIRONMENT`` constant set to use -the value provided in ``$_SERVER['CI_ENVIRONMENT']``, otherwise defaulting to -``production``. - -.. note:: The environment ``testing`` is reserved for PHPUnit testing. - It has special conditions built into the framework at various places to assist with that. - You can't use it for your development. +To set your environment, CodeIgniter comes with the ``ENVIRONMENT`` constant. +If you set ``$_SERVER['CI_ENVIRONMENT']``, the value will be used, +otherwise defaulting to ``production``. This can be set in several ways depending on your server setup. From cbb844094d78741dfe8f5354f04fb8f628df79e4 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:19:19 +0900 Subject: [PATCH 12/18] docs: add sentence --- user_guide_src/source/general/environments.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index b466d92f7f2c..377f73820577 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -27,6 +27,9 @@ The environment ``testing`` is reserved for PHPUnit testing. It has special conditions built into the framework at various places to assist with that. You can't use it for your development. +If you want another environment, e.g., for staging, you can add custom environments. +See `Adding Environments`_. + ******************* Setting Environment ******************* From 4afe53acf337d301a2be83ace9a7456f73d40587 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 13:24:47 +0900 Subject: [PATCH 13/18] docs: make note for testing --- 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 377f73820577..5557c8bc8824 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -23,9 +23,9 @@ By default, CodeIgniter has three environments defined. - ``development`` for development - ``testing`` for PHPUnit testing -The environment ``testing`` is reserved for PHPUnit testing. It has special -conditions built into the framework at various places to assist with that. -You can't use it for your development. +.. important:: The environment ``testing`` is reserved for PHPUnit testing. It + has special conditions built into the framework at various places to assist + with that. You can't use it for your development. If you want another environment, e.g., for staging, you can add custom environments. See `Adding Environments`_. From 6a4dede220f13ca37d46ca570d7722a968226bcb Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 31 Mar 2023 17:11:28 +0900 Subject: [PATCH 14/18] docs: fix section title level --- 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 5557c8bc8824..54a77da23b99 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -148,7 +148,7 @@ 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 all PHP errors to be rendered to the browser when they occur. From d239b2a09188b1c28e7ed44a38e0f240216be00a Mon Sep 17 00:00:00 2001 From: totoprayogo1916 Date: Sat, 1 Apr 2023 22:23:33 +0700 Subject: [PATCH 15/18] update return type --- system/HTTP/IncomingRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index eca5bfdd6421..70c2d16a2f3b 100755 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -707,7 +707,7 @@ public function getRawInput() * @param int|null $filter Filter Constant * @param array|int|null $flags Option * - * @return array|bool|int|object|null + * @return array|bool|float|int|object|string|null */ public function getRawInputVar($index = null, ?int $filter = null, $flags = null) { From 8ce0e5b1526b63e5a3be3b5b8d4981ee013f929a Mon Sep 17 00:00:00 2001 From: Toto Date: Sun, 2 Apr 2023 19:54:05 +0700 Subject: [PATCH 16/18] Apply suggestions from @kenjis Co-authored-by: kenjis --- system/HTTP/IncomingRequest.php | 10 +++++----- user_guide_src/source/incoming/incomingrequest.rst | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index 70c2d16a2f3b..29529fd5bef0 100755 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -761,7 +761,7 @@ public function getRawInputVar($index = null, ?int $filter = null, $flags = null * @param int|null $filter A filter name to apply. * @param array|int|null $flags * - * @return array|bool|string|null + * @return array|bool|float|int|object|string|null */ public function getGet($index = null, $filter = null, $flags = null) { @@ -775,7 +775,7 @@ public function getGet($index = null, $filter = null, $flags = null) * @param int|null $filter A filter name to apply * @param array|int|null $flags * - * @return array|bool|string|null + * @return array|bool|float|int|object|string|null */ public function getPost($index = null, $filter = null, $flags = null) { @@ -789,7 +789,7 @@ public function getPost($index = null, $filter = null, $flags = null) * @param int|null $filter A filter name to apply * @param array|int|null $flags * - * @return array|bool|string|null + * @return array|bool|float|int|object|string|null */ public function getPostGet($index = null, $filter = null, $flags = null) { @@ -811,7 +811,7 @@ public function getPostGet($index = null, $filter = null, $flags = null) * @param int|null $filter A filter name to apply * @param array|int|null $flags * - * @return array|bool|string|null + * @return array|bool|float|int|object|string|null */ public function getGetPost($index = null, $filter = null, $flags = null) { @@ -833,7 +833,7 @@ public function getGetPost($index = null, $filter = null, $flags = null) * @param int|null $filter A filter name to be applied * @param array|int|null $flags * - * @return array|bool|string|null + * @return array|bool|float|int|object|string|null */ public function getCookie($index = null, $filter = null, $flags = null) { diff --git a/user_guide_src/source/incoming/incomingrequest.rst b/user_guide_src/source/incoming/incomingrequest.rst index bbcc7cdf0125..59982934f596 100644 --- a/user_guide_src/source/incoming/incomingrequest.rst +++ b/user_guide_src/source/incoming/incomingrequest.rst @@ -321,7 +321,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_REQUEST`` if no parameters supplied, otherwise the REQUEST value if found, or null if not - :rtype: array|bool|float|int|stdClass|string|null + :rtype: array|bool|float|int|object|string|null The first parameter will contain the name of the REQUEST item you are looking for: @@ -360,7 +360,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_GET`` if no parameters supplied, otherwise the GET value if found, or null if not - :rtype: array|bool|string|null + :rtype: array|bool|float|int|object|string|null This method is identical to ``getVar()``, only it fetches GET data. @@ -372,7 +372,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_POST`` if no parameters supplied, otherwise the POST value if found, or null if not - :rtype: array|bool|string|null + :rtype: array|bool|float|int|object|string|null This method is identical to ``getVar()``, only it fetches POST data. @@ -385,7 +385,7 @@ The methods provided by the parent classes that are available are: `here `__. :returns: ``$_POST`` and ``$_GET`` combined if no parameters specified (prefer POST value on conflict), otherwise looks for POST value, if nothing found looks for GET value, if no value found returns null - :rtype: array|bool|string|null + :rtype: array|bool|float|int|object|string|null This method works pretty much the same way as ``getPost()`` and ``getGet()``, only combined. It will search through both POST and GET streams for data, looking first in POST, and @@ -405,7 +405,7 @@ The methods provided by the parent classes that are available are: `here `__. :returns: ``$_GET`` and ``$_POST`` combined if no parameters specified (prefer GET value on conflict), otherwise looks for GET value, if nothing found looks for POST value, if no value found returns null - :rtype: array|bool|string|null + :rtype: array|bool|float|int|object|string|null This method works pretty much the same way as ``getPost()`` and ``getGet()``, only combined. It will search through both GET and POST streams for data, looking first in GET, and @@ -425,7 +425,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_COOKIE`` if no parameters supplied, otherwise the COOKIE value if found or null if not - :rtype: array|bool|string|null + :rtype: array|bool|float|int|object|string|null This method is identical to ``getPost()`` and ``getGet()``, only it fetches cookie data: @@ -448,7 +448,7 @@ The methods provided by the parent classes that are available are: :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: ``$_SERVER`` item value if found, null if not - :rtype: array|bool|string|null + :rtype: array|bool|float|int|object|string|null This method is identical to the ``getPost()``, ``getGet()`` and ``getCookie()`` methods, only it fetches getServer data (``$_SERVER``): From 3f1c3051851e5a6f3d1a0d286ea8ad19eb0a0ce7 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 3 Apr 2023 09:49:44 +0900 Subject: [PATCH 17/18] docs: fix @return type --- system/HTTP/RequestTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/HTTP/RequestTrait.php b/system/HTTP/RequestTrait.php index 2392ecbc4a79..418da59865b2 100644 --- a/system/HTTP/RequestTrait.php +++ b/system/HTTP/RequestTrait.php @@ -244,7 +244,7 @@ public function setGlobal(string $method, $value) * @param int|null $filter Filter constant * @param array|int|null $flags Options * - * @return array|bool|string|null + * @return array|bool|float|int|object|string|null */ public function fetchGlobal(string $method, $index = null, ?int $filter = null, $flags = null) { From cf2880b4d79182bc3c9dd1bd1ae5d1667343b323 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 4 Apr 2023 10:24:52 +0900 Subject: [PATCH 18/18] docs: make TOC depth 3 --- 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 54a77da23b99..667a5bd11e46 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -11,7 +11,7 @@ tools loaded that you don't in production environments, etc. .. contents:: :local: - :depth: 2 + :depth: 3 ************************ The Defined Environments