Commit ff36738
authored
Add a hook for native MySQL lexer and parser implementations (#384)
## Summary
Add a small entry point in `load.php` so an optional native (e.g. Rust)
MySQL lexer/parser extension can plug itself in as `WP_MySQL_Lexer` /
`WP_MySQL_Parser`. The extension pre-declares `WP_MySQL_Native_Lexer` /
`WP_MySQL_Native_Parser` before this file loads; otherwise the existing
pure-PHP classes ship as the implementation, unchanged.
The existing PHP files keep their original names, locations, and class
names — no rename, no polyfill scaffolding. Native shims live in a
separate `mysql/native/` directory and are only required when the native
classes are present.
## Testing
- `php -l` on changed files
- Smoke: `WP_MySQL_Lexer` and `WP_MySQL_Parser` instantiate and parse
`SELECT 1` end-to-end with no native extension loaded
- `phpcs` clean1 parent 2622441 commit ff36738
3 files changed
Lines changed: 24 additions & 2 deletions
File tree
- packages/mysql-on-sqlite/src
- mysql/native
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
17 | 33 | | |
18 | 34 | | |
19 | 35 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments