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 摘要。