File "Certificate.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/really-simple-ssl/lets-encrypt/vendor/plesk/api-php-lib/src/Api/Operator/Certificate.php
File size: 1.52 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php
// Copyright 1999-2020. Plesk International GmbH.

namespace PleskX\Api\Operator;
defined('ABSPATH') or die();

use PleskX\Api\Struct\Certificate as Struct;

class Certificate extends \PleskX\Api\Operator
{
    /**
     * @param array $properties
     *
     * @return Struct\Info
     */
    public function generate($properties)
    {
        $packet = $this->_client->getPacket();
        $info = $packet->addChild($this->_wrapperTag)->addChild('generate')->addChild('info');

        foreach ($properties as $name => $value) {
            $info->addChild($name, $value);
        }

        $response = $this->_client->request($packet);

        return new Struct\Info($response);
    }

	public function create($properties)
	{
		$packet = $this->_client->getPacket();
		$info = $packet->addChild($this->_wrapperTag)->addChild('add')->addChild('gen_info');

		foreach ($properties as $name => $value) {
			$info->addChild($name, $value);
		}

		$response = $this->_client->request($packet);

		return new Struct\Info($response);
	}

	public function install($domains, $properties)
	{
		$packet = $this->_client->getPacket();
		foreach ($domains as $domain) {
			$install = $packet->addChild($this->_wrapperTag)->addChild('install');
			$install->addChild('name', $domain);
			$install->addChild('webspace', $domain);
			$content = $install->addChild('content');

			foreach ($properties as $name => $value) {
				$content->addChild($name, $value);
			}

		}


		$response = $this->_client->request($packet);

		return new Struct\Info($response);
	}

}