refactor: centralny autoloader, Shared\Email i Shared\Security
- Utworzono autoload/autoloader.php (hybrydowy PSR-4 + legacy) - Zmigrowano 7 entry pointów do centralnego autoloadera - Dodano PSR-4 mapowanie w composer.json (Domain, Shared, Admin, Frontend) - Utworzono Shared\Email\Email (PHPMailer, migracja z Helpers) - Utworzono Shared\Security\CsrfToken (random_bytes + hash_equals) - Wrappery w Helpers delegują do nowych klas - Zaktualizowano docs/PROJECT_STRUCTURE.md - Inicjalizacja PAUL (.paul/) z roadmapą 19 faz refaktoryzacji Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
110
.paul/phases/01-infrastructure/01-01-SUMMARY.md
Normal file
110
.paul/phases/01-infrastructure/01-01-SUMMARY.md
Normal file
@@ -0,0 +1,110 @@
|
||||
---
|
||||
phase: 01-infrastructure
|
||||
plan: 01
|
||||
subsystem: infra
|
||||
tags: [autoloader, psr-4, composer]
|
||||
|
||||
requires: []
|
||||
provides:
|
||||
- Centralny hybrydowy autoloader (PSR-4 + legacy)
|
||||
- composer.json z PSR-4 mapowaniem namespace'ów
|
||||
affects: [all future phases - every new class uses this autoloader]
|
||||
|
||||
tech-stack:
|
||||
added: []
|
||||
patterns: [centralny autoloader z __DIR__, hybrydowy PSR-4 + legacy]
|
||||
|
||||
key-files:
|
||||
created: [autoload/autoloader.php]
|
||||
modified: [composer.json, index.php, admin/index.php, admin/ajax.php, ajax.php, api.php, cron.php, download.php]
|
||||
|
||||
key-decisions:
|
||||
- "Centralny autoloader zamiast duplikatów w entry pointach (ulepszenie vs shopPRO)"
|
||||
- "Savant3 special case przeniesiony do centralnego autoloadera"
|
||||
|
||||
patterns-established:
|
||||
- "Jeden autoloader dla wszystkich entry pointów — __DIR__ based paths"
|
||||
- "Hybrydowe ładowanie: legacy class.*.php → PSR-4 ClassName.php"
|
||||
|
||||
duration: ~10min
|
||||
completed: 2026-04-04
|
||||
---
|
||||
|
||||
# Phase 1 Plan 01: Infrastructure & Autoloader Summary
|
||||
|
||||
**Centralny hybrydowy autoloader (PSR-4 + legacy) zastępujący 7 zduplikowanych kopii w entry pointach.**
|
||||
|
||||
## Performance
|
||||
|
||||
| Metric | Value |
|
||||
|--------|-------|
|
||||
| Duration | ~10min |
|
||||
| Completed | 2026-04-04 |
|
||||
| Tasks | 3 completed |
|
||||
| Files modified | 8 |
|
||||
|
||||
## Acceptance Criteria Results
|
||||
|
||||
| Criterion | Status | Notes |
|
||||
|-----------|--------|-------|
|
||||
| AC-1: Centralny autoloader | Pass | autoload/autoloader.php z spl_autoload_register, __DIR__ paths |
|
||||
| AC-2: composer.json PSR-4 | Pass | Domain\, Shared\, Admin\, Frontend\ mapped |
|
||||
| AC-3: Entry pointy zmigrowane | Pass | 7 entry pointów, 0 duplikatów __autoload_my_classes |
|
||||
| AC-4: Istniejące klasy działają | Pass | Autoloader obsługuje legacy + PSR-4 format |
|
||||
|
||||
## Accomplishments
|
||||
|
||||
- Utworzono centralny `autoload/autoloader.php` z obsługą legacy (class.*.php) i PSR-4 (ClassName.php)
|
||||
- Zaktualizowano `composer.json` z PSR-4 mapowaniem dla 4 namespace'ów
|
||||
- Zmigrowano 7 entry pointów (index.php, admin/index.php, admin/ajax.php, ajax.php, api.php, cron.php, download.php)
|
||||
|
||||
## Files Created/Modified
|
||||
|
||||
| File | Change | Purpose |
|
||||
|------|--------|---------|
|
||||
| `autoload/autoloader.php` | Created | Centralny hybrydowy autoloader |
|
||||
| `composer.json` | Modified | PSR-4 mapping dla Domain\, Shared\, Admin\, Frontend\ |
|
||||
| `index.php` | Modified | require_once autoloader.php |
|
||||
| `admin/index.php` | Modified | require_once ../autoloader.php |
|
||||
| `admin/ajax.php` | Modified | require_once ../autoloader.php (Savant3 przeniesiony) |
|
||||
| `ajax.php` | Modified | require_once autoloader.php |
|
||||
| `api.php` | Modified | require_once autoloader.php |
|
||||
| `cron.php` | Modified | require_once autoloader.php |
|
||||
| `download.php` | Modified | require_once autoloader.php |
|
||||
|
||||
## Decisions Made
|
||||
|
||||
| Decision | Rationale | Impact |
|
||||
|----------|-----------|--------|
|
||||
| Centralny autoloader (vs duplikaty jak w shopPRO) | DRY, łatwiejsze utrzymanie, jednorazowa poprawka | Ulepszenie vs shopPRO — notatka dodana do shopPRO/docs |
|
||||
| Savant3 special case w centralnym autoloaderze | Był tylko w admin/ajax.php, powinien działać globalnie | Brak regresji |
|
||||
|
||||
## Deviations from Plan
|
||||
|
||||
### Summary
|
||||
|
||||
| Type | Count | Impact |
|
||||
|------|-------|--------|
|
||||
| Scope additions | 1 | Minimal — admin/ajax.php (7th entry point) |
|
||||
|
||||
Plan zakładał 6 entry pointów, ale znaleziono 7 (admin/ajax.php nie był wymieniony w planie). Zmigrowany bez problemów.
|
||||
|
||||
## Issues Encountered
|
||||
|
||||
None.
|
||||
|
||||
## Next Phase Readiness
|
||||
|
||||
**Ready:**
|
||||
- Autoloader obsługuje wszystkie namespace'y potrzebne dla faz 2-19
|
||||
- Nowe klasy w Admin\, Frontend\ będą automatycznie ładowane
|
||||
|
||||
**Concerns:**
|
||||
- AC-4 zweryfikowane statycznie (kod autoloadera) — runtime test wymaga uruchomienia aplikacji
|
||||
|
||||
**Blockers:**
|
||||
- None
|
||||
|
||||
---
|
||||
*Phase: 01-infrastructure, Plan: 01*
|
||||
*Completed: 2026-04-04*
|
||||
Reference in New Issue
Block a user