PluginProbe
Parse.ly / 3.14.2
Parse.ly v3.14.2
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
wp-parsely / src / RemoteAPI / interface-cache.php

interface-cache.php in Parse.ly 3.14.2, at src/RemoteAPI/interface-cache.php

47 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Remote API: Cache interface
4 *
5 * @package Parsely
6 * @since 3.2.0
7 */
8
9 declare(strict_types=1);
10
11 namespace Parsely\RemoteAPI;
12
13 /**
14 * Remote API Cache Interface
15 */
16 interface Cache {
17 /**
18 * Retrieves the cache contents from the cache by key and group.
19 *
20 * @since 3.2.0
21 *
22 * @param int|string $key The key under which the cache contents are stored.
23 * @param string $group Optional. Where the cache contents are grouped. Default empty.
24 * @param bool $force Optional. Whether to force an update of the local cache
25 * from the persistent cache. Default false.
26 * @param bool $found Optional. Whether the key was found in the cache (passed by reference).
27 * Disambiguates a return of false, a storable value. Default null.
28 * @return mixed|false The cache contents on success, false on failure to retrieve contents.
29 */
30 public function get( $key, string $group = '', bool $force = false, bool $found = null );
31
32 /**
33 * Saves the data to the cache.
34 *
35 * @since 3.2.0
36 *
37 * @param int|string $key The cache key to use for retrieval later.
38 * @param mixed $data The contents to store in the cache.
39 * @param string $group Optional. Where to group the cache contents. Enables the same key
40 * to be used across groups. Default empty.
41 * @param int $expire Optional. When to expire the cache contents, in seconds.
42 * Default 0 (no expiration).
43 * @return bool True on success, false on failure.
44 */
45 public function set( $key, $data, string $group = '', int $expire = 0 ): bool;
46 }
47