Laravel的司机是什么?例如缓存驱动程序

发布于 2025-02-06 18:42:57 字数 206 浏览 0 评论 0 原文

我正在阅读Laravel文档,但我没有得到有关驾驶员的术语。例如,我发现Laravel Cache使用以下驱动程序

  • ARRAY
  • REDIS
  • 文件
  • APC,

所以我的问题是驱动程序是什么?在Laravel的情况下,这是什么意思,为什么Laravel使用驱动程序? 需要简单的概念,以便我继续

i am reading the laravel documentation but i didnt get about the term about drivers. For example i found that laravel cache is using following drivers

  • array
  • redis
  • file
  • apc

so my question is what are drivers? What do we mean by them in case of laravel and why laravel use drivers?
Need simple concept so i can carry on

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

左耳近心 2025-02-13 18:42:57

驱动程序是接口的实现。对于缓存系统,阵列驱动程序每个请​​求中的内存阵列中的所有内容。含义在每个请求开始时,缓存将为空。

文件驱动程序实现了缓存界面,并将缓存保留在您可以在配置中指定的文件中。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文