Download the PHP package handmadeweb/statamic-cloudflare without Composer

On this page you can find all versions of the php package handmadeweb/statamic-cloudflare. 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 statamic-cloudflare

Cloudflare integration for Statamic with CLI, static caching integration and control panel integration.

Inspired by sebdesign/artisan-cloudflare

Requirements

Installation

You can install the package via composer:

Copy the package config to your local config with the publish command:

Then add your cloudflare details to your .env file.

or

Note that CLOUDFLARE_KEY will be used instead of CLOUDFLARE_TOKEN in the event that they are both set. KEY is the global api key with all possible permissions and TOKEN is a generated Api KEY/TOKEN which has specific permissions enabled/disabled.

And configure your zones, If you only need to specify a single zone, then you can add it to your .env

Otherwise you can specify multiple zones in your statamic-cloudflare.php

By default all purge actions except the Cli commands will be queued with your default queue.

This can be changed in the configuration.

Usage

Cli

You can purge everything via the following commands.

Static Caching

If you want to use statamic-cloudflare as a static cache strategy then you will need to manually register the cacher in the register method of your App\Providers\AppServiceProvider class.

Then update your static_cache config.

Then update the static_cache strategy at the top of the configuration to:

Currently the Cloudflare integration is only used for purging, If you would like to use another caching strategy in combination with this caching strategy, then you are free to do that.

This can be done by updating the strategy section within the cloudflare strategy, below is an example where we will be caching the application using the half measure

In theory, you should be able to use any caching strategy here, such as the full measure or any other first or third party strategies, statamic-cloudfare will simply pass requests to the defined strategy and will just hook into the purge actions to also purge the page in Cloudflare.

Control Panel

Events

statamic-cloudflare will listen to the Statamic\Events\EntrySaved, Statamic\Events\EntryDeleted, Statamic\Events\TermSaved and Statamic\Events\TermDeleted events and will trigger a pruge for the url. These events will be ignored if you have configured the static cache to be a strategy that uses the cloudflare driver, as the driver will instead handle the needed purging actions.

Utility

statamic-cloudflare will add a utility to your Statamic CP.

route: /cp/utilities/cloudflare

This will be available to Super Users and Users who have the Cloudflare Manager permission.

You can purge everything quickly from here.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of statamic-cloudflare with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
statamic/cms Version ^4.0||^5.0
cloudflare/sdk Version ^1.2
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 handmadeweb/statamic-cloudflare contains the following files

Loading the files please wait ....