Search by

limegreentangerine / cloudflare_kit

limegreentangerine

Cloudflare API actions

Package info

github.com/limegreentangerine/CloudflareKit

Type:concrete5-package

pkg:composer/limegreentangerine/cloudflare_kit

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-10-06 11:04 UTC

This package is auto-updated.

Last update: 2026-10-06 12:53:19 UTC


README

Cloudflare integrations for Concrete CMS, including cache management, Development Mode controls, and Cloudflare Turnstile CAPTCHA.

Requirements

  • PHP 8.4 or newer
  • Concrete CMS 9.5.0 or newer
  • A Cloudflare API token with the permissions needed for the features you use

Installation

From the root of your Concrete CMS project, install the package with Composer:

composer require limegreentangerine/cloudflare_kit

Then install Cloudflare from the Concrete CMS dashboard under Extend concrete5. Package installation adds the Cloudflare dashboard page and registers Cloudflare Turnstile as a CAPTCHA library.

Configuration

Open Dashboard > Cloudflare and configure the following:

Setting Description
Activate Enables the package's event-driven Cloudflare actions.
Use Development Mode Enables Development Mode for administrators on login and disables it on logout when cloudflare.use_dev_mode is enabled.
API Base URL Cloudflare API URL. Defaults to https://api.cloudflare.com/client/v4.
Zone ID The Cloudflare Zone ID for the site.

Configure a scoped Cloudflare API token as the CLOUDFLARE_API_KEY environment variable in the environment running Concrete CMS/PHP. For local development, for example:

export CLOUDFLARE_API_KEY='your-scoped-cloudflare-token'

The token is not saved in the dashboard or package configuration; the dashboard only indicates whether the environment variable is available. Do not commit the token to source control. Allow Zone Settings read and edit access (Zone.Zone Settings) for Development Mode. Allow Cache Purge access (Zone.Cache Purge) if you want Concrete CMS cache flushes to purge Cloudflare's cache.

When the package is active and cloudflare.use_dev_mode is enabled, an administrator login enables Development Mode and logging out disables it. Flushing the Concrete CMS cache purges the configured Cloudflare zone's cache.

API

The package exposes these operations through CloudflareKit\Api\Connection:

use CloudflareKit\Api\Connection;

$cloudflare = new Connection();

$status = $cloudflare->getDevelopmentMode();
$cloudflare->setDevelopmentMode('on'); // Set to 'off' to disable.
$cloudflare->purgeCache();

Each method returns a Symfony Response containing the Cloudflare API response. API error responses cause a RuntimeException.

Cloudflare Turnstile

Configure the Turnstile site key, secret key, theme, size, execution mode, and appearance in Concrete CMS's CAPTCHA settings. Then select Cloudflare Turnstile wherever Concrete CMS offers a CAPTCHA provider. Turnstile tokens are verified server-side using Cloudflare's Siteverify endpoint.

Development

Install the development dependencies and run the test suite:

composer install
composer test

Other useful Composer scripts:

composer format:check  # Check PHP and JavaScript formatting
composer format        # Apply PHP and JavaScript formatting
composer test-coverage # Run PHPUnit with text coverage output

License

This project is released under the MIT License. See LICENSE.TXT for the full text.