From ccf5e61a075c35d24befc175994b5cb8957ca322 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 26 Aug 2026 21:45:53 +0000
Subject: [PATCH] =Extra JVB() calls replaced, minor tweaks
---
inc/utility/Image.php | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/inc/utility/Image.php b/inc/utility/Image.php
index 384a699..23e2844 100644
--- a/inc/utility/Image.php
+++ b/inc/utility/Image.php
@@ -17,18 +17,14 @@
public function __construct()
{
- $this->cache = Cache::for('images')->connect('post');
- $this->imgData = Cache::for('imageData')->connect('post');
- if (JVB_TESTING) {
- $this->cache->flush();
- $this->imgData->flush();
- }
+ $this->cache = Cache::for('images', 'post');
+ $this->imgData = Cache::for('imageData', 'post');
}
public function formatImage(int $ID, string $start = 'tiny', string $replace = 'large', bool $addLink = true, ?string $postSlug = null):string
{
$return = $this->cache->remember(
- $this->cache->generateKey(['ID' => $ID, 'start' => $start, 'replace' => $replace]),
+ ['ID' => $ID, 'start' => $start, 'replace' => $replace],
function() use ($ID, $start, $replace) {
// Define size order for progressive enhancement
$sizeOrder = ['tiny', 'directory-preview', 'thumbnail', 'medium', 'large', 'full'];
@@ -188,9 +184,7 @@
public static function SVG(string $slug):string
{
$cache = Cache::for('svgs');
- if (JVB_TESTING) {
- $cache->flush();
- }
+
return $cache->remember(
$slug,
function() use ($slug) {
--
Gitblit v1.10.0