malc0mn / vultr-api-client
PHP API client for api.vultr.com
Installs: 27 750
Dependents: 0
Suggesters: 0
Security: 0
Stars: 26
Watchers: 5
Forks: 39
Open Issues: 3
Requires
- php: >=5.4.0
Requires (Dev)
- guzzlehttp/guzzle: 5.3 - 6.3
- phpunit/phpunit: >=4.8
Suggests
- guzzlehttp/guzzle: To use GuzzleHttpAdapter, require guzzlehttp/guzzle:^5.0|^6.0
This package is not auto-updated.
Last update: 2024-11-09 19:51:01 UTC
README
Install using composer
Open a shell, cd
to your poject and type:
composer require malc0mn/vultr-api-client
or edit composer.json and add:
{ "require": { "malc0mn/vultr-api-client": "~1.0" } }
If you want to use the GuzzleHttpAdapter
, you will need to add Guzzle 5
or Guzzle 6.
Usage examples
Guzzle
require 'vendor/autoload.php'; use Vultr\VultrClient; use Vultr\Adapter\GuzzleHttpAdapter; // Using Guzzle 5 or 6... $client = new VultrClient( new GuzzleHttpAdapter('your-api-key') ); $result = $client->metaData()->getAccountInfo(); var_export($result);
CURL
require 'vendor/autoload.php'; use Vultr\VultrClient; use Vultr\Adapter\CurlAdapter; // Using regular CURL, courtesy of 'usefulz' $client = new VultrClient( new CurlAdapter('your-api-key') ); $result = $client->metaData()->getAccountInfo(); var_export($result);
Vultr API documentation
The full API documentation can be found on https://www.vultr.com/api and has been partly added to the PHP DocBlocks companioning the PHP functions that implement the actual calls.
Credits
The original version of this API is done by usefulz. This version has been forked by integr.io for use in one of our Symfony applications. It has been reworked with extensibility and ease of use in mind.