BringYourOwnIdeas\Maintenance\Util\ApiLoader
Handles fetching supported addon details from addons.silverstripe.org
Synopsis
class ApiLoader
{
- // members
- private static array $dependencies = ;
- protected Client $guzzleClient;
- protected CacheInterface $cache;
- // methods
- protected abstract string getCacheKey()
- public array doRequest()
- public Client getGuzzleClient()
- public $this setGuzzleClient()
- public array getClientOptions()
- protected array|bool getFromCache()
- protected bool setToCache()
- protected void handleCacheFromResponse()
- public CacheInterface getCache()
- public $this setCache()
- protected Request createRequest()
- protected string|null resolveVersion()
Hierarchy
Uses
- SilverStripe\Core\Extensible
Members
private
- $dependencies
protected
- $cache — Psr\SimpleCache\CacheInterface
- $guzzleClient — GuzzleHttp\Client
Methods
protected
- createRequest() — Create a request with some standard headers
- getCacheKey() — Define a unique cache key for results to be saved for each request (subclass)
- getFromCache() — Attempts to load something from the cache and deserializes from JSON if successful
- handleCacheFromResponse() — Check the API response for cache control headers and respect them internally in the SilverStripe cache if found
- resolveVersion() — Resolve the framework version of SilverStripe.
- setToCache() — Given a value, set it to the cache with the given key after serializing the value as JSON
public
- doRequest() — Perform an HTTP request for module health information
- getCache()
- getClientOptions() — Get Guzzle client options
- getGuzzleClient()
- setCache()
- setGuzzleClient()