-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload.php
More file actions
21 lines (16 loc) · 713 Bytes
/
upload.php
File metadata and controls
21 lines (16 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
use DnsStore\FileToTxtDnsConverter;
use DnsStore\Route53Service;
use DnsStore\Verifiers\CliModeVerifier;
use DnsStore\Verifiers\UploadArgumentVerifier;
require_once "vendor/autoload.php";
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
new CliModeVerifier(); // Make sure we're running this in the CLI
new UploadArgumentVerifier($argv); // Make sure CLI arguments match main.php path/file domain.tld subDomain
$pathToFile = $argv[1];
$domain = $argv[2];
$subDomain = $argv[3];
$converter = new FileToTxtDnsConverter($pathToFile);
$dnsService = new Route53Service($domain);
$dnsService->createRecordSets($subDomain, $converter->getTxtRecords(), $converter->getMetaData());