This repository has been archived by the owner. It is now read-only.
DEPRECATED!
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
DigitalOcean.class.php
README.md

README.md

PHP wrapper for the Digital Ocean API

This is a PHP wrapper class of the Digital Ocean API. All methods are supported.

Documentation for the Digital Ocean API can be found here.

Automatically generated phpDoc live here.

Example Usage

require_once('DigitalOcean.class.php');
$ocean = new \DigitalOceanApi\DigitalOcean('client_id_here','api_key_here');
$droplets = get_object_vars($ocean->getDroplets());
$i=0;
$x=0;
foreach ($droplets as $drops) {
	if (!is_array($drops)) {
		echo $i . '. Status: ' . $drops . '<br />';
	} else {
		echo $i . '. Name: ' . $drops[$x]->name . '<br />';
		echo $i . '. IP: ' . $drops[$x]->ip_address . '<br />';
		$x++;
	}
	$i++;
}

The above will result in something like this:

0. Status: OK
1. Name: your-droplet-name
1. IP: your-droplet-ip