Welcome Guest, Not a member yet? Register   Sign In
CLI vs CLI
#1

Hi.
tl;dr; 4.2 RouteCollection::cli() - depracated; 5.0 RouteCollection::cli() - removed

In versions of CodeIgniter before 4, the framework did not have the ability to run console scripts bypassing the front controller and it looked like this 
php index.php controller method params

Starting from version 4, it became possible to create a cli() route, as well as run through spark.
In my opinion, the next stage of development will be to abandon the use of the cli() route and switch to only running console scripts through spark.
Now, using the cli route or spark, we load the entire core of the framework. Instead of directly accessing the class that is executed in the console, we load classes: Request - no payload, Response - meaningless for cli, filters, helpers, cache, web part routes.
What if we move the launch of console scripts to a separate core? It will only load the necessary functionality to run the script without all of the above, which is necessary for normal web routes to work.

spark --> console core  <-- base app init --> web core <--- HTTP
                      |                                                                      |
          run console script                                Request, Response, filters, routes, etc
                                                                                            |
                                                                             run web controller
Reply


Messages In This Thread
CLI vs CLI - by iRedds - 03-27-2022, 02:16 PM
RE: CLI vs CLI - by kenjis - 03-27-2022, 09:20 PM
RE: CLI vs CLI - by paulbalandan - 03-27-2022, 10:24 PM
RE: CLI vs CLI - by iRedds - 06-07-2022, 01:06 AM
RE: CLI vs CLI - by kenjis - 06-07-2022, 01:38 AM
RE: CLI vs CLI - by Jason_Holeman - 06-07-2022, 01:53 AM
RE: CLI vs CLI - by iRedds - 06-07-2022, 02:31 AM
RE: CLI vs CLI - by kenjis - 06-08-2022, 01:48 PM
RE: CLI vs CLI - by iRedds - 06-08-2022, 02:24 PM
RE: CLI vs CLI - by kenjis - 06-08-2022, 05:07 PM
RE: CLI vs CLI - by iRedds - 06-18-2022, 11:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB