wappr / digitalocean
A PHP DigitalOcean API Client using Guzzle
Installs: 60
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/wappr/digitalocean
Requires
- php: >=5.6
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2022-06-25 07:52:54 UTC
README
A DigitalOcean PHP client that uses Guzzle by default.
Basic usage
You MUST set the DO_API_TOKEN
environment variable set to your DigitalOcean API TOKEN.
Next you need to instantiate one of the resources that are listed below. Each resource has a method that will send a request to DigitalOcean. Those methods require a instantiated request class. The request class construct requires the fields required by DigitalOcean. By using a request class it is impossible to send a request without all the required data. There are sometimes optional fields that get evaluated when using the setter method.
<?php include 'vendor/autoload.php'; use wappr\digitalocean\Droplets; use wappr\digitalocean\Requests\Droplets\CreateDropletsRequest; $droplets = new Droplets; $droplets->create(new CreateDropletsRequest('name', '512mb', 'nyc1', 'ubuntu-14-04-x64'));