Repository navigation
Commit 4163f69
authored
Support
## Summary
Add **`DB_PATH`** as the primary SQLite database setting for database
connections, schema installation, Site Health, and storage lock
placement. It cannot be combined with `DB_DIR`, `DB_FILE`, `FQDBDIR`, or
`FQDB`.
**Legacy settings remain supported when `DB_PATH` is absent**, but
database paths and storage directories must be absolute. Storage under a
secret randomized path remains the default. The drop-in then defines
`DB_PATH` with the resolved path. Invalid values fail explicitly without
falling back to another database.
`WP_SQLite_Storage` now exposes `with_secret_path( $root )` and
`with_explicit_path( $path )`, with a private constructor. Callers
resolve the configuration before creating storage.
In-memory databases (`:memory:`) require no filesystem storage or
locking.
## Why
A single full-path setting makes the active database easier to configure
and identify. The older path constants are deprecated in PHPDoc while
their behavior remains available for backward compatibility.
Builds on #502.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Configure SQLite with an absolute `DB_PATH` or `:memory:`. When
`DB_PATH` is not set, SQLite continues to use the default or legacy
database path.
* Legacy database settings are deprecated and cannot be combined with
`DB_PATH`.
* **Bug Fixes**
* Invalid database paths are rejected rather than silently falling back
to a legacy location.
* Site-health reporting now reflects the selected database path and its
size.
* In-memory databases no longer require filesystem locking.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->DB_PATH as the primary database path constant (#512)1 parent a8468b5 commit 4163f69
7 files changed
Lines changed: 898 additions & 134 deletions
File tree
- packages/plugin-sqlite-database-integration
- wp-includes/sqlite
- tests/phpunit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
21 | 56 | | |
22 | 57 | | |
23 | 58 | | |
24 | 59 | | |
25 | | - | |
| 60 | + | |
26 | 61 | | |
27 | | - | |
| 62 | + | |
28 | 63 | | |
29 | 64 | | |
30 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
31 | 68 | | |
32 | 69 | | |
33 | 70 | | |
| |||
39 | 76 | | |
40 | 77 | | |
41 | 78 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 79 | + | |
| 80 | + | |
45 | 81 | | |
46 | | - | |
| 82 | + | |
47 | 83 | | |
48 | | - | |
49 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
50 | 91 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
109 | 130 | | |
110 | | - | |
111 | | - | |
| 131 | + | |
| 132 | + | |
112 | 133 | | |
113 | 134 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
117 | 143 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
123 | 151 | | |
124 | 152 | | |
125 | 153 | | |
126 | 154 | | |
127 | 155 | | |
128 | 156 | | |
129 | | - | |
| 157 | + | |
130 | 158 | | |
131 | 159 | | |
132 | 160 | | |
| |||
153 | 181 | | |
154 | 182 | | |
155 | 183 | | |
156 | | - | |
| 184 | + | |
157 | 185 | | |
158 | 186 | | |
159 | 187 | | |
160 | 188 | | |
161 | 189 | | |
162 | | - | |
| 190 | + | |
163 | 191 | | |
164 | 192 | | |
165 | 193 | | |
| |||
210 | 238 | | |
211 | 239 | | |
212 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
213 | 246 | | |
214 | 247 | | |
215 | 248 | | |
| |||
245 | 278 | | |
246 | 279 | | |
247 | 280 | | |
248 | | - | |
| 281 | + | |
249 | 282 | | |
250 | 283 | | |
251 | 284 | | |
| |||
282 | 315 | | |
283 | 316 | | |
284 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
285 | 358 | | |
286 | 359 | | |
287 | 360 | | |
| |||
373 | 446 | | |
374 | 447 | | |
375 | 448 | | |
376 | | - | |
| 449 | + | |
377 | 450 | | |
378 | 451 | | |
379 | 452 | | |
| |||
0 commit comments