PHPackages                             gpenverne/cloudflare-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gpenverne/cloudflare-bundle

ActiveSymfony-bundle[API Development](/categories/api)

gpenverne/cloudflare-bundle
===========================

This Bundle implements the Cloudflare API

2.2.2(6y ago)212.0k1[1 issues](https://github.com/gpenverne/cloudflareBundle/issues)[1 PRs](https://github.com/gpenverne/cloudflareBundle/pulls)1MITPHPPHP &gt;=7.0.0CI failing

Since Oct 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/gpenverne/cloudflareBundle)[ Packagist](https://packagist.org/packages/gpenverne/cloudflare-bundle)[ RSS](/packages/gpenverne-cloudflare-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (3)Versions (11)Used By (1)

CloudflareBundle
================

[](#cloudflarebundle)

A Symfony3 bundle for the [PHP library for the Cloudflare v4 API `](https://github.com/cloudflare/cloudflare-php).

Install
-------

[](#install)

```
$ composer require gpenverne/cloudflare-bundle
```

Configuration
-------------

[](#configuration)

You have to generate a "APIToken" from your cloudflare "My Profile" &gt; "API Tokens" page

```
# app/config/packages/cloudflare.yaml
...
cloudflare:
    api_token: your_cloudflare_api_token
```

Or for older versions of symfony:

```
# app/config/parameters.yml
parameters:
    cloudflare.api_token: some-cloudflare-api_token
```

Use it
------

[](#use-it)

```
$cloudflareService = $this->container->get('cloudflare.service');
// Or ...
$cloudflareService = $this->container->get(Gpenverne\CloudflareBundle\Services\CloudflareService::class)
// Or inject in your constructors

// Retrieve a Cloudflare SDK endpoint
$userEndpoint = $cloudflareService->get('User');

// Or use built-in shortcut
$userEndpoint = $cloudflareService->user;

// Listing all zones
$zones = $cloudflareService->zones->listZones();

// Adapted example from extracted from https://support.cloudflare.com/hc/en-us/articles/115001661191
$zones = $cloudflareService->zones;
foreach ($zones->listZones()->result as $zone) {
    echo "Cache purge for " . $zone->name . ": ";
    echo $zones->cachePurgeEverything($zone->id) == true ? "successful" : "failed";
    echo PHP_EOL;

}

// Add a domain to a zone
try {
    return $cloudflareService->dns->addRecord(
        $zone->id,
        'CNAME',
        'my-subdomain',
        'my-domain.com'
    );
} catch (\Exception $e) {
    return false;
}
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~132 days

Recently: every ~169 days

Total

10

Last Release

2355d ago

Major Versions

1.0.5 → 2.0.02018-03-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/401993?v=4)[Grégoire](/maintainers/gpenverne)[@gpenverne](https://github.com/gpenverne)

---

Top Contributors

[![gpenverne](https://avatars.githubusercontent.com/u/401993?v=4)](https://github.com/gpenverne "gpenverne (27 commits)")

---

Tags

cloudflarecloudflare-apicloudflare-phpflexsymfonysymfony-bundleapicloudflare

### Embed Badge

![Health badge](/badges/gpenverne-cloudflare-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gpenverne-cloudflare-bundle/health.svg)](https://phpackages.com/packages/gpenverne-cloudflare-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
