PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.8
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.8
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-store.php

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

51 lines 1.2 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 — Store contract.
4 *
5 * Durable key/value storage an app may write: per acting user
6 * (`user` scope) or site-wide (`site` scope). The host decides where
7 * it lives — user meta and options on WordPress, files or a table on
8 * a bare PHP host. Keys arrive already namespaced by the app.
9 *
10 * @package OpenStation
11 */
12
13 namespace OpenStation\App\Contracts;
14
15 // Direct access, unless a standalone host is booting on bare PHP.
16 if ( ! defined( 'ABSPATH' ) ) {
17 defined( 'OPENSTATION_STANDALONE' ) || exit;
18 }
19
20 interface Store {
21
22 /**
23 * Read a stored value.
24 *
25 * @param string $scope `user` | `site`.
26 * @param string $key Key.
27 * @param mixed $fallback Returned when unset.
28 * @return mixed
29 */
30 public function get( $scope, $key, $fallback = null );
31
32 /**
33 * Write a value.
34 *
35 * @param string $scope `user` | `site`.
36 * @param string $key Key.
37 * @param mixed $value Serialisable value.
38 * @return void
39 */
40 public function set( $scope, $key, $value );
41
42 /**
43 * Remove a value.
44 *
45 * @param string $scope `user` | `site`.
46 * @param string $key Key.
47 * @return void
48 */
49 public function delete( $scope, $key );
50 }
51