如何在Laravel PHP中使用控制台内核? [英] How to use Console Kernel in Laravel PHP?

查看:446
本文介绍了如何在Laravel PHP中使用控制台内核?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Laravel的标题Architecture Concepts下阅读文档.

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

我无法理解控制台内核(不是Http内核)的应用和用法. 但是,我搜索了一下,发现了这些链接

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

但是我无法使用该API理解任何内容!

But I can't understand anything with that API !

推荐答案

HTTP内核用于处理通过Web(HTTP)传入的请求.网站要求AJAX之类的东西.

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

从命令行与应用程序进行交互时,将使用控制台内核.如果您使用artisan,或者在处理计划的作业时或在处理排队的作业时,所有这些操作都将通过控制台内核.

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.

基本上,如果您通过index.php,则将使用HTTP内核.大多数其他所有内容都将使用控制台内核.

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

这篇关于如何在Laravel PHP中使用控制台内核?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆