planethoster / planethoster-api
PHP library for PlanetHoster API
Installs: 73
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 1
Open Issues: 4
pkg:composer/planethoster/planethoster-api
Requires
- php: ^7.3 || ^8.0
- guzzlehttp/guzzle: ~7.7.0
Requires (Dev)
- phpspec/phpspec: 7.4.0
This package is auto-updated.
Last update: 2025-10-27 10:40:44 UTC
README
PHP library for PlanetHoster API
Installation
We recommend to install this library with composer.
To install composer follow the official documentation. The following command should also work:
curl -sS https://getcomposer.org/installer | php
To install the library, enter the following command in your PHP project directory:
composer require planethoster/planethoster-api
Or edit composer.json and add:
{
"require": {
"planethoster/planethoster-api": "^1.0"
}
}
Adapter
Inspired by toin0u/DigitalOceanV2 design, we use Adapter interface to make the Http requests.
By default, we provide an adapter for Guzzle with GuzzleHttpAdapter.
You can also build your own by implementing the Adapter interface.
Example
<?php require __DIR__ . '/vendor/autoload.php'; use PlanetHoster\Adapter\GuzzleHttpAdapter; use PlanetHoster\PlanetHoster; // create an adapter with api_user and api_key $adapter = new GuzzleHttpAdapter('your_api_user', 'your_api_key'); // create a PlanetHoster object $planethoster = new PlanetHoster($adapter); // Get your PlanetHoster account information $infos = $planethoster->account()->Info(); // ...
Credits
- Gabriel Poulenard-Talbot for PlanetHoster
Support
Please open an issue in github