$ record = new CDNSKey ([
'host ' => "ckdns.bluelibraries.com " ,
'ttl ' => 3600 ,
'value ' => "cdnskey-value " ,
'flags ' => 255 ,
'protocol ' => 3 ,
'algorithm ' => 12 ,
'public-key ' => "public-key== "
]);
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getFlags = ' . $ record ->getFlags () . PHP_EOL ;
echo 'getProtocol = ' . $ record ->getProtocol () . PHP_EOL ;
echo 'getAlgorithm = ' . $ record ->getAlgorithm () . PHP_EOL ;
echo 'getPublicKey = ' . $ record ->getPublicKey () . PHP_EOL ;
getHost = ckdns.bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = CDNSKEY
getFlags = 255
getProtocol = 3
getAlgorithm = 12
getPublicKey = public-key==
$ record = new CDNSKey ();
$ record ->setData ([
'host ' => "ckdns.bluelibraries.com " ,
'ttl ' => 3600 ,
'value ' => "cdnskey-value " ,
'flags ' => 255 ,
'protocol ' => 3 ,
'algorithm ' => 12 ,
'public-key ' => "public-key== "
]);
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getFlags = ' . $ record ->getFlags () . PHP_EOL ;
echo 'getProtocol = ' . $ record ->getProtocol () . PHP_EOL ;
echo 'getAlgorithm = ' . $ record ->getAlgorithm () . PHP_EOL ;
echo 'getPublicKey = ' . $ record ->getPublicKey () . PHP_EOL ;
getHost = ckdns.bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = CDNSKEY
getFlags = 255
getProtocol = 3
getAlgorithm = 12
getPublicKey = public-key==
$ record = Record::fromString ('ckdns.bluelibraries.com 3600 IN CDNSKEY 255 3 12 public-key== ' );
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getFlags = ' . $ record ->getFlags () . PHP_EOL ;
echo 'getProtocol = ' . $ record ->getProtocol () . PHP_EOL ;
echo 'getAlgorithm = ' . $ record ->getAlgorithm () . PHP_EOL ;
echo 'getPublicKey = ' . $ record ->getPublicKey () . PHP_EOL ;
getHost = ckdns.bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = CDNSKEY
getFlags = 255
getProtocol = 3
getAlgorithm = 12
getPublicKey = public-key==
Create from initialized array
$ record = Record::fromNormalizedArray ([
'host ' => "ckdns.bluelibraries.com " ,
'ttl ' => 3600 ,
'value ' => "cdnskey-value " ,
'flags ' => 255 ,
'protocol ' => 3 ,
'algorithm ' => 12 ,
'public-key ' => "public-key== " ,
'type ' => "CDNSKEY "
]);
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getFlags = ' . $ record ->getFlags () . PHP_EOL ;
echo 'getProtocol = ' . $ record ->getProtocol () . PHP_EOL ;
echo 'getAlgorithm = ' . $ record ->getAlgorithm () . PHP_EOL ;
echo 'getPublicKey = ' . $ record ->getPublicKey () . PHP_EOL ;
getHost = ckdns.bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = CDNSKEY
getFlags = 255
getProtocol = 3
getAlgorithm = 12
getPublicKey = public-key==
$ records = DNS ::getRecords ('ckdns.bluelibraries.com ' , RecordTypes::CDNSKEY );
print_r ($ records );
Array
(
[0] => BlueLibraries\Dns\Records\Types\DnsSec\CDNSKey Object
(
[data:protected] => Array
(
[host] => ckdns.bluelibraries.com
[ttl] => 3600
[value] => cdnskey-value
[flags] => 255
[protocol] => 3
[algorithm] => 12
[public-key] => public-key==
[type] => CDNSKEY
[class] => IN
)
)
)
$ dns = new DnsRecords ();
$ records = $ dns ->get ('ckdns.bluelibraries.com ' , RecordTypes::CDNSKEY );
print_r ($ records );
Array
(
[0] => BlueLibraries\Dns\Records\Types\DnsSec\CDNSKey Object
(
[data:protected] => Array
(
[host] => ckdns.bluelibraries.com
[ttl] => 3600
[value] => cdnskey-value
[flags] => 255
[protocol] => 3
[algorithm] => 12
[public-key] => public-key==
[type] => CDNSKEY
[class] => IN
)
)
)
Retrieve without helper, using custom handler settings
$ dnsHandler = new TCP ();
$ dnsHandler ->setRetries (2 );
$ dnsHandler ->setTimeout (3 );
$ dnsHandler ->setNameserver ('8.8.8.8 ' );
$ dns = new DnsRecords ($ dnsHandler );
$ records = $ dns ->get ('ckdns.bluelibraries.com ' , RecordTypes::CDNSKEY );
print_r ($ records );
Array
(
[0] => BlueLibraries\Dns\Records\Types\DnsSec\CDNSKey Object
(
[data:protected] => Array
(
[host] => ckdns.bluelibraries.com
[ttl] => 3600
[value] => cdnskey-value
[flags] => 255
[protocol] => 3
[algorithm] => 12
[public-key] => public-key==
[type] => CDNSKEY
[class] => IN
)
)
)
$ record = new CDNSKey ([
'host ' => "ckdns.bluelibraries.com " ,
'ttl ' => 3600 ,
'value ' => "cdnskey-value " ,
'flags ' => 255 ,
'protocol ' => 3 ,
'algorithm ' => 12 ,
'public-key ' => "public-key== "
]);
echo 'string1 = ' . json_encode ($ record ->toString ()) . PHP_EOL ;
echo 'string2 = ' . json_encode ((string )$ record ) . PHP_EOL ;
string1 = "ckdns.bluelibraries.com 3600 IN CDNSKEY 255 3 12 public-key=="
string2 = "ckdns.bluelibraries.com 3600 IN CDNSKEY 255 3 12 public-key=="
$ record = new CDNSKey ([
'host ' => "ckdns.bluelibraries.com " ,
'ttl ' => 3600 ,
'value ' => "cdnskey-value " ,
'flags ' => 255 ,
'protocol ' => 3 ,
'algorithm ' => 12 ,
'public-key ' => "public-key== "
]);
echo 'JSON = ' . json_encode ($ record ) . PHP_EOL ;
JSON = {"host":"ckdns.bluelibraries.com","ttl":3600,"value":"cdnskey-value","flags":255,"protocol":3,"algorithm":12,"public-key":"public-key==","class":"IN","type":"CDNSKEY"}
$ record = new CDNSKey ([
'host ' => "ckdns.bluelibraries.com " ,
'ttl ' => 3600 ,
'value ' => "cdnskey-value " ,
'flags ' => 255 ,
'protocol ' => 3 ,
'algorithm ' => 12 ,
'public-key ' => "public-key== "
]);
print_r ($ record ->toArray ());
Array
(
[host] => ckdns.bluelibraries.com
[ttl] => 3600
[value] => cdnskey-value
[flags] => 255
[protocol] => 3
[algorithm] => 12
[public-key] => public-key==
[class] => IN
[type] => CDNSKEY
)