From 77f9ef8bda63aec4ace971e82760d9cccecb824a Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 28 Oct 2023 19:04:20 +0900 Subject: [PATCH] docs: add docs --- user_guide_src/source/changelogs/v4.5.0.rst | 2 + .../source/general/configuration.rst | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 80ae4c87ac31..2c1ce4b00953 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -172,6 +172,8 @@ Enhancements Commands ======== +- Added ``spark config:check`` command to check Config values. See + :ref:`confirming-config-values` for the details. - Added ``spark lang:find`` command to update translations keys. See :ref:`generating-translation-files-via-command` for the details. Testing diff --git a/user_guide_src/source/general/configuration.rst b/user_guide_src/source/general/configuration.rst index 45ecce84108d..5006a49a1cf0 100644 --- a/user_guide_src/source/general/configuration.rst +++ b/user_guide_src/source/general/configuration.rst @@ -174,6 +174,8 @@ Some environments, e.g., Docker, CloudFormation, do not permit variable name wit app_forceGlobalSecureRequests = true app_CSPEnabled = true +.. _configuration-classes-and-environment-variables: + Configuration Classes and Environment Variables *********************************************** @@ -351,3 +353,49 @@ the three properties declared, but the value of the ``$target`` property will be by treating ``RegionalSales`` as a "registrar". The resulting configuration properties: .. literalinclude:: configuration/011.php + +.. _confirming-config-values: + +Confirming Config Values +************************ + +The actual Config object property values are changed at runtime by the :ref:`registrars` +and :ref:`Environment Variables `. + +CodeIgniter has the following :doc:`command <../cli/spark_commands>` to check +Config values. + +.. _spark-config-check: + +config:check +============ + +.. versionadded:: 4.5.0 + +For example, if you want to check the ``Config\App`` instance: + +.. code-block:: console + + php spark config:check App + +The output is like the following: + +.. code-block:: none + + Config\App#6 (12) ( + public 'baseURL' -> string (22) "http://localhost:8080/" + public 'allowedHostnames' -> array (0) [] + public 'indexPage' -> string (9) "index.php" + public 'uriProtocol' -> string (11) "REQUEST_URI" + public 'defaultLocale' -> string (2) "en" + public 'negotiateLocale' -> boolean false + public 'supportedLocales' -> array (1) [ + 0 => string (2) "en" + ] + public 'appTimezone' -> string (3) "UTC" + public 'charset' -> string (5) "UTF-8" + public 'forceGlobalSecureRequests' -> boolean false + public 'proxyIPs' -> array (0) [] + public 'CSPEnabled' -> boolean false + ) +