ver. 0.282: Banners frontend migration, Cache cleanup, Shared\Cache namespace

- Banners frontend: front\Views\Banners (new), BannerRepository +2 frontend methods,
  front\view\Site przepięty, usunięte front\factory\Banners i front\view\Banners
- Cache cleanup: eliminacja legacy class.Cache.php (file-based cache),
  13 metod front\factory przepiętych z \Cache::fetch/store na CacheHandler
- Shared\Cache namespace: CacheHandler i RedisConnection przeniesione do Shared\Cache\,
  60 odwołań CacheHandler i 12 odwołań RedisConnection przepiętych,
  usunięte backward-compat wrappery class.CacheHandler.php i class.RedisConnection.php
- Naprawione rozbieżności kluczy cache (random_products, category_name)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 21:25:50 +01:00
parent fb81c54e06
commit 285cbe5515
54 changed files with 594 additions and 346 deletions

View File

@@ -13,7 +13,7 @@ class ShopTransport
{
global $mdb, $settings;
$cacheHandler = new \CacheHandler();
$cacheHandler = new \Shared\Cache\CacheHandler();
$cacheKey = "\front\factory\ShopTransport::transport_methods";
$objectData = $cacheHandler -> get( $cacheKey );
@@ -57,12 +57,20 @@ class ShopTransport
{
global $mdb;
if ( !$cost = \Cache::fetch( 'transport_cost_' . $transport_id ) )
$cacheHandler = new \Shared\Cache\CacheHandler();
$cacheKey = 'transport_cost_' . $transport_id;
$objectData = $cacheHandler->get( $cacheKey );
if ( !$objectData )
{
$repo = new \Domain\Transport\TransportRepository($mdb);
$cost = $repo->getTransportCost($transport_id);
\Cache::store( 'transport_cost_' . $transport_id, $cost );
$cacheHandler->set( $cacheKey, $cost );
}
else
{
return unserialize( $objectData );
}
return $cost;
}
@@ -71,12 +79,20 @@ class ShopTransport
{
global $mdb;
if ( !$transport = \Cache::fetch( 'transport' . $transport_id ) )
$cacheHandler = new \Shared\Cache\CacheHandler();
$cacheKey = 'transport' . $transport_id;
$objectData = $cacheHandler->get( $cacheKey );
if ( !$objectData )
{
$repo = new \Domain\Transport\TransportRepository($mdb);
$transport = $repo->findActiveById($transport_id);
\Cache::store( 'transport' . $transport_id, $transport );
$cacheHandler->set( $cacheKey, $transport );
}
else
{
return unserialize( $objectData );
}
return $transport;
}