splitice / buyvm-stallion-api
Installs: 2 415
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 1
Open Issues: 1
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2024-11-29 04:49:34 UTC
README
This is a PHP5 wrapper to easily integrate with BuyVM's Stallion control panel API.
Developed for use at www.x4b.net. Pull requests, features and patches welcome.
Requirements
You need PHP 5.3.2+ compiled with the cURL extension.
Install BuyVM Stallion API (PHP)
Installing via Composer
The recommended way to install the Stallion SDK is through Composer.
-
Add
splitice/buyvm-stallion-api
as a dependency in your project'scomposer.json
file:{ "require": { "splitice/buyvm-stallion-api": "dev-master" } }
-
Download and install Composer:
curl -s http://getcomposer.org/installer | php
-
Install your dependencies:
php composer.phar install
-
Require Composer's autoloader
Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:
require 'vendor/autoload.php';
You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.
Examples
Here are some examples on how to do basic operations.
Setting Reverse DNS
$client = new ApiClient('KEY', 'HASH');
$api = new BuyVMApi($client);
$api->rdns('1.1.1.1', 'rdns-ptr');
Get VPS information
$client = new ApiClient('KEY', 'HASH');
$api = new BuyVMApi($client);
$memory = $api->get('mem');