ver. 0.284: DbModel elimination, update packages for 0.283-0.284
- Removed class.DbModel.php — only consumer (shop\Promotion) now has inlined constructor + __get() - Created update packages: ver_0.283.zip (S→Helpers migration, ~130 files), ver_0.284.zip (DbModel removal) - Updated docs: CHANGELOG, PROJECT_STRUCTURE, FRONTEND_REFACTORING_PLAN Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,35 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze.
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.284 (2026-02-16) - DbModel elimination
|
||||
|
||||
- **DbModel** — usunięcie klasy base ORM
|
||||
- USUNIETA: `autoload/class.DbModel.php` — jedyny konsument (`shop\Promotion`) ma teraz wbudowany konstruktor + `__get()`
|
||||
- UPDATE: `autoload/shop/class.Promotion.php` — usunięto `extends DbModel` + `use DbModel`, wbudowano minimalny konstruktor z `$mdb->get()` i `__get()`
|
||||
- Testy: 454 OK, 1449 asercji
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.283 (2026-02-16) - Legacy class cleanup — S, Html, Email, Image, Log, Mobile_Detect → Shared namespace
|
||||
|
||||
- **class.S.php → Shared\Helpers\Helpers**
|
||||
- PRZENIESIONA: `class.S.php` → `autoload/Shared/Helpers/Helpers.php` (namespace `Shared\Helpers`, klasa `Helpers`)
|
||||
- ZAMIENIONE: ~140 plików — `\S::` → `\Shared\Helpers\Helpers::`
|
||||
- CLEANUP: usunięto 12 nieużywanych metod (set_array_value, parse_name, clear_redis_cache, get_domain, pre_dump, escape, chmod_r, rrmdir, rcopy, pre, json_to_array, is_empty_dir)
|
||||
- FIX: `array_cartesian_product()` — iteracja po niezdefiniowanej zmiennej `$array` zamiast parametru `$input`
|
||||
- NOWY: `tests/stubs/Helpers.php` — stub klasy Helpers dla testów
|
||||
- USUNIETA: `autoload/class.S.php`
|
||||
- **Shared\Html\Html** — `autoload/class.Html.php` → `autoload/Shared/Html/Html.php`
|
||||
- **Shared\Email\Email** — `autoload/class.Email.php` → `autoload/Shared/Email/Email.php`
|
||||
- **Shared\Image\Image** — `autoload/class.Image.php` → `autoload/Shared/Image/Image.php`
|
||||
- **Shared\Log\Log** — `autoload/class.Log.php` → `autoload/Shared/Log/Log.php`
|
||||
- **Mobile_Detect** — USUNIETA: przestarzała detekcja UA (v2.8.16), zastąpiona responsive design
|
||||
- USUNIETA: metoda `S::is_mobile()` i 3 warunki mobilne w `front\view\Site`
|
||||
- USUNIETE z `LayoutsRepository`: pola `m_html`, `m_css`, `m_js`
|
||||
- Testy: 454 OK, 1449 asercji
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.282 (2026-02-16) - Cache cleanup, Shared namespace
|
||||
|
||||
- **Shared\Cache namespace** — przeniesienie CacheHandler i RedisConnection do `Shared\Cache\`
|
||||
|
||||
@@ -78,17 +78,17 @@ Panel administratora (33 moduły) został w pełni zmigrowany na architekturę D
|
||||
### autoload/ root (klasy utility)
|
||||
| Klasa | Linii | Status |
|
||||
|-------|-------|--------|
|
||||
| S | ~1130 | htacces() ~500 linii — generowanie .htaccess; reszta to utility |
|
||||
| S | ~960 | PRZENIESIONA do Shared\Helpers\Helpers — 12 metod usunieto, bug fix |
|
||||
| Tpl | ~90 | OK — silnik szablonów, bez zmian |
|
||||
| CacheHandler | ~50 | ZMIGROWANY do `Shared\Cache\CacheHandler` — wrappery usuniete |
|
||||
| RedisConnection | ~40 | ZMIGROWANY do `Shared\Cache\RedisConnection` — wrappery usuniete |
|
||||
| Email | ~100 | OK — PHPMailer wrapper (drobne poprawki) |
|
||||
| Log | ~20 | OK — audit logging |
|
||||
| DbModel | ~60 | OK — base ORM |
|
||||
| DbModel | — | USUNIETA — logika wbudowana w `shop\Promotion` |
|
||||
| Cache | ~50 | USUNIETA — zastapiona CacheHandler (Redis) w ver. 0.282 |
|
||||
| Html | ~80 | OK — form helpers |
|
||||
| Image | ~100 | OK — GD wrapper |
|
||||
| Mobile_Detect | — | Third-party, bez zmian |
|
||||
| Mobile_Detect | — | USUNIETA — przestarzala detekcja UA, zastapiona responsive design |
|
||||
|
||||
### cms/ (1 klasa)
|
||||
| Klasa | Status |
|
||||
|
||||
@@ -27,10 +27,9 @@ Dokumentacja struktury projektu shopPRO do szybkiego odniesienia.
|
||||
- ~~`autoload/class.Cache.php`~~ — usunięta w ver. 0.282
|
||||
- Zastąpiona przez `CacheHandler` (Redis) we wszystkich wywołaniach
|
||||
|
||||
#### Klasa S (pomocnicza)
|
||||
- **Plik:** `autoload/class.S.php`
|
||||
#### Helpers (`Shared\Helpers\Helpers`)
|
||||
- **Plik:** `autoload/Shared/Helpers/Helpers.php`
|
||||
- **Metody cache:**
|
||||
- `clear_redis_cache()` - czyści cały cache Redis (flushAll)
|
||||
- `clear_product_cache(int $product_id)` - czyści cache konkretnego produktu
|
||||
|
||||
### Wzorce kluczy Redis
|
||||
@@ -105,7 +104,8 @@ shopPRO/
|
||||
│ │ └── factory/ # Fabryki/helpery
|
||||
│ ├── Domain/ # Repozytoria/logika domenowa
|
||||
│ ├── Shared/ # Wspoldzielone narzedzia
|
||||
│ │ └── Cache/ # CacheHandler, RedisConnection
|
||||
│ │ ├── Cache/ # CacheHandler, RedisConnection
|
||||
│ │ └── Helpers/ # Helpers (ex class.S.php)
|
||||
│ ├── front/ # Klasy frontendu
|
||||
│ │ ├── Controllers/ # Nowe kontrolery DI (Newsletter)
|
||||
│ │ ├── Views/ # Nowe widoki (Newsletter, Articles, Languages, Banners)
|
||||
@@ -155,13 +155,14 @@ Pelna dokumentacja tabel: `DATABASE_STRUCTURE.md`
|
||||
|
||||
## Klasy pomocnicze
|
||||
|
||||
### \S (autoload/class.S.php)
|
||||
Główna klasa helper z metodami:
|
||||
### \Shared\Helpers\Helpers (autoload/Shared/Helpers/Helpers.php)
|
||||
Główna klasa helper (przeniesiona z `class.S.php`) z metodami:
|
||||
- `seo($val)` - generowanie URL SEO
|
||||
- `normalize_decimal($val, $precision)` - normalizacja liczb
|
||||
- `send_email()` - wysyłanie emaili
|
||||
- `delete_dir($dir)` - usuwanie katalogów
|
||||
- `htacces()` - generowanie .htaccess i sitemap.xml
|
||||
- `clear_product_cache($id)` - czyszczenie cache produktu
|
||||
|
||||
### Medoo
|
||||
- Plik: `libraries/medoo/medoo.php`
|
||||
@@ -184,10 +185,7 @@ Główna klasa helper z metodami:
|
||||
$product = \shop\Product::getFromCache($product_id, $lang_id, $permutation_hash);
|
||||
|
||||
// Czyszczenie cache produktu
|
||||
\S::clear_product_cache($product_id);
|
||||
|
||||
// Czyszczenie całego cache
|
||||
\S::clear_redis_cache();
|
||||
\Shared\Helpers\Helpers::clear_product_cache($product_id);
|
||||
```
|
||||
|
||||
## Refaktoryzacja do Domain-Driven Architecture
|
||||
@@ -413,5 +411,16 @@ Pelna dokumentacja testow: `TESTING.md`
|
||||
- USUNIETA: `class.Cache.php` — legacy file-based cache.
|
||||
- UPDATE: 6 plikow przepietych z `\Cache::fetch/store` na `CacheHandler` (ShopProduct, ShopPaymentMethod, ShopCategory, ShopTransport, ShopAttribute, DictionariesRepository).
|
||||
|
||||
## Aktualizacja 2026-02-16 - class.S.php migration, Mobile_Detect removal, S cleanup
|
||||
- USUNIETA: `class.Mobile_Detect.php` — przestarzala detekcja mobilna (UA v2.8.16), zastapiona responsive design.
|
||||
- USUNIETA: metoda `S::is_mobile()` i 3 warunki mobilne w `front\view\Site` (m_html/m_css/m_js zawsze puste).
|
||||
- USUNIETE z `LayoutsRepository`: pola `m_html`, `m_css`, `m_js` (save + defaultLayout).
|
||||
- CLEANUP `class.S.php`: usunieto 12 nieuzywanych metod (set_array_value, parse_name, clear_redis_cache, get_domain, pre_dump, escape, chmod_r, rrmdir, rcopy, pre, json_to_array, is_empty_dir).
|
||||
- FIX: `array_cartesian_product()` — iteracja po niezdefiniowanej zmiennej `$array` zamiast parametru `$input`.
|
||||
- PRZENIESIONA: `class.S.php` → `Shared\Helpers\Helpers` (namespace `Shared\Helpers`, klasa `Helpers`).
|
||||
- ZAMIENIONE: ~140 plikow — `\S::` → `\Shared\Helpers\Helpers::`.
|
||||
- NOWY: `tests/stubs/Helpers.php` — stub klasy Helpers dla testow.
|
||||
- USUNIETA: `autoload/class.S.php` — zastapiona przez `Shared\Helpers\Helpers`.
|
||||
|
||||
---
|
||||
*Dokument aktualizowany: 2026-02-16*
|
||||
|
||||
@@ -18,15 +18,15 @@ Aktualizacje znajdują się w folderze `updates/0.XX/` gdzie XX oznacza dziesią
|
||||
|
||||
## Procedura tworzenia nowej aktualizacji
|
||||
|
||||
## Status biezacej aktualizacji (ver. 0.282)
|
||||
## Status biezacej aktualizacji (ver. 0.284)
|
||||
|
||||
- Wersja udostepniona: `0.282` (data: 2026-02-16).
|
||||
- Wersja udostepniona: `0.284` (data: 2026-02-16).
|
||||
- Pliki publikacyjne:
|
||||
- `updates/0.20/ver_0.281.zip`, `ver_0.281_files.txt`
|
||||
- `updates/0.20/ver_0.282.zip`, `ver_0.282_files.txt`
|
||||
- `updates/0.20/ver_0.283.zip`, `ver_0.283_files.txt`
|
||||
- `updates/0.20/ver_0.284.zip`, `ver_0.284_files.txt`
|
||||
- Pliki metadanych aktualizacji:
|
||||
- `updates/changelog.php` (dodane wpisy `ver. 0.281`, `ver. 0.282`)
|
||||
- `updates/versions.php` (`$current_ver = 282`)
|
||||
- `updates/changelog.php` (dodane wpisy `ver. 0.283`, `ver. 0.284`)
|
||||
- `updates/versions.php` (`$current_ver = 284`)
|
||||
- Weryfikacja testow przed publikacja:
|
||||
- `OK (454 tests, 1449 assertions)`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user