SteadLane\Cloudflare\CloudFlare
Class CloudFlare
Synopsis
class CloudFlare
{
- // constants
- const CF_ZONE_ID_CACHE_KEY = 'CFZoneID';
- // members
- protected static bool $ready = false;
- // methods
- public bool hasCFCredentials()
- public array|bool getCFCredentials()
- public string getServerName()
- public bool getCacheEnabled()
- public string|bool fetchZoneID()
- public bool|null isReady()
- public array|mixed|null|Session getSessionJar()
- public $this setSessionJar()
- public int getCurlTimeout()
- public string curlRequest()
- public string getUserAgent()
- public array getAuthHeaders()
- public array|string prependServerName()
- public void canUser()
- public static array getMockResponse()
- public static void debug()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Extensible
Constants
Name | Value |
---|---|
CF_ZONE_ID_CACHE_KEY | 'CFZoneID' |
Members
protected
- $ready
—
SteadLane\Cloudflare\bool
This will toggle to TRUE when a ZoneID has been detected thus allowing the functionality in the admin panel to be available.
Methods
public
- canUser()
- curlRequest() — Sends our cURL requests with our custom auth headers
- debug()
- fetchZoneID() — Gets the CF Zone ID for the current domain.
- getAuthHeaders() — Get Authentication Headers
- getCFCredentials() — Fetches Cloudflare Credentials from YML configuration
- getCacheEnabled() — Returns whether caching is enabled for the Cloudflare class instance
- getCurlTimeout() — Returns the cURL execution timeout limit (seconds)
- getMockResponse()
- getServerName() — Gathers the current server name, which will be used as the Cloudflare zone ID
- getSessionJar() — Get or Set the Session Jar
- getUserAgent() — Fake a user agent
- hasCFCredentials() — Ensures that Cloudflare authentication credentials are defined as constants
- isReady() — Set or get the ready state
- prependServerName() — Appends server name to input
- setSessionJar()