feat: Enhacing caching and more ... #1

Merged
Rev merged 10 commits from :master into master 2021-10-12 22:05:16 -04:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit e5ea4a83e5 - Show all commits

View File

@ -7,7 +7,6 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
use App\Config\GiteaConfig;
use Illuminate\Support\Facades\Log;
class ItemsCollection
{
@ -45,8 +44,11 @@ class ItemsCollection
$trimmed_current_locale_name = trim($current_locale_name[1][0]);
$current_locale_json = json_decode(file_get_contents("${raw_locales_global_base_url}/${trimmed_current_locale_name}.json"), true);
$this->locales = $this->locales->merge([$trimmed_current_locale_name => [collect($current_locale_json['templates'])->merge(collect($current_locale_json['customization']))]]);
$template_locale = collect($current_locale_json['templates']);
$customization_locale= collect($current_locale_json['customization']);
$this->locales = $this->locales->merge([$trimmed_current_locale_name => $template_locale->concat($customization_locale)]);
}
file_put_contents("G:\spt-items-api\storage\data.json", $this->locales['en']);
Cache::put($this->locales_cache_key, $this->locales);
}

1
storage/data.json Normal file

File diff suppressed because one or more lines are too long