How to use Console Kernel in Laravel PHP?

2020-07-11 09:59发布

I am reading the documentation at Laravel under the heading Architecture Concepts.

I am unable to understand application and usage of Console Kernel .(not the Http Kernel) However, I googled out and found these links

https://laravel.com/api/5.2/Illuminate/Foundation/Console/Kernel.html https://laravel.com/api/5.3/Illuminate/Contracts/Console/Kernel.html

But I can't understand anything with that API !

1条回答
老娘就宠你
2楼-- · 2020-07-11 10:19

The HTTP Kernel is used to process requests that come in through the web (HTTP). Website requests, AJAX, that kind of stuff.

The Console Kernel is used when you interact with your application from the command line. If you use artisan, or when a scheduled job is processed, or when a queued job is processed, all of these actions go through the Console Kernel.

Basically, if you go through index.php, you'll be using the HTTP Kernel. Most everything else will be using the Console Kernel.

查看更多
登录 后发表回答