Active
Project:
Cloudflare
Version:
2.0.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Reporter:
Created:
23 May 2023 at 07:55 UTC
Updated:
14 May 2026 at 21:28 UTC
Jump to comment: Most recent
The Cloudflare PHP SDK seems to no longer be maintained. What is the future for this module
Visit this page:
I have none, that's why I'm asking.
Move away from the Cloudflare PHP SDK I guess.
None.
Exactly.
Not sure.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
brunapimenta commentedI'll start taking a look on suggestion of the Comment on Github, wherein Cloudflare indicates the usage of API directly.
Comment #3
brunapimenta commentedComment #5
brunapimenta commentedI've provided a fork removing Cloudflare SDK dependency, for that I've chosen to bring to Cloudflare Drupal module the SDK needed code - in which is the one related to Zone (listing and caching purge).
It was validated using a Drupal vanilla installation, everything worked smoothly after applying #3346396 - admin/config/services/cloudflare Slow to Load solution.
Note
Since SDK code followed an Object-Oriented Programming, I've kept as is. Even though at the end it looked a complex solution to a simple need, it can provide flexibility porting more code from that library on the future.
Comment #6
neclimduloof. I'm going to end up being "that guy that just maintains automated builds of OpenAPI libraries because companies can't be bothered to build a CI."
I'll get something built that can be used as a replacement.
Comment #7
rosk0I don't think that copying code from the SDK is a good idea - SDK is old, covers a lot of API endpoints and have a lot of complexity for various use case this module should not need to care about.
Before diving into the solution we need to map out what API endpoints we are actually need to interact with and possibly create child issue to split the work where possible.
I'm not sure, but it feels like this type of change should warrant major version number increase.
And in any case, we need to get #3423376: Add Drupal Gitlab templates merged first.
Comment #8
alexpott@RoSk0++ to only bringing in what you need from the SDK. And yes new major sounds like a good idea.
Comment #9
it-cruIs maybe Cloudflare SDK not death?
During last composer update I saw a new release 1.4.0 of cloudflare/sdk and also its repo on Github has some activity again. Maybe we should double check this with CF or maintainers of this SDK.
https://github.com/cloudflare/cloudflare-php
Comment #11
rosk0Maintainers of the SDK are silent, so I believe we should still keep working in a direction of removing that dependency.
Next steps should be listing out all the API endpoints (together with links to the docs and use cases) that are actually required by this module. From there we can asses what to do next.
We also need to keep in mind that moving forward we only need to support token authentication, as global API key (email + key) is deprecated and could be dropped any minute.
Comment #12
intrafusionI’ve taken a cursorily glance through the code base and it appears the SDK is only called in 2 files:
modules/cloudflarepurger/src/Plugin/Purge/Purger/CloudFlarePurger.phpsrc/Zone.phpSo I don’t imagine it’s going to be too much work, I’ll investigate the actual calls and their replacements.
Comment #13
intrafusionZone.phpAdapter\Guzzlewrapper around Guzzle callsAuth\APIKeywrapper around API keyAuth\APITokenwrapper around API tokenEndpoints\Zonescalls to https://developers.cloudflare.com/api/resources/zones/methods/list/CloudFlarePurger.phpAdapter\Guzzlewrapper around Guzzle callsAuth\APIKeywrapper around API keyAuth\APITokenwrapper around API tokenEndpoints\Zonescalls to https://developers.cloudflare.com/api/resources/zones/methods/list/ & https://developers.cloudflare.com/api/resources/cache/methods/purge/Comment #16
bkosborneYes please. We don't use much from the SDK, should be straight forward to decouple from it. I'll get started on this now. I also agree that just copying code from the SDK isn't wise. We can get even simpler.
Comment #18
timwoodComment #19
charginghawk commentedBumping priority to major since the Cloudflare SDK has a dependency conflict with the simple_oauth module (installed on ~16,000 sites). Basically the Cloudflare SDK requires psr/http-message ^1.0 and simple_oauth releases for Drupal 11 require oauth2-server ^9.0 which requires psr/http-message ^2.0. So you can't update to D11 if you have both the Cloudflare module and the simple_oauth module.
Comment #20
bernardopaulino commentedThis is really unfortunate, I cannot install this module due to a dependency on psr/http-message ^2.0 since I am using simple_oauth module.
Comment #21
intrafusionIt's possible to run this on Drupal 11 with the forked repo from https://github.com/davidbarratt/cloudflare-php/tree/psr-http-upgrade
I don't know the composer commands, but I manually added this to the
repositoriessection:And added to the
requiresection:And finally
composer updateto install everythingComment #24
philltran commentedPlease test this version of the module with Cloudflare SDK dependency removed. So far it is working in my testing.
Some of the edits to README and docs can be split off to a different issue if desired by the maintainer. Since, this is a fairly large re-write I included the extra changes into this branch.
Comment #25
rosk0Thanks @philltran!
I've done bunch of changes on the MR, need to go through it again, but believe we are really close.
I will release a new beta when we merge this.