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:
@@ -4,6 +4,30 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze.
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.286 (2026-02-17) - Layouts, Menu, Pages frontend migration
|
||||
|
||||
- **Layouts (frontend)** — migracja na Domain
|
||||
- NOWE METODY w `LayoutsRepository`: `categoryDefaultLayoutId()`, `getDefaultLayout()`, `getProductLayout()`, `getArticleLayout()`, `getCategoryLayout()`, `getActiveLayout()` — z Redis cache, 3-level fallback (product→category→default)
|
||||
- USUNIETA: `front\factory\class.Layouts.php` — logika przeniesiona do `LayoutsRepository`
|
||||
- UPDATE: `front\view\Site::show()` — przepiecie na `$layoutsRepo`
|
||||
- UPDATE: `Shared\Helpers\Helpers::htacces()` — optymalizacja z 3 wywolan `category_default_layout()` do jednej zmiennej
|
||||
- **Menu + Pages (frontend)** — migracja na Domain + Views
|
||||
- NOWE METODY w `PagesRepository`: `frontPageDetails()`, `frontPageSort()`, `frontMainPageId()`, `frontLangUrl()`, `frontMenuDetails()`, `frontMenuPages()` — z Redis cache, rekurencja stron
|
||||
- NOWY: `front\Views\Menu` — czysty VIEW (`pages()`, `menu()`)
|
||||
- USUNIETA: `front\factory\class.Menu.php` — logika przeniesiona do `PagesRepository`
|
||||
- USUNIETA: `front\factory\class.Pages.php` — logika przeniesiona do `PagesRepository`
|
||||
- USUNIETA: `front\view\class.Menu.php` — zastapiona przez `front\Views\Menu`
|
||||
- USUNIETA: `templates\menu\submenu.php` — martwy kod (wola nieistniejaca metode `Menu::submenu()`)
|
||||
- UPDATE: `front\controls\Site::check_url_params()` — przepiecie na `$pagesRepo->frontPageDetails()`
|
||||
- UPDATE: `index.php` — przepiecie na `$pagesRepo->frontPageDetails()`
|
||||
- UPDATE: `templates/site/languages.php` — przepiecie na `$pagesRepo->frontLangUrl()`
|
||||
- UPDATE: `templates/menu/menu.php`, `pages.php`, `main-menu.php` — przepiecie na `\front\Views\Menu::`
|
||||
- FIX: `frontPageDetails()` — usuniety type hint `string` z `$langId` + cast `(string)` (null $lang_id przy wczesnym wywolaniu `check_url_params()`)
|
||||
- FIX: `front\controls\class.Site.php` — dodano `$lang_id ?? ''` przy przekazywaniu do `frontPageDetails()`
|
||||
- Testy: 470 OK, 1484 asercji (+16 testow: 8 LayoutsRepository frontend, 8 PagesRepository frontend)
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.285 (2026-02-17) - Tpl namespace, CurlServer removal, thumb.php fix
|
||||
|
||||
- **Shared\Tpl\Tpl** — migracja silnika szablonow do namespace Shared
|
||||
@@ -653,4 +677,4 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze.
|
||||
- Metoda `clear_product_cache()` w klasie S
|
||||
|
||||
---
|
||||
*Dokument aktualizowany: 2026-02-14*
|
||||
*Dokument aktualizowany: 2026-02-17*
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -109,7 +109,7 @@ shopPRO/
|
||||
│ │ └── Tpl/ # Tpl (silnik szablonow)
|
||||
│ ├── front/ # Klasy frontendu
|
||||
│ │ ├── Controllers/ # Nowe kontrolery DI (Newsletter)
|
||||
│ │ ├── Views/ # Nowe widoki (Newsletter, Articles, Languages, Banners)
|
||||
│ │ ├── Views/ # Nowe widoki (Newsletter, Articles, Languages, Banners, Menu)
|
||||
│ │ ├── controls/ # Kontrolery legacy (Site, ShopBasket, ...)
|
||||
│ │ ├── view/ # Widoki legacy (Site, ...)
|
||||
│ │ └── factory/ # Fabryki/helpery (fasady)
|
||||
@@ -243,7 +243,7 @@ autoload/
|
||||
│ └── view/ # Widoki (statyczne - bez zmian)
|
||||
├── front/
|
||||
│ ├── Controllers/ # Nowe kontrolery frontendowe (namespace \front\Controllers\) z DI
|
||||
│ ├── Views/ # Nowe widoki (namespace \front\Views\) — czyste VIEW, statyczne
|
||||
│ ├── Views/ # Nowe widoki (namespace \front\Views\) — czyste VIEW, statyczne (Menu, Newsletter, Articles, Languages, Banners)
|
||||
│ ├── controls/ # Legacy kontrolery (fallback)
|
||||
│ ├── factory/ # Legacy helpery (stopniowo migrowane)
|
||||
│ └── view/ # Legacy widoki
|
||||
@@ -423,6 +423,16 @@ Pelna dokumentacja testow: `TESTING.md`
|
||||
- NOWY: `tests/stubs/Helpers.php` — stub klasy Helpers dla testow.
|
||||
- USUNIETA: `autoload/class.S.php` — zastapiona przez `Shared\Helpers\Helpers`.
|
||||
|
||||
## Aktualizacja 2026-02-17 (ver. 0.286) - Layouts, Menu, Pages frontend migration
|
||||
- NOWE METODY w `Domain/Layouts/LayoutsRepository.php`: `categoryDefaultLayoutId()`, `getDefaultLayout()`, `getProductLayout()`, `getArticleLayout()`, `getCategoryLayout()`, `getActiveLayout()`.
|
||||
- NOWE METODY w `Domain/Pages/PagesRepository.php`: `frontPageDetails()`, `frontPageSort()`, `frontMainPageId()`, `frontLangUrl()`, `frontMenuDetails()`, `frontMenuPages()`.
|
||||
- NOWY: `front\Views\Menu` — czysty VIEW (`pages()`, `menu()`).
|
||||
- USUNIETA: `front\factory\class.Layouts.php` — logika przeniesiona do `LayoutsRepository`.
|
||||
- USUNIETA: `front\factory\class.Menu.php` — logika przeniesiona do `PagesRepository`.
|
||||
- USUNIETA: `front\factory\class.Pages.php` — logika przeniesiona do `PagesRepository`.
|
||||
- USUNIETA: `front\view\class.Menu.php` — zastapiona przez `front\Views\Menu`.
|
||||
- USUNIETA: `templates\menu\submenu.php` — martwy kod.
|
||||
|
||||
## Aktualizacja 2026-02-17 - Tpl namespace, CurlServer removal, thumb.php fix
|
||||
- NOWY: `autoload/Shared/Tpl/Tpl.php` — silnik szablonow w namespace `Shared\Tpl`.
|
||||
- USUNIETA: `autoload/class.Tpl.php` — zastapiona przez `Shared\Tpl\Tpl`.
|
||||
@@ -432,4 +442,4 @@ Pelna dokumentacja testow: `TESTING.md`
|
||||
- FIX: `Tpl::render()` branch 3 — sprawdzal `../templates_user/` ale ladowal `../templates/`.
|
||||
|
||||
---
|
||||
*Dokument aktualizowany: 2026-02-17*
|
||||
*Dokument aktualizowany: 2026-02-17 (ver. 0.286)*
|
||||
|
||||
@@ -33,10 +33,17 @@ Alternatywnie (Git Bash):
|
||||
|
||||
## Aktualny stan suite
|
||||
|
||||
Ostatnio zweryfikowano: 2026-02-16
|
||||
Ostatnio zweryfikowano: 2026-02-17
|
||||
|
||||
```text
|
||||
OK (454 tests, 1449 assertions)
|
||||
OK (470 tests, 1484 assertions)
|
||||
```
|
||||
|
||||
Aktualizacja po migracji Layouts + Menu/Pages frontend (2026-02-17, ver. 0.286):
|
||||
```text
|
||||
Pelny suite: OK (470 tests, 1484 assertions)
|
||||
Nowe testy: LayoutsRepositoryTest (+8: categoryDefaultLayoutId, getDefaultLayout, getProductLayout fallback, getArticleLayout, getCategoryLayout fallback, getActiveLayout, getActiveLayout fallback, getActiveLayout null)
|
||||
Nowe testy: PagesRepositoryTest (+8: frontPageDetails, frontPageDetailsNull, frontMainPageId, frontMainPageIdFallback, frontPageSort, frontMenuDetails, frontMenuDetailsNull, frontMenuPages)
|
||||
```
|
||||
|
||||
Aktualizacja po migracji Banners frontend (2026-02-16, ver. 0.281):
|
||||
@@ -505,3 +512,14 @@ OK (351 tests, 1091 assertions)
|
||||
Nowe testy dodane 2026-02-15:
|
||||
- `tests/Unit/Domain/Product/ProductRepositoryTest.php` (rozszerzenie: `allProductsForMassEdit`, `getProductsByCategory`, `applyDiscountPercent`)
|
||||
- `tests/Unit/admin/Controllers/ShopProductControllerTest.php` (7 testow: kontrakty metod, return types, DI konstruktora)
|
||||
|
||||
## Aktualizacja suite (Layouts + Menu/Pages frontend, ver. 0.286)
|
||||
Ostatnio zweryfikowano: 2026-02-17
|
||||
|
||||
```text
|
||||
OK (470 tests, 1484 assertions)
|
||||
```
|
||||
|
||||
Nowe testy dodane 2026-02-17:
|
||||
- `tests/Unit/Domain/Layouts/LayoutsRepositoryTest.php` (rozszerzenie: +8 testow frontend: categoryDefaultLayoutId, getDefaultLayout, getProductLayout, getArticleLayout, getCategoryLayout, getActiveLayout)
|
||||
- `tests/Unit/Domain/Pages/PagesRepositoryTest.php` (rozszerzenie: +8 testow frontend: frontPageDetails, frontMainPageId, frontPageSort, frontLangUrl, frontMenuDetails, frontMenuPages)
|
||||
|
||||
@@ -18,16 +18,16 @@ Aktualizacje znajdują się w folderze `updates/0.XX/` gdzie XX oznacza dziesią
|
||||
|
||||
## Procedura tworzenia nowej aktualizacji
|
||||
|
||||
## Status biezacej aktualizacji (ver. 0.285)
|
||||
## Status biezacej aktualizacji (ver. 0.286)
|
||||
|
||||
- Wersja udostepniona: `0.285` (data: 2026-02-17).
|
||||
- Wersja udostepniona: `0.286` (data: 2026-02-17).
|
||||
- Pliki publikacyjne:
|
||||
- `updates/0.20/ver_0.285.zip`, `ver_0.285_files.txt`
|
||||
- `updates/0.20/ver_0.286.zip`, `ver_0.286_files.txt`
|
||||
- Pliki metadanych aktualizacji:
|
||||
- `updates/changelog.php` (dodany wpis `ver. 0.285`)
|
||||
- `updates/versions.php` (`$current_ver = 285`)
|
||||
- `updates/changelog.php` (dodany wpis `ver. 0.286`)
|
||||
- `updates/versions.php` (`$current_ver = 286`)
|
||||
- Weryfikacja testow przed publikacja:
|
||||
- `OK (454 tests, 1449 assertions)`
|
||||
- `OK (470 tests, 1484 assertions)`
|
||||
|
||||
### 1. Określ numer wersji
|
||||
Sprawdź ostatnią wersję w `updates/` i zwiększ o 1.
|
||||
|
||||
Reference in New Issue
Block a user