Further enhancements

This commit is contained in:
Pinga 2023-11-13 11:52:23 +02:00
parent 4d1e6f908e
commit 73b0ab2f51
2 changed files with 8 additions and 2 deletions

View file

@ -24,6 +24,7 @@ return [
'escrow_report_password' => 'your_password',
// Reporting Configuration
'reporting_path' => '/opt/reporting',
'reporting_upload' => false,
'reporting_username' => 'your_username',
'reporting_password' => 'your_password',

View file

@ -21,6 +21,11 @@ $query = "SELECT tld FROM domain_tld";
$tlds = $dbh->query($query)->fetchAll(PDO::FETCH_COLUMN);
foreach ($tlds as $tld) {
// Skip TLDs with a dot inside, apart from the beginning
if (strpos(substr($tld, 1), '.') !== false) {
continue; // Skip this iteration if an additional dot is found
}
// Initialize activity and transaction data arrays for each TLD
$activityData = [];
$transactionData = [];
@ -158,8 +163,8 @@ foreach ($tlds as $tld) {
// Write data to CSV
$tld_save = strtolower(ltrim($tld, '.'));
writeCSV("/tmp/{$tld_save}-activity-" . date('Ym') . "-en.csv", $activityData);
writeCSV("/tmp/{$tld_save}-transactions-" . date('Ym') . "-en.csv", $transactionData);
writeCSV("{$c['reporting_path']}/{$tld_save}-activity-" . date('Ym') . "-en.csv", $activityData);
writeCSV("{$c['reporting_path']}/{$tld_save}-transactions-" . date('Ym') . "-en.csv", $transactionData);
// Upload if the $c['reporting_upload'] variable is true
if ($c['reporting_upload']) {