浏览代码

Update config() to config_cache()

Daniel Supernault 4 年之前
父节点
当前提交
41792eea56

+ 1 - 1
app/Http/Controllers/ComposeController.php

@@ -646,7 +646,7 @@ class ComposeController extends Controller
 			case 'image/jpeg':
 			case 'image/jpeg':
 			case 'image/png':
 			case 'image/png':
 			case 'video/mp4':
 			case 'video/mp4':
-				$finished = config('pixelfed.cloud_storage') ? (bool) $media->cdn_url : (bool) $media->processed_at;
+				$finished = config_cache('pixelfed.cloud_storage') ? (bool) $media->cdn_url : (bool) $media->processed_at;
 				break;
 				break;
 
 
 			default:
 			default:

+ 3 - 3
app/Jobs/AvatarPipeline/RemoteAvatarFetch.php

@@ -51,7 +51,7 @@ class RemoteAvatarFetch implements ShouldQueue
 	{
 	{
 		$profile = $this->profile;
 		$profile = $this->profile;
 
 
-		if(config('pixelfed.cloud_storage') !== true) {
+		if(config_cache('pixelfed.cloud_storage') !== true) {
 			return 1;
 			return 1;
 		}
 		}
 
 
@@ -75,7 +75,7 @@ class RemoteAvatarFetch implements ShouldQueue
 			return 1;
 			return 1;
 		}
 		}
 
 
-		if( !isset($person['icon']) || 
+		if( !isset($person['icon']) ||
 			!isset($person['icon']['type']) ||
 			!isset($person['icon']['type']) ||
 			!isset($person['icon']['url'])
 			!isset($person['icon']['url'])
 		) {
 		) {
@@ -99,4 +99,4 @@ class RemoteAvatarFetch implements ShouldQueue
 
 
 		return 1;
 		return 1;
 	}
 	}
-}
+}

+ 3 - 3
app/Jobs/MediaPipeline/MediaDeletePipeline.php

@@ -27,7 +27,7 @@ class MediaDeletePipeline implements ShouldQueue
 		$media = $this->media;
 		$media = $this->media;
 		$path = $media->media_path;
 		$path = $media->media_path;
 		$thumb = $media->thumbnail_path;
 		$thumb = $media->thumbnail_path;
-		
+
 		if(!$path) {
 		if(!$path) {
 			return 1;
 			return 1;
 		}
 		}
@@ -36,7 +36,7 @@ class MediaDeletePipeline implements ShouldQueue
 		array_pop($e);
 		array_pop($e);
 		$i = implode('/', $e);
 		$i = implode('/', $e);
 
 
-		if(config('pixelfed.cloud_storage') == true) {
+		if(config_cache('pixelfed.cloud_storage') == true) {
 			$disk = Storage::disk(config('filesystems.cloud'));
 			$disk = Storage::disk(config('filesystems.cloud'));
 			if($disk->exists($path)) {
 			if($disk->exists($path)) {
 				$disk->delete($path);
 				$disk->delete($path);
@@ -64,4 +64,4 @@ class MediaDeletePipeline implements ShouldQueue
 		return 1;
 		return 1;
 	}
 	}
 
 
-}
+}

+ 1 - 1
app/Services/MediaStorageService.php

@@ -20,7 +20,7 @@ class MediaStorageService {
 
 
 	public static function store(Media $media)
 	public static function store(Media $media)
 	{
 	{
-		if(config('pixelfed.cloud_storage') == true) {
+		if(config_cache('pixelfed.cloud_storage') == true) {
 			(new self())->cloudStore($media);
 			(new self())->cloudStore($media);
 		}
 		}
 
 

+ 3 - 3
app/Util/ActivityPub/Helpers.php

@@ -441,7 +441,7 @@ class Helpers {
 			$media->version = 3;
 			$media->version = 3;
 			$media->save();
 			$media->save();
 
 
-			if(config('pixelfed.cloud_storage') == true) {
+			if(config_cache('pixelfed.cloud_storage') == true) {
 				MediaStoragePipeline::dispatch($media);
 				MediaStoragePipeline::dispatch($media);
 			}
 			}
 		}
 		}
@@ -511,7 +511,7 @@ class Helpers {
 						$profile->webfinger = Purify::clean($webfinger);
 						$profile->webfinger = Purify::clean($webfinger);
 						$profile->last_fetched_at = now();
 						$profile->last_fetched_at = now();
 						$profile->save();
 						$profile->save();
-						if(config('pixelfed.cloud_storage') == true) {
+						if(config_cache('pixelfed.cloud_storage') == true) {
 							RemoteAvatarFetch::dispatch($profile);
 							RemoteAvatarFetch::dispatch($profile);
 						}
 						}
 						return $profile;
 						return $profile;
@@ -528,7 +528,7 @@ class Helpers {
 					$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) && Helpers::validateUrl($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
 					$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) && Helpers::validateUrl($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
 					$profile->save();
 					$profile->save();
 				}
 				}
-				if(config('pixelfed.cloud_storage') == true) {
+				if(config_cache('pixelfed.cloud_storage') == true) {
 					RemoteAvatarFetch::dispatch($profile);
 					RemoteAvatarFetch::dispatch($profile);
 				}
 				}
 			}
 			}