Skip to content
TransIP REST Client
PHP
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.editorconfig
.gitignore
.travis.yml
README.md
composer.json
phpunit.xml

README.md

Unofficial TransIP PHP REST Client

TransIP offers a REST API and this package is a framework agnostic package for it. Under the hood it can work with either Guzzle or Curl library.

Build Status

Usage Examples

Guzzle

<?php
require 'vendor/autoload.php';

use TransIP\TransIPClient;
use TransIP\Adapter\GuzzleHttpAdapter;

// Using Guzzle 5 or 6...
$client = new TransIPClient(
    new GuzzleHttpAdapter('your-api-key')
);

$result = $client->vps()->vpses();

var_export($result);

CURL

<?php
require 'vendor/autoload.php';

use TransIP\TransIPClient;
use TransIP\Adapter\CurlAdapter;

// Using regular CURL
$client = new TransIPClient(
    new CurlAdapter('your-api-key')
);

$result = $client->vps()->vpses();

var_export($result);

Testing on local environment

Start a local php server on port 8000.

php -S localhost:8000 -t ./tests

Run the tests with:

./vendor/bin/phpunit 
 
#optional for prettier layout
./vendor/bin/phpunit --testdox
You can’t perform that action at this time.