From 46191198f2e47f8127fc73ec0f4e211ea9291c6e Mon Sep 17 00:00:00 2001 From: Dimitri Sitchet Tomkeu Date: Thu, 14 Nov 2024 10:36:04 +0100 Subject: [PATCH] docs: add doc for the `namespace` option to the `publish` command --- user_guide_src/source/libraries/publisher.rst | 23 +++++++++++++++++++ .../source/libraries/publisher/016.php | 5 ++++ 2 files changed, 28 insertions(+) create mode 100644 user_guide_src/source/libraries/publisher/016.php diff --git a/user_guide_src/source/libraries/publisher.rst b/user_guide_src/source/libraries/publisher.rst index 99531eacca5b..170d42cb3840 100644 --- a/user_guide_src/source/libraries/publisher.rst +++ b/user_guide_src/source/libraries/publisher.rst @@ -75,6 +75,29 @@ Most of the time you will not need to handle your own discovery, just use the pr By default on your class extension ``publish()`` will add all files from your ``$source`` and merge them out to your destination, overwriting on collision. +Discovery in a specific namespace +--------------------------------- + +.. versionadded:: 4.6.0 + +Since v4.6.0, you can also scan a specific namespace. This not only reduces the number of files to be scanned, +but also avoids the need to rerun a Publisher. All you need to do is specify the desired root namespace in the +second parameter of the ``discover()`` method. + +.. literalinclude:: publisher/016.php + +The specified namespace must be known to CodeIgniter. You can check the list of all namespaces using the "spark namespaces" command: + +.. code-block:: console + + php spark namespaces + +The "publish" command also offers the ``--namespace`` option to define the namespace when searching for Publishers that might come from a library. + +.. code-block:: console + + php spark publish --namespace Namespace\Vendor\Package + Security ======== diff --git a/user_guide_src/source/libraries/publisher/016.php b/user_guide_src/source/libraries/publisher/016.php new file mode 100644 index 000000000000..54f2beca5701 --- /dev/null +++ b/user_guide_src/source/libraries/publisher/016.php @@ -0,0 +1,5 @@ +