PHP code example of takuya / php-letencrypt-acme-dns
1. Go to this page and download the library: Download takuya/php-letencrypt-acme-dns library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// set dns plugin per Domain.
$cli = new LetsEncryptAcmeDNS( 'priv_key_pem', '[email protected]' );
$dns_plugin_1 = new CloudflareDNSPlugin( 'cloudflare_token', 'example.tld' );
$dns_plugin_2 = new YourOwnPlugin( 'your_own_key', 'example.biz' );
$cli->setDnsPlugin( $dns_plugin_1, 'example.tld' );
$cli->setDnsPlugin( $dns_plugin_2, 'example.biz' );
class YourOwnPlugin extends DNSPlugin{
}
class YourOwnPlugin extends DNSPlugin{
public function addDnsTxtRecord ( $domain, $content ): bool;{
// TODO: write your way to add TXT Record for ACME challenge.
}
public function removeTxtRecord ( $domain, $content ): bool{
// TODO: Write in your way, how to remove TXT Record , after ACME.
}
}