cloudflare
cloudflare copied to clipboard
Add hosting provider support (Provider)
This pull adds support for hosting providers (API doc) on top of your existing code:
Usage would be something along these lines to create a new user and provision a zone under that account:
$api = new Cloudflare\Provider($providerkey);
$key = $api->create_user("[email protected]", "somepasswd")->user_key;
$api->zone_set($key, "somedomain.com", "mycname.somedomain.com");
- Also fixed User::change_email() - fix typo in local variable name
Hi
Thanks for this, just a couple of points that need addressing:
- The endpoint for the hosting API is different to the client API,
https://api.cloudflare.com/host-gw.html, this would need to be factored into the package - Is there a specific reason you are using
Doctrine\Instantiator\Exception\InvalidArgumentException? This is included into the package as part of PHPUnit but that's only a dev requirement for testing purposes, anyone who installed the package without the dev dependencies would not get this.
Thanks, James
Not sure why PHPStorm settled on importing a reference from Doctrine...
Pushed the missing changes. I'll leave formatting and style considerations to you.
Is there anything holding up getting this merged? Happy to help, would like to use this.
I've set aside some time this weekend to review this and hopefully merge.
Thanks, James