mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-20 09:35:59 +02:00
More RST updates
This commit is contained in:
parent
d88d292cfc
commit
93a52abed6
2 changed files with 22 additions and 9 deletions
|
@ -34,11 +34,6 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$domainCount = fetchCount($dbh, 'domain');
|
|
||||||
$hostCount = fetchCount($dbh, 'host');
|
|
||||||
$contactCount = fetchCount($dbh, 'contact');
|
|
||||||
$registrarCount = fetchCount($dbh, 'registrar');
|
|
||||||
|
|
||||||
// Fetching TLDs
|
// Fetching TLDs
|
||||||
$stmt = $dbh->query("SELECT id,tld FROM domain_tld;");
|
$stmt = $dbh->query("SELECT id,tld FROM domain_tld;");
|
||||||
$tlds = $stmt->fetchAll();
|
$tlds = $stmt->fetchAll();
|
||||||
|
@ -61,7 +56,12 @@ try {
|
||||||
foreach ($tlds as $tld) {
|
foreach ($tlds as $tld) {
|
||||||
$tldname = ltrim($tld['tld'], '.');
|
$tldname = ltrim($tld['tld'], '.');
|
||||||
$endOfPreviousDay = date('Y-m-d 23:59:59', strtotime('-1 day'));
|
$endOfPreviousDay = date('Y-m-d 23:59:59', strtotime('-1 day'));
|
||||||
|
|
||||||
|
$domainCount = fetchDomainCount($dbh, $tld['id']);
|
||||||
|
$hostCount = fetchCount($dbh, 'host');
|
||||||
|
$contactCount = fetchCount($dbh, 'contact');
|
||||||
|
$registrarCount = fetchCount($dbh, 'registrar');
|
||||||
|
|
||||||
// Skip subdomains
|
// Skip subdomains
|
||||||
if (strpos($tldname, '.') !== false) {
|
if (strpos($tldname, '.') !== false) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -84,7 +84,6 @@ try {
|
||||||
$xml->writeAttributeNS('xmlns', 'domain', null, 'urn:ietf:params:xml:ns:domain-1.0');
|
$xml->writeAttributeNS('xmlns', 'domain', null, 'urn:ietf:params:xml:ns:domain-1.0');
|
||||||
$xml->writeAttributeNS('xmlns', 'contact', null, 'urn:ietf:params:xml:ns:contact-1.0');
|
$xml->writeAttributeNS('xmlns', 'contact', null, 'urn:ietf:params:xml:ns:contact-1.0');
|
||||||
$xml->writeAttributeNS('xmlns', 'secDNS', null, 'urn:ietf:params:xml:ns:secDNS-1.1');
|
$xml->writeAttributeNS('xmlns', 'secDNS', null, 'urn:ietf:params:xml:ns:secDNS-1.1');
|
||||||
$xml->writeAttributeNS('xmlns', 'rdeHeader', null, 'urn:ietf:params:xml:ns:rdeHeader-1.0');
|
|
||||||
$xml->writeAttributeNS('xmlns', 'rdeDomain', null, 'urn:ietf:params:xml:ns:rdeDomain-1.0');
|
$xml->writeAttributeNS('xmlns', 'rdeDomain', null, 'urn:ietf:params:xml:ns:rdeDomain-1.0');
|
||||||
$xml->writeAttributeNS('xmlns', 'rdeHost', null, 'urn:ietf:params:xml:ns:rdeHost-1.0');
|
$xml->writeAttributeNS('xmlns', 'rdeHost', null, 'urn:ietf:params:xml:ns:rdeHost-1.0');
|
||||||
$xml->writeAttributeNS('xmlns', 'rdeContact', null, 'urn:ietf:params:xml:ns:rdeContact-1.0');
|
$xml->writeAttributeNS('xmlns', 'rdeContact', null, 'urn:ietf:params:xml:ns:rdeContact-1.0');
|
||||||
|
@ -110,7 +109,6 @@ try {
|
||||||
|
|
||||||
// Array of objURI values
|
// Array of objURI values
|
||||||
$objURIs = [
|
$objURIs = [
|
||||||
'urn:ietf:params:xml:ns:rdeHeader-1.0',
|
|
||||||
'urn:ietf:params:xml:ns:rdeContact-1.0',
|
'urn:ietf:params:xml:ns:rdeContact-1.0',
|
||||||
'urn:ietf:params:xml:ns:rdeHost-1.0',
|
'urn:ietf:params:xml:ns:rdeHost-1.0',
|
||||||
'urn:ietf:params:xml:ns:rdeDomain-1.0',
|
'urn:ietf:params:xml:ns:rdeDomain-1.0',
|
||||||
|
@ -659,7 +657,6 @@ try {
|
||||||
|
|
||||||
// Array of objURI values
|
// Array of objURI values
|
||||||
$objURIs = [
|
$objURIs = [
|
||||||
'urn:ietf:params:xml:ns:rdeHeader-1.0',
|
|
||||||
'urn:ietf:params:xml:ns:rdeContact-1.0',
|
'urn:ietf:params:xml:ns:rdeContact-1.0',
|
||||||
'urn:ietf:params:xml:ns:rdeHost-1.0',
|
'urn:ietf:params:xml:ns:rdeHost-1.0',
|
||||||
'urn:ietf:params:xml:ns:rdeDomain-1.0',
|
'urn:ietf:params:xml:ns:rdeDomain-1.0',
|
||||||
|
|
|
@ -138,6 +138,22 @@ function fetchCount($pdo, $tableName) {
|
||||||
return $result['count'];
|
return $result['count'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fetchDomainCount($pdo, $tld_id) {
|
||||||
|
// Calculate the end of the previous day
|
||||||
|
$endOfPreviousDay = date('Y-m-d 23:59:59', strtotime('-1 day'));
|
||||||
|
|
||||||
|
// Prepare the SQL query
|
||||||
|
$query = "SELECT COUNT(id) AS count FROM domain WHERE crdate <= :endOfPreviousDay AND tldid = :tldid";
|
||||||
|
$stmt = $pdo->prepare($query);
|
||||||
|
$stmt->bindParam(':endOfPreviousDay', $endOfPreviousDay);
|
||||||
|
$stmt->bindParam(':tldid', $tld_id, PDO::PARAM_INT);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
// Fetch and return the count
|
||||||
|
$result = $stmt->fetch();
|
||||||
|
return $result['count'];
|
||||||
|
}
|
||||||
|
|
||||||
// Function to check domain against Spamhaus SBL
|
// Function to check domain against Spamhaus SBL
|
||||||
function checkSpamhaus($domain) {
|
function checkSpamhaus($domain) {
|
||||||
// Append '.sbl.spamhaus.org' to the domain
|
// Append '.sbl.spamhaus.org' to the domain
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue