Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
test(debug possibilities): regarding "problematic" tld imports
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed May 16, 2022
1 parent 2791d6d commit 529eeae
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions modules/registrars/keysystems/lib/Helpers/ZoneInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static function get(array $params, ?string $tld = null): ZoneModel
}
}

//$zone = null;
// $zone = null;
if (!$zone || ($updateNeeded && $updates < $maxUpdates)) {
try {
$zoneInfo = new GetZoneInfo($params, $tld);
Expand All @@ -60,27 +60,29 @@ public static function get(array $params, ?string $tld = null): ZoneModel
throw new Exception($ex->getMessage());
}

//$p1 = explode(",",$zoneInfo->api->properties['REGISTRATIONPERIODS'][0]);
//$p2 = explode(",",$zoneInfo->api->properties['RENEWALPERIODS'][0]);
//$diff = array_diff($p1, $p2);

// if (
// empty(array_intersect($p1, $p2))
// || empty(array_intersect($p2, $p1))
//) {
// logActivity($tld . ": " . json_encode([
// "registration" => $p1,
// "renewal" => $p2
// ], JSON_PRETTY_PRINT));
//}
// 2022-05:
// no renewal terms: .xin, .sc.ke, .net.vu,.mobi.ke, .me.ke, .edu.mt, .com.vu, .ac.ni, .ac.ke
// different terms: .tm, .org.gi, .net.bd, .hu, .gi
// n/a as term: .nl, .li, .jp, .it, .de, .ch

//if (!empty($diff)) {
// logActivity($tld . ": " . json_encode($diff, JSON_PRETTY_PRINT));
//}
/*$p1 = explode(",",$zoneInfo->api->properties['REGISTRATIONPERIODS'][0]);
$p2 = explode(",",$zoneInfo->api->properties['RENEWALPERIODS'][0]);
$dbgRow = [
"registration" => $p1,
"renewal" => $p2,
"unsupportedRenewalTerms" => array_values(array_diff($p1, $p2)), // all elements of p1 not in p2
"missingRenewalTerms" => array_values(array_diff($p2, $p1)) // all elements of p2 not in p1
];
$flag1 = empty($dbgRow["unsupportedRenewalTerms"]);
$flag2 = empty($dbgRow["missingRenewalTerms"]);
if (
(!(
!$flag1
// 10y reg only -> whmcs keeps 10y for renewal otherwise not
&& count($dbgRow["registration"])>1
&& count($dbgRow["unsupportedRenewalTerms"]) === 1
&& in_array(10, $dbgRow["unsupportedRenewalTerms"])
) && !$flag1)
|| !$flag2
) {
//$debugPeriodIssues[$tld] = $dbgRow;
logActivity(json_encode([$tld => $dbgRow], JSON_PRETTY_PRINT));
}*/
// 2022-05: plenty of tlds having reg terms that are not supported for renewal

$data = [
Expand Down

0 comments on commit 529eeae

Please sign in to comment.