We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 455068a commit 771948eCopy full SHA for 771948e
1 file changed
system/Cache/CacheInterface.php
@@ -13,6 +13,8 @@
13
14
namespace CodeIgniter\Cache;
15
16
+use Closure;
17
+
18
interface CacheInterface
19
{
20
/**
@@ -37,6 +39,16 @@ public function get(string $key): mixed;
37
39
* @return bool Success or failure
38
40
*/
41
public function save(string $key, mixed $value, int $ttl = 60): bool;
42
43
+ /**
44
+ * Attempts to get an item from the cache, or executes the callback
45
+ * and stores the result on cache miss.
46
+ *
47
+ * @param string $key Cache item name
48
+ * @param int $ttl Time To Live, in seconds
49
+ * @param Closure(): mixed $callback Callback executed on cache miss
50
+ */
51
+ public function remember(string $key, int $ttl, Closure $callback): mixed;
52
53
54
* Deletes a specific item from the cache store.
0 commit comments