<?php


namespace Heanup\Library;


use ProfiCloS\VestaCP\Client;
use ProfiCloS\VestaCP\ClientException;

class Vestacp
{


    private static $instance;
    /**
     * @var Client
     */
    private static $client;


    public function __construct()
    {
        $vst_hostname = \Heanup\App\Api\Config\Vestacp::getData("hostname");
        $vst_username = \Heanup\App\Api\Config\Vestacp::getData("username");
        $vst_password = \Heanup\App\Api\Config\Vestacp::getData("password");
        try {
            self::$client = Client::simpleFactory($vst_hostname, $vst_username, $vst_password);
        } catch (ClientException $e) {
        }
    }
    public static function getInstance(){
        if (!isset(self::$instance)) {
            $instance = new self();
            self::$instance = $instance;
        }
        return self::$client;
    }
}