feat(*): refactor dynamic vs. static structure and distinctions; make additional elements dynamic
This commit is contained in:
parent
7a0b808f24
commit
eaab389cb9
136 changed files with 984 additions and 960 deletions
22
app/Classes/GlobalsFetcher.php
Normal file
22
app/Classes/GlobalsFetcher.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Classes;
|
||||
|
||||
class GlobalsFetcher extends PageFetcher
|
||||
{
|
||||
public function fetch(): ?array
|
||||
{
|
||||
$cacheKey = "globals";
|
||||
$cached = $this->cacheGet($cacheKey);
|
||||
|
||||
if ($cached) return $cached;
|
||||
|
||||
$globals = $this->fetchFromApi("optimized_globals");
|
||||
|
||||
if (empty($globals)) return null;
|
||||
|
||||
$this->cacheSet($cacheKey, $globals[0]);
|
||||
|
||||
return $globals[0];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue