瀏覽代碼

Update Config, use config_cache

Daniel Supernault 1 年之前
父節點
當前提交
7785a2dae4
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      app/Util/Site/Config.php

+ 7 - 1
app/Util/Site/Config.php

@@ -32,7 +32,7 @@ class Config
                 'uploader' => [
                 'uploader' => [
                     'max_photo_size' => (int) config('pixelfed.max_photo_size'),
                     'max_photo_size' => (int) config('pixelfed.max_photo_size'),
                     'max_caption_length' => (int) config_cache('pixelfed.max_caption_length'),
                     'max_caption_length' => (int) config_cache('pixelfed.max_caption_length'),
-                    'max_altext_length' => (int) config('pixelfed.max_altext_length', 150),
+                    'max_altext_length' => (int) config_cache('pixelfed.max_altext_length', 150),
                     'album_limit' => (int) config_cache('pixelfed.max_album_length'),
                     'album_limit' => (int) config_cache('pixelfed.max_album_length'),
                     'image_quality' => (int) config_cache('pixelfed.image_quality'),
                     'image_quality' => (int) config_cache('pixelfed.image_quality'),
 
 
@@ -102,6 +102,12 @@ class Config
         });
         });
     }
     }
 
 
+    public static function refresh()
+    {
+        Cache::forget(self::CACHE_KEY);
+        return self::get();
+    }
+
     public static function json()
     public static function json()
     {
     {
         return json_encode(self::get(), JSON_FORCE_OBJECT);
         return json_encode(self::get(), JSON_FORCE_OBJECT);