With the latest version of Lumen (5.2) the Microframework focuses on Stateless APIs.
The documentation states:
Lumen 5.2代表着Lumen在瘦身方面的一个转变,即只专注于服务无状态的JSON API.As such, sessions and views are no longer included with the framework.如果你需要访问这些功能,你应该使用完整的Laravel框架.
它比Laravel更快,每秒可以处理更多的请求.
Laravel是一个将许多组件(第三方和Laravels自己的组件)粘在一起的框架.现在Lumen使用了很多相同的组件,但将 bootstrap 过程减少到了最低限度.你可以说它是一种"不同的gulp ",其组成部分(因此许多功能)基本相同.
性能的提高是通过取消框架在配置方面的一些灵活性和改变默认 bootstrap 过程来实现的.
Besides that, more features are disabled by default and have to be activated before they can be used. As an example: Facades (like DB::table()
)
You first need to uncomment this line in bootstrap/app.php
to enable them:
// $app->withFacades();
Dotenv环境文件和Eloquent 也是如此.
对于路由,Lumen使用nikic/FastRoute而不是symfonys路由,因为它的性能要好得多,并且给微框架带来了另一个巨大的推动.
除此之外,几乎所有的事情都和拉维尔一样.
Good reads on Lumen