Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

tuefekci/DigitalOcean-PHP-Class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages