Cache contracts: numeric keys in getMultiple() and a TTL of zero or less

未关闭 适合新手
#187 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
php
领域
documentation

调研方向

先阅读 v3.0/packages/cache/contracts.md 的批量方法部分和 v3.0/packages/cache/adapters.md 的 Memcached 部分,然后对照 3.2.x 代码检查每项说法:getMultiple() 的实现以及内置适配器的 TTL 处理(参见 #691 和 #692)。编写 issue 指定的三句话,记住数组键行为来自 PHP 本身,并提交到 staging 分支而不是已发布的文档。完成意味着 contracts.md 涵盖 getMultiple() 结果中的整数键以及 TTL 为零或已过期时的移除规则,并且 adapters.md 说明超过 30 天的 TTL 在 Memcached 上可用。

由索引模型根据 Issue 内容生成。

描述

documentation

Summary

Two cache behaviours from framework 3.2.0 are not described in v3.0/packages/cache/contracts.md yet.

Changes

  1. Batch contract: numeric keys in the result of getMultiple(). The page says the batch methods "turn integer keys back into strings, so numeric keys work as expected". It does not say that the array getMultiple() returns has them as integer keys again: getMultiple(['42']) returns [42 => …], because PHP turns a numeric string array key into an integer. Add one sentence, so code that reads the keys does not expect strings.
  2. TTL contract: a TTL of zero or less. Add that a TTL of 0 or less, and a DateInterval in the past, removes the item, as PSR-16 requires, in every built-in adapter. Memcached kept such an item until 3.2.0 (quantum-php/framework#692).
  3. Memcached adapter (v3.0/packages/cache/adapters.md): one sentence that a TTL of more than 30 days works; before 3.2.0, Memcached read it as a Unix timestamp and the item expired at once (quantum-php/framework#692).

Every statement is checked against the 3.2.x code. The changes wait in staging until 3.2.0 is released.

Related

  • quantum-php/framework#691 (the getMultiple() return type), #692 (Memcached TTL)
主要语言
没有语言数据
星标
3
派生
1
平均合并
2 分钟
30 天内合并 PR
27

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quantum-php/docs 的其他 Issue

查看 quantum-php/docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。