Symbiote\Cloudflare\Cloudflare
Synopsis
class Cloudflare
{
- // constants
- const MAX_PURGE_FILES_PER_REQUEST = 500;
- const CLOUDFLARE_CLASS = 'Symbiote\Cloudflare\Cloudflare';
- const FILESYSTEM_CLASS = 'Symbiote\Cloudflare\Filesystem';
- const SITE_CLASS = 'Symbiote\Multisites\Model\Site';
- // members
- private static boolean $enabled = false;
- private static string $email = '';
- private static string $auth_key = '';
- private static string $zone_id = '';
- private static string $base_url = '';
- private static array $image_file_extensions = ;
- protected Api $client;
- protected Filesystem $filesystem;
- // methods
- public void __construct()
- public CloudflareResult|null purgePage()
- public CloudflareResult|null purgeAll()
- public CloudflareResult|null purgeImages()
- public CloudflareResult|null purgeCSSAndJavascript()
- public CloudflareResult purgeURLs()
- public string getZoneIdentifier()
- protected CloudflareResult|null purgeFilesByExtensions()
- protected boolean isHomePage()
- private array getLinksToPurgeByPage()
- private array getFilesToPurgeByExtensions()
- private void purgeFiles()
Hierarchy
Uses
- SilverStripe\Core\Extensible
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
MAX_PURGE_FILES_PER_REQUEST | 500 |
CLOUDFLARE_CLASS | 'Symbiote\Cloudflare\Cloudflare' |
FILESYSTEM_CLASS | 'Symbiote\Cloudflare\Filesystem' |
SITE_CLASS | 'Symbiote\Multisites\Model\Site' |
Members
private
- $auth_key
—
string
Authentication Key - $base_url
—
string
This is used as the base url when clearing the cache for pages, CSS and JavaScript. - $email — string
- $enabled — boolean
- $image_file_extensions
—
array
Files with these extensions to purge when clearing images. - $zone_id
—
string
Zone ID
protected
- $client — \Cloudflare\Api
- $filesystem — Symbiote\Cloudflare\Filesystem
Methods
private
protected
- isHomePage() — Check if page is the home page.
- purgeFilesByExtensions()
public
- __construct()
- getZoneIdentifier()
- purgeAll()
- purgeCSSAndJavascript()
- purgeImages()
- purgePage()
- purgeURLs() — Purge list of URL strings