Add files via upload

master
Vladislavs Dovoreckis 2020-04-30 18:47:16 +03:00 committed by GitHub
parent 518f424e4a
commit edb2d0d467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 43 deletions

View File

@ -1,18 +1,5 @@
<?php
/**
* Use any way you want. Free for all
*
* @version 1.1
* */
error_reporting(E_ALL);
ini_set('display_errors', 'on');
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
define('DEBUG', 'TRUE');
//define('DEBUG', 'FALSE');
class GoGetSSLApi {
protected $apiUrl = 'https://my.gogetssl.com/api';
@ -20,8 +7,8 @@ class GoGetSSLApi {
protected $lastStatus;
protected $lastResponse;
public function __construct($key = null, $apiUrl = null) {
$this->key = isset($key) ? $key : null;
public function __construct($key = null) {
$this->key = $key != null ? $key : null;
}
public function auth($user, $pass) {
@ -140,7 +127,7 @@ class GoGetSSLApi {
return $this->call('/tools/webservers/' . (int) $type, $getData);
}
public function getDomainAlternative($csr = null) {
public function getDomainAlternative($csr) {
if (!$this->key) {
throw new GoGetSSLAuthException ();
} else {
@ -149,7 +136,9 @@ class GoGetSSLApi {
);
}
$postData ['csr'] = $csr;
if ($csr) {
$postData ['csr'] = trim($csr);
}
return $this->call('/tools/domain/alternative/', $getData, $postData);
}
@ -560,26 +549,12 @@ class GoGetSSLApi {
$result = curl_exec($c);
if (DEBUG == 'TRUE') {
echo "\n\n";
echo "===============\n";
echo __FILE__ . "\n";
echo "===============\n\n";
echo "url = " . $url . "\n\n";
echo "queryData = " . urldecode($queryData) . "\n\n";
echo "getData = \n";
print_r($getData) . "\n\n";
echo "postData = \n";
print_r($postData) . "\n\n";
echo "result GoGetSslApi = \n";
print_r(json_decode($result, true));
echo "\n\n";
}
$status = curl_getinfo($c, CURLINFO_HTTP_CODE);
curl_close($c);
curl_close($c);
$this->lastStatus = $status;
$this->lastResponse = json_decode($result, true);
$this->lastResponse = json_decode($result, true);
return $this->lastResponse;
}
@ -598,5 +573,4 @@ class GoGetSSLAuthException extends Exception {
public function __construct() {
parent::__construct('Please authorize first');
}
}