Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Nov 6, 2019
1 parent b45021a commit 96ab532
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 38 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
"php": ">=5.0.0",
"ext-soap": "*",
"symfony/event-dispatcher": ">=2.8.26",
"opensrs/osrs-toolkit-php": "dev-master",
"detain/myadmin-plugin-installer": "dev-master"
},
},
"require-dev": {
"phpunit/phpunit": "*",
"phpunit/phpunit-mock-objects": "*",
Expand Down
74 changes: 37 additions & 37 deletions src/OpenSRS.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

require_once __DIR__.'/openSRS_loader.php';
require_once __DIR__.'/../../../workerman/statistics/Applications/Statistics/Clients/StatisticClient.php';
use opensrs\APIException;
use opensrs\Exception;
use opensrs\Request;
use \opensrs\APIException;
use \opensrs\Exception;
use \opensrs\Request;

/**
* OpenSRS Domain Class
Expand Down Expand Up @@ -743,42 +743,42 @@ public static function listDomainsByExpireyDate($startDate = false, $endDate = f
while ($endPages == false) {
$page++;
$response = self::xmlRequest('get_domains_by_expiredate', 'domain', ['limit'=>$limit,'exp_from'=>$fromDate,'exp_to'=>$toDate,'page'=>$page]);
if ($response === false) {
if ($response === false) {
$endPages = true;
} else {
$found = false;
foreach ($response['xml_array']['body']['data_block']['dt_assoc']['item'] as $idx => $data) {
if (is_array($data) && isset($data['dt_assoc']['item']) && is_array($data['dt_assoc']['item'])) {
foreach ($data['dt_assoc']['item'] as $dataIdx => $domainParentData) {
if (is_array($domainParentData) && isset($domainParentData['dt_array']['item']) && is_array($domainParentData['dt_array']['item'])) {
$found = true;
foreach ($domainParentData['dt_array']['item'] as $domainIdx => $domainArray) {
$domainData = $domainArray['dt_assoc']['item'];
$domain = false;
$expire = false;
foreach ($domainData as $value) {
if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/uU', trim($value))) {
$expire = trim($value);
} elseif (!in_array(trim($value), ['Y','N'])) {
$domain = trim($value);
}
}
if ($domain !== false && $expire !== false) {
//echo "[{$page}] Adding Domains Entry {$domain} {$expire}\n";
$domains[$domain] = $expire;
}
}
if (count($domainParentData['dt_array']['item']) < $limit) {
$endPages = true;
}
}
}
}
}
if ($found === false) {
myadmin_log('domains', 'warning', __NAMESPACE__.'::'.__METHOD__.' returned '.json_encode($response['xml_array']), __LINE__, __FILE__);
$endPages = true;
}
$found = false;
foreach ($response['xml_array']['body']['data_block']['dt_assoc']['item'] as $idx => $data) {
if (is_array($data) && isset($data['dt_assoc']['item']) && is_array($data['dt_assoc']['item'])) {
foreach ($data['dt_assoc']['item'] as $dataIdx => $domainParentData) {
if (is_array($domainParentData) && isset($domainParentData['dt_array']['item']) && is_array($domainParentData['dt_array']['item'])) {
$found = true;
foreach ($domainParentData['dt_array']['item'] as $domainIdx => $domainArray) {
$domainData = $domainArray['dt_assoc']['item'];
$domain = false;
$expire = false;
foreach ($domainData as $value) {
if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/uU', trim($value))) {
$expire = trim($value);
} elseif (!in_array(trim($value), ['Y','N'])) {
$domain = trim($value);
}
}
if ($domain !== false && $expire !== false) {
//echo "[{$page}] Adding Domains Entry {$domain} {$expire}\n";
$domains[$domain] = $expire;
}
}
if (count($domainParentData['dt_array']['item']) < $limit) {
$endPages = true;
}
}
}
}
}
if ($found === false) {
myadmin_log('domains', 'warning', __NAMESPACE__.'::'.__METHOD__.' returned '.json_encode($response['xml_array']), __LINE__, __FILE__);
$endPages = true;
}
}
}
return $domains;
Expand Down

0 comments on commit 96ab532

Please sign in to comment.