]> _ Git - cubist_util.git/commitdiff
#7684
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Aug 2025 16:09:08 +0000 (18:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Aug 2025 16:09:08 +0000 (18:09 +0200)
src/Graphics/Image.php

index d60c7455d54edda3ff4f2c484037dc675d1614c6..14fe7f031e7c64a29a2c458b81375ef56d2fe273 100644 (file)
@@ -7,7 +7,6 @@ use Cubist\Util\Animations\OAMAnimation;
 use Cubist\Util\Animations\ZipAnimation;
 use Cubist\Util\Files\Files;
 use Cubist\Util\Text;
-use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\Log;
 
 class Image
@@ -40,12 +39,17 @@ class Image
             return self::$_imagesizeCache[$cacheKey];
         }
 
-        $res = Cache::rememberForever($cacheKey, function () use ($ext, $path) {
-            return self::_getimagesize($path, $ext);
-        });
-        if (!$res) {
-            Cache::forget($cacheKey);
-        } else {
+        if(function_exists('cache')) {
+            $res = cache()->rememberForever($cacheKey, function () use ($ext, $path) {
+                return self::_getimagesize($path, $ext);
+            });
+            if (!$res) {
+                cache()->forget($cacheKey);
+            } else {
+                self::$_imagesizeCache[$cacheKey] = $res;
+            }
+        }else{
+            $res= self::_getimagesize($path, $ext);
             self::$_imagesizeCache[$cacheKey] = $res;
         }
         return $res;