| 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 |
|