Download the PHP package syrp-nz/silverstripe-cloudlfare-purger without Composer

On this page you can find all versions of the php package syrp-nz/silverstripe-cloudlfare-purger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-cloudlfare-purger

silverstripe-cloudflare-purger

Simple Silverstripe plugin to automatically purge pages from Cloudflare when a Page or a related DataObject is published/saved.

Requirements

NB: The plugin has been tested against Silverstripe 3.4 but has not been toroughly tested against all versions of Silverstripe 3.x. It should in theory work with all sub-version of Silversrtipe 3. If you come accross an issue using an older version of Silverstripe 3, log an issue or do a PR and I'll look into it.

Installation

Getting CloudFlare to cache your content

This plugin doesn't automatically configure SilverStripe or CloudFlare to automatically cache your web content.

Before installaing the plugin, you'll need to configure your SilverStripe site to play nice with CloudFlare.

Configuring CloudFlare to cache SilverStripe pages

Configuration the plugin

This plugin can be configured via a YML file or via the Site Configuration page. The YML configuration will have precedence over the Site Configuration. You can use a combination of both if you want.

The following configuration options are available:

Sample YML file

Using the site config

All the parameters can be defined in your site configuration page without the need to edit any YML file.

If some values are defined via the YML file and the HideSiteConfig flag is undefined, those values will appear as readonly fields in your Site Configuration.

If your concerned about your AuthKey key being visible in the site configuration, make sure to set the HideSiteConfig flag to true.

How does the plugin work

The plugin defines a CloudflarePurgerExtension DataExtension.This extension can be applied to any DataObject class. It will automatically be applied to the SiteTree class.

If the DataObject supports versioning, a call will be made to the Cloudflare API on publication to attempt to purge the the URLs associated to this object. If the DataObject doesn't support versioning, the purge call will occur after each write.

The DataObject can expose a CloudflarePurgeLinks() method to specify which URLs should be purged. This method can return either a single URL or array of URLs. The URLs should be relative to the site root.

Otherwise, the Link() method will be called on your DataObject.

The plugin also attempts to detect when your site navigation changes. Site navigation changes will cause your entire CloudFlare zone to be purge.

Applying CloudflarePurgerExtension to a DataObject

If you have a Page type that relies on a child DataObject for its content or if your DataObject is accessible via its own URL, you should implement the CloudflarePurgerExtension on it.

You can do so via a YML file.

Here's how you could customise the URLs that get purged when the PromoDataObject gets saved.


All versions of silverstripe-cloudlfare-purger with dependencies

PHP Build Version
Package Version
Requires jamesryanbell/cloudflare Version ^1.7
silverstripe/cms Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package syrp-nz/silverstripe-cloudlfare-purger contains the following files

Loading the files please wait ....