PHP code example of pecherskiy-v / beget-api

1. Go to this page and download the library: Download pecherskiy-v/beget-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/ */

    

pecherskiy-v / beget-api example snippets

 php
use PecherskiyV\Beget\Beget;

$beget = new Beget('login', 'password');
 php
$section = $beget->api('section');
 php
$result = $section->doSomething();
 php
$user = $beget->api('user');
// получить информацию об аккаунте
$accountInfo = $user->getAccountInfo();
 php
$backup = $beget->api('backup');
// получить доступный список резервных файловых копий.
$backupList = $backup->getFileBackupList();
 php
$cron = $beget->api('cron');
// получить список всех задач CronTab.
$cronTabList = $cron->getList();
 php
$dns = $beget->api('dns');
// получить информацию с DNS-сервера о домене.
$domainDNSInfo = $dns->getData('site.com');
 php
$ftp = $beget->api('ftp');
// получить список дополнительных FTP-аккаунтов с их домашними директориями.
$ftpList = $ftp->getData();
 php
$mysql = $beget->api('mysql');
// получить список баз данных MySQL с их доступами.
$mysqlList = $mysql->getList();
 php
$site = $beget->api('site');
// получить список сайтов с их доменами.
$siteList = $site->getList();
 php
$domain = $beget->api('domain');
// получить список доменов на аккаунте пользователя.
$domainList = $domain->getList();
 php
$mail = $beget->api('mail');
// получить все почтовые ящики на заданном домене.
$mailboxList = $mail->getMailboxList('site.com');
 php
$stat = $beget->api('stat');
// получить информацию о средней нагрузке на сайтах пользователя за последний месяц.
$siteListLoad = $stat->getSiteListLoad();