mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 02:05:36 +00:00
feat: use RDAP bootstrap file publication date
This commit is contained in:
parent
0b0d4257da
commit
f3eb055545
@ -438,19 +438,7 @@ readonly class RDAPService
|
||||
|
||||
/**
|
||||
* @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 ORMException
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function updateRDAPServers(array $dnsRoot): void
|
||||
{
|
||||
@ -465,7 +453,10 @@ readonly class RDAPService
|
||||
if (null === $server) {
|
||||
$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);
|
||||
}
|
||||
@ -474,6 +465,19 @@ readonly class RDAPService
|
||||
$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 ServerExceptionInterface
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user