\CloudflarePurgerExtension
This Extension can be applied to DataObjects that are accessible via a URL or that are associated to an object is reachable via a URL.
Synopsis
class CloudflarePurgerExtension
extends DataExtension
{
- // constants
- const PURGE_DRAFT = 0b01;
- const PURGE_LIVE = 0b10;
- const PURGE_ALL = 0b11;
- // members
- protected array $navChangeFields = ;
- // methods
- public void onBeforeVersionedPublish()
- public void onAfterWrite()
- public void onAfterDelete()
- protected boolean detectVersionedNavChange()
- protected boolean detectNavChange()
- protected void purge()
- protected void convertToStageUrl()
- protected array getPurgeLinks()
Hierarchy
Extends
- DataExtension
Constants
Name | Value |
---|---|
PURGE_DRAFT | 0b01 |
PURGE_LIVE | 0b10 |
PURGE_ALL | 0b11 |
Members
protected
Methods
protected
- convertToStageUrl() — Add a the stage parameter at the end of the URLs to purge. Will work even if there's an existing URL parameter on the links.
- getPurgeLinks() — Build a list of URLs to purge.
- purge() — Try to purge URLs from Cloudflare for this DataObject.
public
- onAfterDelete() — Purge the object after its been deleted.
- onAfterWrite() — This hook will be called after an object is saved. If the object doesn't implement the `Versioned` Extension, it will try to purge URL from Cloudflare.
- onBeforeVersionedPublish() — This hook will be called on objects that have the `Versioned` extension applied on the them before a new version is published.