diff --git a/admin/templates/dashboard/main-view.php b/admin/templates/dashboard/main-view.php index 7633484..c99e58d 100644 --- a/admin/templates/dashboard/main-view.php +++ b/admin/templates/dashboard/main-view.php @@ -76,6 +76,9 @@ $min = (int) $this -> sales_grid[$j][$i]; } } + + if ( $max == 0 ) + $max = 1; ?>
diff --git a/autoload/class.RedisConnection.php b/autoload/class.RedisConnection.php index 00b3267..e4cbfa9 100644 --- a/autoload/class.RedisConnection.php +++ b/autoload/class.RedisConnection.php @@ -1,4 +1,4 @@ -redis->connect($config['redis']['host'], $config['redis']['port'])) { - // Logowanie błędu lub inna forma obsługi, zamiast rzucania wyjątku + // Logowanie błędu bez rzucania wyjątku error_log("Nie udało się połączyć z serwerem Redis."); - $this->redis = null; // Ustawienie na null, aby uniknąć błędów w przyszłości - return; // Wyjście z konstruktora, nie kontynuując autoryzacji + $this->redis = null; + return; } // Próba autoryzacji if (!$this->redis->auth($config['redis']['password'])) { error_log("Autoryzacja do serwera Redis nie powiodła się."); - $this->redis = null; // Ustawienie na null, aby uniknąć błędów w przyszłości - return; // Wyjście z konstruktora + $this->redis = null; + return; } } catch (\Exception $e) { - // Obsługa innych potencjalnych wyjątków + // Obsługa wyjątków, bez rzucania błędu error_log("Błąd podczas połączenia z Redis: " . $e->getMessage()); - $this->redis = null; // Ustawienie na null, aby uniknąć błędów w przyszłości + $this->redis = null; } } - public static function getInstance() { if (self::$instance === null) @@ -51,4 +50,4 @@ class RedisConnection { return $this->redis; } -} +} \ No newline at end of file diff --git a/autoload/shop/class.Product.php b/autoload/shop/class.Product.php index b7700df..0a10bba 100644 --- a/autoload/shop/class.Product.php +++ b/autoload/shop/class.Product.php @@ -123,7 +123,7 @@ class Product implements \ArrayAccess $redis = \RedisConnection::getInstance()->getConnection(); // Check if Redis connection is valid - if ($redis) + if ( $redis ) { // Try to retrieve the serialized product object from cache $objectData = $redis->get("shop\product:$product_id:$lang_id:$permutation_hash"); diff --git a/config.php b/config.php index 58007f2..f3e9f2f 100644 --- a/config.php +++ b/config.php @@ -10,9 +10,9 @@ $config['salt'] = 'dd6c0ee59bf35b208b6d9bf42dd60769'; $config['google-ads-id'] = 'AW-810084545'; $config['baselinker-start'] = '2031-06-09 21:26'; -$config['redis']['host'] = ''; -$config['redis']['port'] = 0; -$config['redis']['password'] = ''; +$config['redis']['host'] = '127.0.0.1'; +$config['redis']['port'] = 44090; +$config['redis']['password'] = 'KvCb8A3OJl3JhML1IuD51tD6q9d3TJLu'; $config['debug']['apilo'] = false; ?>