mirror of
https://github.com/getnamingo/registry.git
synced 2025-06-28 07:03:28 +02:00
Further enhancements
This commit is contained in:
parent
4d1e6f908e
commit
73b0ab2f51
2 changed files with 8 additions and 2 deletions
|
@ -24,6 +24,7 @@ return [
|
||||||
'escrow_report_password' => 'your_password',
|
'escrow_report_password' => 'your_password',
|
||||||
|
|
||||||
// Reporting Configuration
|
// Reporting Configuration
|
||||||
|
'reporting_path' => '/opt/reporting',
|
||||||
'reporting_upload' => false,
|
'reporting_upload' => false,
|
||||||
'reporting_username' => 'your_username',
|
'reporting_username' => 'your_username',
|
||||||
'reporting_password' => 'your_password',
|
'reporting_password' => 'your_password',
|
||||||
|
|
|
@ -21,6 +21,11 @@ $query = "SELECT tld FROM domain_tld";
|
||||||
$tlds = $dbh->query($query)->fetchAll(PDO::FETCH_COLUMN);
|
$tlds = $dbh->query($query)->fetchAll(PDO::FETCH_COLUMN);
|
||||||
|
|
||||||
foreach ($tlds as $tld) {
|
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
|
// Initialize activity and transaction data arrays for each TLD
|
||||||
$activityData = [];
|
$activityData = [];
|
||||||
$transactionData = [];
|
$transactionData = [];
|
||||||
|
@ -158,8 +163,8 @@ foreach ($tlds as $tld) {
|
||||||
|
|
||||||
// Write data to CSV
|
// Write data to CSV
|
||||||
$tld_save = strtolower(ltrim($tld, '.'));
|
$tld_save = strtolower(ltrim($tld, '.'));
|
||||||
writeCSV("/tmp/{$tld_save}-activity-" . date('Ym') . "-en.csv", $activityData);
|
writeCSV("{$c['reporting_path']}/{$tld_save}-activity-" . date('Ym') . "-en.csv", $activityData);
|
||||||
writeCSV("/tmp/{$tld_save}-transactions-" . date('Ym') . "-en.csv", $transactionData);
|
writeCSV("{$c['reporting_path']}/{$tld_save}-transactions-" . date('Ym') . "-en.csv", $transactionData);
|
||||||
|
|
||||||
// Upload if the $c['reporting_upload'] variable is true
|
// Upload if the $c['reporting_upload'] variable is true
|
||||||
if ($c['reporting_upload']) {
|
if ($c['reporting_upload']) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue