ver. 0.280: Articles frontend migration, class.Article removal, Settings facade cleanup
- Add 8 frontend methods to ArticleRepository (with Redis cache) - Create front\Views\Articles (rendering + utility methods) - Rewire front\view\Site::show() and front\controls\Site::route() to repo + Views - Update 5 article templates to use \front\Views\Articles:: - Convert front\factory\Articles and front\view\Articles to facades - Remove class.Article (entity + static methods migrated to repo + Views) - Remove front\factory\Settings facade (already migrated) - Fix: eliminate global $lang from articleNoindex(), inline page sort query - Tests: 450 OK, 1431 assertions (+13 new) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,25 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze.
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.280 (2026-02-16) - Articles frontend migration
|
||||
|
||||
- **Articles (frontend)** — pelna migracja na Domain + Views
|
||||
- NOWE METODY w `ArticleRepository`: `articleDetailsFrontend()`, `articlesIds()`, `pageArticlesCount()`, `pageArticles()`, `news()`, `articleNoindex()`, `topArticles()`, `newsListArticles()`
|
||||
- NOWY: `front\Views\Articles` — czysty VIEW + utility (renderowanie, generateTableOfContents, generateHeadersIds, getImage)
|
||||
- UPDATE: `front\view\Site::show()` — przepiecie 5 sekcji na repo + Views (BOX aktualnosci, article meta, noindex, news list, top articles)
|
||||
- UPDATE: `front\controls\Site::route()` — przepiecie single article + page_type switch (4 typy) na repo + Views
|
||||
- UPDATE: 5 szablonow `templates/articles/*` — przepiecie na `\front\Views\Articles::`
|
||||
- FASADA: `front\factory\Articles` — 10 metod delegujacych do repo + Views
|
||||
- FASADA: `front\view\Articles` — 5 metod delegujacych do repo + Views
|
||||
- USUNIETA: `class.Article` — encja + metody statyczne; logika przeniesiona do `ArticleRepository` + `front\Views\Articles`
|
||||
- FIX: eliminacja `global $lang` z `articleNoindex()` — zamiana na jawny parametr `$langId`
|
||||
- FIX: eliminacja zaleznosci od `\front\factory\Pages::page_sort()` w `news()` — inline query
|
||||
- FIX: naprawione kolizje nazw zmiennych w `front\view\Site::show()` ($news_list → $news_list_matches, $top_news_matches)
|
||||
- Testy: 450 OK, 1431 asercji (+13 nowych testow w ArticleRepositoryTest)
|
||||
- UPDATE: `tests/bootstrap.php` — dodany stub `S::is_array_fix()`
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.279 (2026-02-16) - Newsletter + Languages frontend migration, front\Controllers, front\Views
|
||||
|
||||
- **Languages (view)** — migracja do nowego namespace
|
||||
|
||||
@@ -215,7 +215,38 @@ Legacy Cleanup
|
||||
|
||||
---
|
||||
|
||||
### Etap: Banners, Menu, Pages, Articles, Layouts Frontend Services
|
||||
### Etap: Articles Frontend — ZREALIZOWANY
|
||||
|
||||
**Cel:** Migracja `front\factory\Articles`, `front\view\Articles` i statycznych metod `class.Article` do Domain + Views.
|
||||
|
||||
**DODANE METODY (do istniejącej klasy `ArticleRepository`):**
|
||||
- `articleDetailsFrontend(int $articleId, string $langId): ?array` — z copy_from fallback + Redis cache
|
||||
- `articlesIds(int $pageId, string $langId, int $limit, int $sortType, int $from): ?array` — złożone SQL z language fallback + sortowanie + LIMIT + Redis cache
|
||||
- `pageArticlesCount(int $pageId, string $langId): int` — COUNT z Redis cache
|
||||
- `pageArticles(array $page, string $langId, int $bs): array` — paginacja
|
||||
- `news(int $pageId, int $limit, string $langId): ?array` — inline sort_type query (eliminacja zależności od `front\factory\Pages`)
|
||||
- `articleNoindex(int $articleId, string $langId): bool` — jawny $langId zamiast `global $lang`
|
||||
- `topArticles(int $pageId, int $limit, string $langId): ?array` — ORDER BY views DESC + Redis cache
|
||||
- `newsListArticles(int $pageId, int $limit, string $langId): ?array` — ORDER BY date_add DESC + CacheHandler (Redis) zamiast legacy `\Cache`
|
||||
|
||||
**NOWE:**
|
||||
- `front\Views\Articles` — czysty VIEW + utility:
|
||||
- Renderowanie: `fullArticle()`, `miniatureArticlesList()`, `entryArticlesList()`, `fullArticlesList()`, `news()`, `newsList()`
|
||||
- Utility: `generateTableOfContents()`, `processHeaders()`, `generateHeadersIds()`, `getImage()`
|
||||
|
||||
**ZMIANA:**
|
||||
- `front\factory\Articles` → fasada (10 metod delegujących do repo + Views)
|
||||
- `front\view\Articles` → fasada (5 metod delegujących do repo + Views)
|
||||
- `class.Article` → USUNIĘTA (encja + metody statyczne przeniesione do `ArticleRepository` + `front\Views\Articles`)
|
||||
- `front\view\Site::show()` → 5 sekcji przepiętych na repo + Views
|
||||
- `front\controls\Site::route()` → single article + page_type switch przepięte na repo + Views
|
||||
- 5 szablonów `templates/articles/*` → `\front\Views\Articles::`
|
||||
- `tests/bootstrap.php` — dodany stub `S::is_array_fix()`
|
||||
- Testy: 13 nowych w `ArticleRepositoryTest` (450 OK, 1431 asercji)
|
||||
|
||||
---
|
||||
|
||||
### Etap: Banners, Menu, Pages, Layouts Frontend Services
|
||||
|
||||
**Cel:** Migracja pozostałych fabryk "liściowych".
|
||||
|
||||
@@ -223,12 +254,11 @@ Legacy Cleanup
|
||||
- `Domain/Banner/BannerFrontendService.php` — `mainBanner()`, `banners()` (filtrowanie po datach)
|
||||
- `Domain/Menu/MenuFrontendService.php` — `menuDetails()`, `menuPages()` (rekurencja)
|
||||
- `Domain/Pages/PagesFrontendService.php` — `pageDetails()`, `mainPageId()`, `langUrl()`, `pageSort()`
|
||||
- `Domain/Article/ArticleFrontendService.php` — `articleDetails()`, `news()`, `pageArticles()`, `pageArticlesCount()`, `generateTableOfContents()`, `generateHeadersIds()`
|
||||
- `Domain/Layouts/LayoutsFrontendService.php` — `activeLayout()`, `articleLayout()`, `productLayout()`, `categoryLayout()`, `defaultLayout()`, `categoryDefaultLayout()`
|
||||
- Testy: 5 plików testowych
|
||||
- Testy: 4 pliki testowe
|
||||
|
||||
**ZMIANA:**
|
||||
- `front/factory/Banners`, `Menu`, `Pages`, `Articles`, `Layouts` → fasady
|
||||
- `front/factory/Banners`, `Menu`, `Pages`, `Layouts` → fasady
|
||||
|
||||
**BUG FIX:** `cms\Layout::__get()` — poprawka referencji do `$this->data`
|
||||
|
||||
|
||||
@@ -101,7 +101,11 @@ shopPRO/
|
||||
│ │ └── factory/ # Fabryki/helpery
|
||||
│ ├── Domain/ # Repozytoria/logika domenowa
|
||||
│ ├── front/ # Klasy frontendu
|
||||
│ │ └── factory/ # Fabryki/helpery
|
||||
│ │ ├── Controllers/ # Nowe kontrolery DI (Newsletter)
|
||||
│ │ ├── Views/ # Nowe widoki (Newsletter, Articles, Languages)
|
||||
│ │ ├── controls/ # Kontrolery legacy (Site, ShopBasket, ...)
|
||||
│ │ ├── view/ # Widoki legacy (Site, ...)
|
||||
│ │ └── factory/ # Fabryki/helpery (fasady)
|
||||
│ └── shop/ # Klasy sklepu
|
||||
├── docs/ # Dokumentacja techniczna
|
||||
├── libraries/ # Biblioteki zewnętrzne
|
||||
|
||||
@@ -36,7 +36,14 @@ Alternatywnie (Git Bash):
|
||||
Ostatnio zweryfikowano: 2026-02-16
|
||||
|
||||
```text
|
||||
OK (437 tests, 1398 assertions)
|
||||
OK (450 tests, 1431 assertions)
|
||||
```
|
||||
|
||||
Aktualizacja po migracji Articles frontend (2026-02-16, ver. 0.280):
|
||||
```text
|
||||
Pelny suite: OK (450 tests, 1431 assertions)
|
||||
Nowe testy: ArticleRepositoryTest (+13: articleDetailsFrontend, copyFromFallback, articlesIds, pageArticlesCount, pageArticlesPagination, articleNoindex, news, topArticles, newsListArticles)
|
||||
Zaktualizowane: tests/bootstrap.php (stub: S::is_array_fix)
|
||||
```
|
||||
|
||||
Aktualizacja po migracji Newsletter + Languages frontend (2026-02-16, ver. 0.279):
|
||||
|
||||
@@ -18,17 +18,17 @@ Aktualizacje znajdują się w folderze `updates/0.XX/` gdzie XX oznacza dziesią
|
||||
|
||||
## Procedura tworzenia nowej aktualizacji
|
||||
|
||||
## Status biezacej aktualizacji (ver. 0.279)
|
||||
## Status biezacej aktualizacji (ver. 0.280)
|
||||
|
||||
- Wersja udostepniona: `0.279` (data: 2026-02-16).
|
||||
- Wersja udostepniona: `0.280` (data: 2026-02-16).
|
||||
- Pliki publikacyjne:
|
||||
- `updates/0.20/ver_0.279.zip`
|
||||
- `updates/0.20/ver_0.279_files.txt`
|
||||
- `updates/0.20/ver_0.280.zip`
|
||||
- `updates/0.20/ver_0.280_files.txt`
|
||||
- Pliki metadanych aktualizacji:
|
||||
- `updates/changelog.php` (dodany wpis `ver. 0.279`)
|
||||
- `updates/versions.php` (`$current_ver = 279`)
|
||||
- `updates/changelog.php` (dodany wpis `ver. 0.280`)
|
||||
- `updates/versions.php` (`$current_ver = 280`)
|
||||
- Weryfikacja testow przed publikacja:
|
||||
- `OK (437 tests, 1398 assertions)`
|
||||
- `OK (450 tests, 1431 assertions)`
|
||||
|
||||
### 1. Określ numer wersji
|
||||
Sprawdź ostatnią wersję w `updates/` i zwiększ o 1.
|
||||
|
||||
Reference in New Issue
Block a user