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