cloudflare icon indicating copy to clipboard operation
cloudflare copied to clipboard

Add hosting provider support (Provider)

Open msaladna opened this issue 9 years ago • 4 comments

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

msaladna avatar Feb 09 '16 21:02 msaladna

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

jamesryanbell avatar Jul 17 '16 19:07 jamesryanbell

Not sure why PHPStorm settled on importing a reference from Doctrine...

Pushed the missing changes. I'll leave formatting and style considerations to you.

msaladna avatar Jul 19 '16 16:07 msaladna

Is there anything holding up getting this merged? Happy to help, would like to use this.

andrewklau avatar Sep 26 '16 23:09 andrewklau

I've set aside some time this weekend to review this and hopefully merge.

Thanks, James

jamesryanbell avatar Sep 30 '16 18:09 jamesryanbell