فهرست منبع

Update config() to config_cache()

Daniel Supernault 4 سال پیش
والد
کامیت
3e52458889

+ 2 - 2
app/Http/Controllers/Api/ApiV1Controller.php

@@ -66,7 +66,7 @@ class ApiV1Controller extends Controller
 
 
 	public function apps(Request $request)
 	public function apps(Request $request)
 	{
 	{
-		abort_if(!config('pixelfed.oauth_enabled'), 404);
+		abort_if(!config_cache('pixelfed.oauth_enabled'), 404);
 
 
 		$this->validate($request, [
 		$this->validate($request, [
 			'client_name' 		=> 'required',
 			'client_name' 		=> 'required',
@@ -984,7 +984,7 @@ class ApiV1Controller extends Controller
                 'max_caption_length' => (int) config('pixelfed.max_caption_length'),
                 'max_caption_length' => (int) config('pixelfed.max_caption_length'),
                 'max_bio_length' => (int) config('pixelfed.max_bio_length'),
                 'max_bio_length' => (int) config('pixelfed.max_bio_length'),
                 'max_album_length' => (int) config_cache('pixelfed.max_album_length'),
                 'max_album_length' => (int) config_cache('pixelfed.max_album_length'),
-                'mobile_apis' => config('pixelfed.oauth_enabled')
+                'mobile_apis' => config_cache('pixelfed.oauth_enabled')
 
 
             ]
             ]
         ];
         ];

+ 1 - 1
app/Providers/AuthServiceProvider.php

@@ -26,7 +26,7 @@ class AuthServiceProvider extends ServiceProvider
     {
     {
         $this->registerPolicies();
         $this->registerPolicies();
 
 
-        if(config('pixelfed.oauth_enabled')) {
+        if(config_cache('pixelfed.oauth_enabled')) {
             Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]);
             Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]);
             Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15)));
             Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15)));
             Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30)));
             Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30)));

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

@@ -54,7 +54,7 @@ class Config {
 				],
 				],
 
 
 				'features' => [
 				'features' => [
-					'mobile_apis' => config('pixelfed.oauth_enabled'),
+					'mobile_apis' => config_cache('pixelfed.oauth_enabled'),
 					'circles' => false,
 					'circles' => false,
 					'stories' => config('instance.stories.enabled'),
 					'stories' => config('instance.stories.enabled'),
 					'video'	=> Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'),
 					'video'	=> Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'),

+ 2 - 2
resources/views/settings/applications.blade.php

@@ -6,7 +6,7 @@
 	<h3 class="font-weight-bold">Applications</h3>
 	<h3 class="font-weight-bold">Applications</h3>
 </div>
 </div>
 <hr>
 <hr>
-@if(config('pixelfed.oauth_enabled') == true)
+@if(config_cache('pixelfed.oauth_enabled') == true)
 	<passport-authorized-clients></passport-authorized-clients>
 	<passport-authorized-clients></passport-authorized-clients>
 	<passport-personal-access-tokens></passport-personal-access-tokens>
 	<passport-personal-access-tokens></passport-personal-access-tokens>
 @else
 @else
@@ -16,4 +16,4 @@
 
 
 @push('scripts')
 @push('scripts')
 <script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
 <script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
-@endpush
+@endpush

+ 2 - 2
resources/views/settings/developers.blade.php

@@ -6,7 +6,7 @@
 	<h3 class="font-weight-bold">Developers</h3>
 	<h3 class="font-weight-bold">Developers</h3>
 </div>
 </div>
 <hr>
 <hr>
-@if(config('pixelfed.oauth_enabled') == true)
+@if(config_cache('pixelfed.oauth_enabled') == true)
 	<passport-clients></passport-clients>
 	<passport-clients></passport-clients>
 @else
 @else
 	<p class="lead">OAuth has not been enabled on this instance.</p>
 	<p class="lead">OAuth has not been enabled on this instance.</p>
@@ -16,4 +16,4 @@
 
 
 @push('scripts')
 @push('scripts')
 <script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
 <script type="text/javascript" src="{{mix('js/developers.js')}}"></script>
-@endpush
+@endpush

+ 1 - 1
resources/views/settings/partial/sidebar.blade.php

@@ -41,7 +41,7 @@
         <a class="nav-link font-weight-light text-muted" href="{{route('settings.dataexport')}}">Data Export</a>
         <a class="nav-link font-weight-light text-muted" href="{{route('settings.dataexport')}}">Data Export</a>
       </li>
       </li>
 
 
-      @if(config('pixelfed.oauth_enabled') == true)
+      @if(config_cache('pixelfed.oauth_enabled') == true)
       <li class="nav-item">
       <li class="nav-item">
       <hr>
       <hr>
       </li>
       </li>