1. Go to this page and download the library: Download proficlos/vestacp-api 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/ */
proficlos / vestacp-api example snippets
use ProfiCloS\VestaCP\Client;
// easy way to create Client
$client = Client::simpleFactory('https://someHost', 'someUser', 'somePass');
use ProfiCloS\VestaCP\Client;
use ProfiCloS\VestaCP\Authorization\Credentials;
use ProfiCloS\VestaCP\Authorization\Host;
$credentials = new Credentials('someUser', 'somePassword');
$host = new Host('https://someHost', $credentials);
$client = new Client($host);
$userModule = $client->getModuleUser();
$userModule->list(); // returns all users with data
$userModule->detail('admin'); // returns selected user with data
$userModule->changePassword('admin', 'otherPa$$word');
$userModule->add('other_user', 'pa$$word', '[email protected]');
$userModule->delete('other_user');
// ... etc