mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: use RDAP bootstrap file publication date
This commit is contained in:
@@ -438,19 +438,7 @@ readonly class RDAPService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws ORMException
|
* @throws ORMException
|
||||||
*/
|
* @throws \Exception
|
||||||
public function updateRDAPServersFromFile(string $fileName): void
|
|
||||||
{
|
|
||||||
if (!file_exists($fileName)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->logger->info('Start of update the RDAP server list from custom config file.');
|
|
||||||
$this->updateRDAPServers(Yaml::parseFile($fileName));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws ORMException
|
|
||||||
*/
|
*/
|
||||||
private function updateRDAPServers(array $dnsRoot): void
|
private function updateRDAPServers(array $dnsRoot): void
|
||||||
{
|
{
|
||||||
@@ -465,7 +453,10 @@ readonly class RDAPService
|
|||||||
if (null === $server) {
|
if (null === $server) {
|
||||||
$server = new RdapServer();
|
$server = new RdapServer();
|
||||||
}
|
}
|
||||||
$server->setTld($tldReference)->setUrl($rdapServerUrl)->updateTimestamps();
|
$server
|
||||||
|
->setTld($tldReference)
|
||||||
|
->setUrl($rdapServerUrl)
|
||||||
|
->setUpdatedAt(new \DateTimeImmutable(array_key_exists('publication', $dnsRoot) ? $dnsRoot['publication'] : 'now'));
|
||||||
|
|
||||||
$this->em->persist($server);
|
$this->em->persist($server);
|
||||||
}
|
}
|
||||||
@@ -474,6 +465,19 @@ readonly class RDAPService
|
|||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ORMException
|
||||||
|
*/
|
||||||
|
public function updateRDAPServersFromFile(string $fileName): void
|
||||||
|
{
|
||||||
|
if (!file_exists($fileName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->logger->info('Start of update the RDAP server list from custom config file.');
|
||||||
|
$this->updateRDAPServers(Yaml::parseFile($fileName));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws TransportExceptionInterface
|
* @throws TransportExceptionInterface
|
||||||
* @throws ServerExceptionInterface
|
* @throws ServerExceptionInterface
|
||||||
|
|||||||
Reference in New Issue
Block a user