Skip to content

Commit 8dbef4e

Browse files
authored
Merge pull request #5718 from kenjis/fix-docs-cli-only-routes
docs: improve CLI only routing
2 parents d0cf9c8 + 7c84a30 commit 8dbef4e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

user_guide_src/source/cli/cli.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,18 @@ you with CLI-only tools.
7979
CLI-Only Routing
8080
----------------
8181

82-
In your **Routes.php** file you can create routes that are only accessible from
82+
In your **app/Config/Routes.php** file you can create routes that are only accessible from
8383
the CLI as easily as you would create any other route. Instead of using the ``get()``,
8484
``post()``, or similar method, you would use the ``cli()`` method. Everything else
8585
works exactly like a normal route definition:
8686

8787
.. literalinclude:: cli/002.php
8888
:lines: 2-
8989

90-
For more information, see the :doc:`Routes </incoming/routing>` page.
90+
For more information, see the :ref:`Routes <command-line-only-routes>` page.
91+
92+
.. warning:: If you don't disable auto-routing and place the command file in **app/Controllers**,
93+
anyone could access the command with the help of auto-routing via HTTP.
9194

9295
The CLI Library
9396
---------------

user_guide_src/source/incoming/routing.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ You can use the ``add()`` method:
335335
only routes that match the current request method are stored, resulting in fewer routes to scan through
336336
when trying to find a match.
337337

338-
Command-Line only Routes
338+
.. _command-line-only-routes:
339+
340+
Command-Line Only Routes
339341
========================
340342

341343
You can create routes that work only from the command-line, and are inaccessible from the web browser, with the
@@ -346,6 +348,9 @@ available from the command line:
346348
.. literalinclude:: routing/028.php
347349
:lines: 2-
348350

351+
.. warning:: If you don't disable auto-routing and place the command file in **app/Controllers**,
352+
anyone could access the command with the help of auto-routing via HTTP.
353+
349354
Global Options
350355
==============
351356

0 commit comments

Comments
 (0)