Skip to content
Ploi's PHP SDK API wrapper
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Ploi Add logs for sites Aug 15, 2018
tests
.gitignore Start of unit tests for server Aug 14, 2018
.travis.yml Travis and Readme updates Aug 14, 2018
LICENSE First initial code added Aug 13, 2018
README.md Added new API documentation URL Dec 30, 2018
composer.json Change phpunit version Aug 14, 2018
phpunit.xml More tests and a better Travis CI to show coverage Aug 14, 2018

README.md

NOT READY FOR PRODUCTION YET

Ploi PHP SDK 🚀

Build Status codecov

The future is now - so stop the hassle, you’re running behind. Quick and easy site deployment with Ploi. Awesome features for awesome developers. Check it out at www.ploi.io

This SDK is ment for PHP applications to be able to communicate with our API. You can find our documentation at https://developers.ploi.io

Installation

composer require ploi/ploi-php-sdk

Usage

First you need to call a new Ploi instance


$ploi = new \Ploi\Ploi($apiToken);
// or
$ploi = new \Ploi\Ploi();
$ploi->setApiToken($token);

Responses

When calling a resource, it will return an array containing decoded JSON as well as the original response from the Guzzle client.

[
     "json" => {
       +"id": 123,
       +"name": "server-name",
       +"ip_address": "XXX.XXX.XXX.XXX",
       +"php_version": 7.1,
       +"mysql_version": 5.7,
       +"sites_count": 3,
       +"status": "Server active",
       +"created_at": "2018-01-01 08:00:00",
     },
     "response" => GuzzleHttp\Psr7\Response,
   ]

Resources

Resources are what you call to access a feature or function.

Servers

Get all servers

$ploi->server()->get();

Get a specific server

$ploi->server(123)->get();
// or
$ploi->server()->get(123);

Get a servers deployment logs

$ploi->server(123)->logs();
// or
$ploi->server()->logs(123);
You can’t perform that action at this time.