1. Go to this page and download the library: Download sroze/hipache-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sroze / hipache-client example snippets
use Hipache\Client;
$client = new Client($adapter);
use Hipache\Frontend\Frontend;
use Hipache\Frontend\Exception\FrontendAlreadyExists;
try {
$frontend = $client->createFrontend(new Frontend('www.example.com'));
} catch (FrontendAlreadyExists $e) {
// Given frontend can't be created since it already exists...
}
use Hipache\Frontend\Exception\FrontendNotFound;
try {
$frontend = $client->getFrontend('www.example.com');
} catch (FrontendNotFound $e) {
// Frontend was not found...
}
use Hipache\Backend\Backend;
$frontend = $client->getFrontend('sroze.io');
$frontend->add(new Backend('http://1.2.3.4:8000'));
$frontend->add(new Backend('http://1.2.3.4:8001'));