Update high

This commit is contained in:
Kevin Feiler
2025-10-16 01:15:48 +02:00
parent 15815e3a9d
commit ceee8d9663
92 changed files with 20860 additions and 34 deletions

View File

@@ -0,0 +1,41 @@
<?php
class TSDNS {
protected $url = null;
protected $apiKey = null;
function __construct($url, $apiKey) {
$this->url = $url;
$this->apiKey = $apiKey;
}
function getZones() {
$command = '/list';
return $this->sendRequest($command);
}
function addZone($zone, $target) {
$command = '/add/' . $zone . '/' . $target;
return $this->sendRequest($command);
}
function deleteZone($zone) {
$command = '/del/' . $zone;
return $this->sendRequest($command);
}
function getZone($zone) {
$command = '/get/' . $zone;
return $this->sendRequest($command);
}
function sendRequest($command) {
$url = $this->url . $command;
$headers = array('Accept' => 'application/json', 'Authorization' => $this->apiKey);
Requests::register_autoloader();
$request = Requests::get($url, $headers);
return $request;
}
}