ver. 0.286: Layouts, Menu, Pages frontend migration to Domain
- Add 6 frontend methods to LayoutsRepository (Redis cache, 3-level fallback) - Add 6 frontend methods to PagesRepository (Redis cache, recursive pages) - Create front\Views\Menu (clean VIEW replacing front\view\Menu) - Delete front\factory\Layouts, Menu, Pages + front\view\Menu + dead submenu.php - Fix null $lang_id TypeError in check_url_params() (remove string type hint + ?? '') - Optimize Helpers::htacces() from 3 layout calls to 1 - Tests: 470 OK, 1484 assertions (+16 new) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,10 +39,10 @@ Panel administratora (33 moduły) został w pełni zmigrowany na architekturę D
|
||||
| Newsletter | ZMIGROWANA (Domain) — usunięta | — |
|
||||
| Settings | Fasada (BUG: get_single_settings_value ignoruje $param) | NISKI |
|
||||
| Languages | USUNIĘTA — przepięta na Domain | — |
|
||||
| Layouts | Fasada | NISKI |
|
||||
| Layouts | USUNIETA — przepieta na Domain | — |
|
||||
| Banners | USUNIETA — przepieta na Domain | — |
|
||||
| Menu | Fasada | NISKI |
|
||||
| Pages | Fasada | NISKI |
|
||||
| Menu | USUNIETA — przepieta na Domain | — |
|
||||
| Pages | USUNIETA — przepieta na Domain | — |
|
||||
| ShopAttribute | Fasada | NISKI |
|
||||
| ShopCoupon | Model danych | NISKI |
|
||||
|
||||
@@ -51,7 +51,8 @@ Panel administratora (33 moduły) został w pełni zmigrowany na architekturę D
|
||||
|-------|--------|
|
||||
| Site | KRYTYCZNY — show() ~600 linii, pattern substitution engine |
|
||||
| ShopCategory | VIEW z logiką routingu (infinite scroll vs pagination) |
|
||||
| Articles, Menu, Scontainers | Czyste VIEW |
|
||||
| Articles, Scontainers | Czyste VIEW |
|
||||
| Menu | PRZENIESIONA do `front\Views\Menu` |
|
||||
| Banners | PRZENIESIONA do `front\Views\Banners` |
|
||||
| Languages, Newsletter | PRZENIESIONE do `front\Views\` (nowy namespace) |
|
||||
| ShopClient, ShopOrder, ShopPaymentMethod | Czyste VIEW |
|
||||
@@ -266,20 +267,36 @@ Legacy Cleanup
|
||||
|
||||
---
|
||||
|
||||
### Etap: Menu, Pages, Layouts Frontend Services
|
||||
### Etap: Menu, Pages, Layouts Frontend Services — ZREALIZOWANY
|
||||
|
||||
**Cel:** Migracja pozostałych fabryk "liściowych".
|
||||
|
||||
**UWAGA:** Zamiast tworzenia osobnych FrontendService, metody dodano do istniejących repozytoriów Domain (zgodnie z wzorcem projektu).
|
||||
|
||||
**DODANE METODY (do istniejących klas):**
|
||||
- `Domain/Layouts/LayoutsRepository` — `categoryDefaultLayoutId()`, `getDefaultLayout()`, `getProductLayout()`, `getArticleLayout()`, `getCategoryLayout()`, `getActiveLayout()` (Redis cache, 3-level fallback)
|
||||
- `Domain/Pages/PagesRepository` — `frontPageDetails()`, `frontPageSort()`, `frontMainPageId()`, `frontLangUrl()`, `frontMenuDetails()`, `frontMenuPages()` (Redis cache, rekurencja)
|
||||
- Testy: +8 w `LayoutsRepositoryTest`, +8 w `PagesRepositoryTest`
|
||||
|
||||
**NOWE:**
|
||||
- `Domain/Menu/MenuFrontendService.php` — `menuDetails()`, `menuPages()` (rekurencja)
|
||||
- `Domain/Pages/PagesFrontendService.php` — `pageDetails()`, `mainPageId()`, `langUrl()`, `pageSort()`
|
||||
- `Domain/Layouts/LayoutsFrontendService.php` — `activeLayout()`, `articleLayout()`, `productLayout()`, `categoryLayout()`, `defaultLayout()`, `categoryDefaultLayout()`
|
||||
- Testy: 3 pliki testowe
|
||||
- `front\Views\Menu` — czysty VIEW (`pages()`, `menu()`)
|
||||
|
||||
**ZMIANA:**
|
||||
- `front/factory/Menu`, `Pages`, `Layouts` → fasady
|
||||
- `front/factory/Layouts` → USUNIETA (logika w `LayoutsRepository`)
|
||||
- `front/factory/Menu` → USUNIETA (logika w `PagesRepository`)
|
||||
- `front/factory/Pages` → USUNIETA (logika w `PagesRepository`)
|
||||
- `front/view/Menu` → USUNIETA (zastapiona przez `front\Views\Menu`)
|
||||
- `templates/menu/submenu.php` → USUNIETA (martwy kod)
|
||||
- `front\view\Site::show()` — przepiecie na `$layoutsRepo` + `$pagesRepo`
|
||||
- `front\controls\Site::check_url_params()` — przepiecie na `$pagesRepo->frontPageDetails()`
|
||||
- `index.php` — przepiecie na `$pagesRepo->frontPageDetails()`
|
||||
- `Shared\Helpers\Helpers::htacces()` — optymalizacja 3→1 wywolan
|
||||
- Szablony `templates/menu/*` — przepiecie na `\front\Views\Menu::`
|
||||
- `templates/site/languages.php` — przepiecie na `$pagesRepo->frontLangUrl()`
|
||||
|
||||
**BUG FIX:** `cms\Layout::__get()` — poprawka referencji do `$this->data`
|
||||
**BUG FIX:** `frontPageDetails()` — null `$lang_id` przy wczesnym `check_url_params()` (usuniety string type hint + cast + `?? ''` na call site)
|
||||
|
||||
**Testy:** 470 OK, 1484 asercji
|
||||
|
||||
---
|
||||
|
||||
@@ -522,7 +539,7 @@ front\factory\ShopPromotion::promotion_type_XX() → shop\Product::is_product_on
|
||||
|------|--------|-----------|-------------------|-------|
|
||||
| Settings + Languages | Fundamenty | FUNDAMENT | 2 serwisy | 2 |
|
||||
| Category Frontend | Kategorie | WYSOKI | 1 serwis | 1 |
|
||||
| Banners/Menu/Pages/Articles/Layouts | Treści | ŚREDNI | 5 serwisów | 5 |
|
||||
| ~~Banners/Menu/Pages/Articles/Layouts~~ | ~~Treści~~ | ZREALIZOWANY | — | — |
|
||||
| Promotion Engine | Promocje | KRYTYCZNY | 1 serwis | 1 |
|
||||
| Product Frontend | Produkty | KRYTYCZNY | 1 serwis | 1 |
|
||||
| Client/Auth (security fix) | Klienci | KRYTYCZNY | 1 serwis | 1 |
|
||||
|
||||
Reference in New Issue
Block a user