1. Go to this page and download the library: Download innmind/ark 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/ */
innmind / ark example snippets
use function Innmind\Ark\scaleway;
use function Innmind\ScalewaySdk\bootstrap as sdk;
use Innmind\OperatingSystem\Factory;
use Innmind\ScalewaySdk\{
Token,
Region,
User,
Organization,
Image,
};
use Innmind\SshKeyProvider\Local;
use Innmind\Url\Path;
$os = Factory::build();
$sdk = sdk($os->remote()->http(), $os->clock());
$scaleway = $sdk->autnenticated(new Token\Id('uuid')); // create an api token at https://console.scaleway.com/account/credentials
$ark = scaleway(
$scaleway->servers(Region::paris1()),
$scaleway->ips(Region::paris1()),
$scaleway->users(),
$os->process(),
new Local(
$os->control()->processes(),
Path::of('/home/{serverUser}/.ssh'),
),
new User\Id('your user uuid'),
new Organization\Id('the organization uuid you want to create servers in'),
new Image\Id('the image uuid you want to build'),
);
$installation = $ark->forge()->new();
$installAppOn($installation->location());
$ark->array(); // will contain the new server now
use function Innmind\Ark\ovh;
use Innmind\OperatingSystem\Factory;
use Innmind\SshKeyProvider\Local;
use Innmind\Url\Path;
use Ovh\Api;
$os = Factory::build();
$ark = ovh(
new Api(/* args */),
new Local(
$os->control()->processes(),
Path::of('/home/{serverUser}/.ssh'),
),
$os,
);
$installation = $ark->forge()->new();
$installAppOn($installation->location());
$ark->array(); // will contain the new server now
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.