PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.9
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.9
1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 0.8.6 All 33 releases
desktop-mode / includes / framework / app / contracts / interface-cache.php

interface-cache.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.9, at includes/framework/app/contracts/interface-cache.php

48 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OpenStation App Framework — Cache contract.
4 *
5 * A best-effort key/value cache. A miss must be indistinguishable
6 * from "never stored" — apps only ever use it to skip work they can
7 * redo, never as storage.
8 *
9 * @package OpenStation
10 */
11
12 namespace OpenStation\App\Contracts;
13
14 // Direct access, unless a standalone host is booting on bare PHP.
15 if ( ! defined( 'ABSPATH' ) ) {
16 defined( 'OPENSTATION_STANDALONE' ) || exit;
17 }
18
19 interface Cache {
20
21 /**
22 * Read a cached value.
23 *
24 * @param string $key Cache key.
25 * @param mixed $fallback Returned on a miss.
26 * @return mixed
27 */
28 public function get( $key, $fallback = null );
29
30 /**
31 * Store a value.
32 *
33 * @param string $key Cache key.
34 * @param mixed $value Any serialisable value.
35 * @param int $ttl Lifetime in seconds; 0 for "as long as the host keeps it".
36 * @return void
37 */
38 public function set( $key, $value, $ttl = 0 );
39
40 /**
41 * Forget a value.
42 *
43 * @param string $key Cache key.
44 * @return void
45 */
46 public function delete( $key );
47 }
48