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:
@@ -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`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user