refactor: flatten src/AKSRT → src (drop theme-identifier dir)

Move all domain folders from src/AKSRT/{Domain} to src/{Domain}; remap
Composer PSR-4 "AKSRT\\": "src/"; update audit script + README + ADR
paths; remove dead tools/build-psr4-map.php (scanned deleted inc/classes).
This commit is contained in:
2026-08-02 22:06:06 +08:00
parent 56f1a8175f
commit 8c5b1555c9
285 changed files with 26 additions and 3600 deletions
+6 -9
View File
@@ -1,10 +1,10 @@
# ADR: Domain folder placement + PSR-4 namespaces for theme types
## Status
Accepted (2026-07-17); **updated 2026-07-17** for Composer PSR-4.
Accepted (2026-07-17); **updated 2026-08-02** for Composer PSR-4 root flatten to `src/`.
## Context
Domain folders were frozen after the root→domain move. Theme types then migrated from global `AKSRT_*` + manual `require_once` to real PHP namespaces under `src/AKSRT/` with Composer PSR-4.
Domain folders were frozen after the root→domain move. Theme types then migrated from global `AKSRT_*` + manual `require_once` to real PHP namespaces under `src/` with Composer PSR-4.
## Decision
@@ -31,8 +31,8 @@ Domain folders were frozen after the root→domain move. Theme types then migrat
### PSR-4 layout
- Composer: `"AKSRT\\": "src/AKSRT/"`
- Namespace `AKSRT\{Domain}\…` ↔ path `src/AKSRT/{Domain}/…`
- Composer: `"AKSRT\\": "src/"`
- Namespace `AKSRT\{Domain}\…` ↔ path `src/{Domain}/…`
- One type per file; StudlyCaps filename = short class/trait/interface name
- Nested segments: `Admin\Schema`, `Admin\Native`, `Payment\Gateways`, `Admin\Schema\PostList`
- OAuth stays under `Auth` (`AKSRT\Auth\OAuth`) — no separate `oauth/` tree
@@ -46,7 +46,7 @@ Domain folders were frozen after the root→domain move. Theme types then migrat
3. `inc/bootstrap.php` loads helpers + procedural modules (`inc/modules/*`) + core-hooks only
4. Singleton `init()` remains in `functions.php` using FQCNs
Deploy note: `vendor/` is gitignored. After pull/upload, run `composer install --no-dev --optimize-autoloader` (or at least `composer dump-autoload -o`) in the theme root so `autoload_psr4` includes `"AKSRT\\": ["…/src/AKSRT"]`.
Deploy note: `vendor/` is gitignored. After pull/upload, run `composer install --no-dev --optimize-autoloader` (or at least `composer dump-autoload -o`) in the theme root so `autoload_psr4` includes `"AKSRT\\": ["…/src"]`.
### Procedural (not PSR-4)
@@ -54,10 +54,7 @@ Deploy note: `vendor/` is gitignored. After pull/upload, run `composer install -
- `inc/modules/*` (captcha, user-hub/parts, user-notifications, widgets-register, …)
- `inc/core-hooks.php` (+ parts)
### Map tooling
- `php tools/build-psr4-map.php --write` — read-only inventory / map under `tools/psr4-map/`
- One-shot mass-rewrite migrators are **not** kept in-tree (completed migration; AV false positives on file-tree rewriters)
The one-shot `tools/build-psr4-map.php` migrator (and `tools/psr4-map/` artifacts) were removed when `inc/classes` was deleted — they scanned the old tree and cannot run anymore.
## Out of scope