PluginProbe
404 Solution / 4.3.3
404 Solution v4.3.3
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 / DatabaseErrorRecoveryInterface.php

DatabaseErrorRecoveryInterface.php in 404 Solution 4.3.3, at includes/database/DatabaseErrorRecoveryInterface.php

65 lines 1.9 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 * Error classification + self-healing recovery: classify infrastructure
9 * errors, detect OOM, REPAIR TABLE for crashed tables, fix duplicate
10 * auto_increment IDs, recover from collation mismatches, and the test seam
11 * for the injected clock.
12 *
13 * Legacy view-build staged-failure routing (the 'resumable'/'skip'/'halt'
14 * /'rethrow' classifier) intentionally lives outside this database-layer
15 * interface: those tokens are not database recovery vocabulary.
16 */
17 interface ABJ_404_Solution_DatabaseErrorRecoveryInterface {
18
19 /**
20 * Classify an error as infrastructure (server-side) and handle it.
21 *
22 * @param string $errorText
23 * @return bool True if handled as infrastructure error.
24 */
25 public function classifyAndHandleInfrastructureError(string $errorText): bool;
26
27 /**
28 * @param string $errorText
29 * @return bool
30 */
31 public function isOutOfMemoryError(string $errorText): bool;
32
33 /**
34 * Attempt REPAIR TABLE for crashed or corrupted-key-file tables.
35 *
36 * @param string $errorMessage The MySQL error string.
37 * @return void
38 */
39 public function repairTable(string $errorMessage): void;
40
41 /**
42 * Attempt to fix duplicate auto_increment IDs caused by ALTER TABLE resequencing.
43 *
44 * @param string $errorMessage The MySQL error string.
45 * @param string $sqlThatWasRun The SQL that triggered the error.
46 * @return void
47 */
48 public function repairDuplicateIDs(string $errorMessage, string $sqlThatWasRun): void;
49
50 /**
51 * Schedule schema-wide collation recovery outside the foreground request.
52 *
53 * @return void
54 */
55 public function scheduleCollationRecovery(): void;
56
57 /**
58 * Inject the clock instance for testability.
59 *
60 * @param ABJ_404_Solution_Clock $clock
61 * @return void
62 */
63 public function setClock(ABJ_404_Solution_Clock $clock): void;
64 }
65