Laravel的司机是什么?例如缓存驱动程序
我正在阅读Laravel文档,但我没有得到有关驾驶员的术语。例如,我发现Laravel Cache使用以下驱动程序
- ARRAY
- REDIS
- 文件
- APC,
所以我的问题是驱动程序是什么?在Laravel的情况下,这是什么意思,为什么Laravel使用驱动程序? 需要简单的概念,以便我继续
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
驱动程序是接口的实现。对于缓存系统,阵列驱动程序每个请求中的内存阵列中的所有内容。含义在每个请求开始时,缓存将为空。
文件驱动程序实现了缓存界面,并将缓存保留在您可以在配置中指定的文件中。
REDIS驱动程序实现了REDIS数据库中的缓存的缓存接口。
等等等等
。laravel中的“缓存驱动程序”是一个实现合同(接口)照明\ Contracts \ Cache \ Store 。
该应用不在乎除了打电话或投入外,还会发生什么。由驾驶员确定实际上是什么意思,取决于驾驶员。
A driver is an implementation of an interface. For the Caching system, the array driver caches everything in an in-memory array per request. Meaning at the start of each request the cache will be empty.
The file driver implements the caching interface and persists the cache in a file which you can specify in your config.
The redis driver implements the cache interface which persists the cache in a redis database.
etc.
A "cache driver" in Laravel, is a class that implements the contract (interface) Illuminate\Contracts\Cache\Store.
The app does not care what happens beyond calling get or put for example. It is up to the driver to determine what "getting" and "putting" actually means.