PluginProbe
404 Solution / 4.3.0
404 Solution v4.3.0
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / database / DatabaseRuntimeStateInterface.php

DatabaseRuntimeStateInterface.php in 404 Solution 4.3.0, at includes/database/DatabaseRuntimeStateInterface.php

59 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 if (!defined('ABSPATH')) {
4 exit;
5 }
6
7 /**
8 * Cross-request runtime state the database layer maintains: transient-backed
9 * flags, plugin admin notices about DB issues, and the write-block status
10 * that gates non-essential writes during disk-full / read-only cooldowns.
11 */
12 interface ABJ_404_Solution_DatabaseRuntimeStateInterface {
13
14 /**
15 * Set/get runtime flags (transients with option fallback).
16 *
17 * @param string $key
18 * @param mixed $value
19 * @param int $ttlSeconds
20 * @return void
21 */
22 public function setRuntimeFlag(string $key, $value, int $ttlSeconds): void;
23
24 /**
25 * @param string $key
26 * @return mixed
27 */
28 public function getRuntimeFlag(string $key);
29
30 /**
31 * Surface a plugin-specific admin notice about a DB issue.
32 *
33 * @param string $type
34 * @param string $message
35 * @param string $guidance
36 * @param string $errorString
37 * @return void
38 */
39 public function setPluginDbNotice(string $type, string $message, string $guidance, string $errorString = ''): void;
40
41 /**
42 * Clear the plugin DB notice only when its current type matches.
43 *
44 * @param string $type
45 * @return void
46 */
47 public function clearPluginDbNoticeIfType(string $type): void;
48
49 /**
50 * @return bool True when a write-block cooldown is active (disk full or read-only).
51 */
52 public function isWriteBlockActive(): bool;
53
54 /**
55 * @return bool True when non-essential DB writes should be skipped.
56 */
57 public function shouldSkipNonEssentialDbWrites(): bool;
58 }
59