File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1313
1414namespace CodeIgniter \Cache ;
1515
16+ use Closure ;
17+
1618interface CacheInterface
1719{
1820 /**
@@ -37,6 +39,16 @@ public function get(string $key): mixed;
3739 * @return bool Success or failure
3840 */
3941 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 ;
4052
4153 /**
4254 * Deletes a specific item from the cache store.
You can’t perform that action at this time.
0 commit comments