function checkdomains($conn, $domains) { try { $check = new Metaregistrar\EPP\eppLaunchCheckRequest($domains); $check->setLaunchPhase(Metaregistrar\EPP\eppLaunchCheckRequest::PHASE_CLAIMS, 'test', Metaregistrar\EPP\eppLaunchCheckRequest::TYPE_CLAIMS); if (($response = $conn->writeandread($check)) instanceof Metaregistrar\EPP\eppLaunchCheckResponse && $response->Success()) { //$phase = $response->getLaunchPhase(); $checks = $response->getDomainClaims(); foreach ($checks as $check) { echo $check['domainname'] . " has " . ($check['claimed'] ? 'a claim' : 'no claim') . "\n"; if ($check['claimed']) { if ($check['claim']) { if ($check['claim'] instanceof Metaregistrar\EPP\eppDomainClaim) { echo "Claim validator: " . $check['claim']->getValidator() . ", claim key: " . $check['claim']->getClaimKey() . "\n"; $tmch = new Metaregistrar\TMCH\cnisTmchConnection(); $output = $tmch->getCnis($check['claim']->getClaimKey()); echo "Notice ID: " . $output->getNoticeId() . " Not after: " . $output->getNotAfter() . "\n"; } else { throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no valid claim key is present"); } } else { throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no claim key is present"); } } } } else { echo "ERROR2\n"; } } catch (Metaregistrar\EPP\eppException $e) { echo 'ERROR1: ' . $e->getMessage() . "\n"; } catch (Metaregistrar\TMCH\tmchException $t) { echo 'ERROR TMCH: ' . $t->getMessage() . "\n"; } }
/** * @param Metaregistrar\EPP\eppConnection $conn * @param string $domainname * @return array|null */ function checkdomainclaim($conn, $domainname) { $check = new Metaregistrar\EPP\eppLaunchCheckRequest(array($domainname)); $check->setLaunchPhase(Metaregistrar\EPP\eppLaunchCheckRequest::PHASE_CLAIMS, null, Metaregistrar\EPP\eppLaunchCheckRequest::TYPE_CLAIMS); if (($response = $conn->writeandread($check)) instanceof Metaregistrar\EPP\eppLaunchCheckResponse && $response->Success()) { //$phase = $response->getLaunchPhase(); /* @var Metaregistrar\EPP\eppLaunchCheckResponse $response */ $checks = $response->getDomainClaims(); foreach ($checks as $check) { echo $check['domainname'] . " has " . ($check['claimed'] ? 'a claim' : 'no claim') . "\n"; if ($check['claimed']) { if ($check['claim']) { if ($check['claim'] instanceof Metaregistrar\EPP\eppDomainClaim) { echo "Claim validator: " . $check['claim']->getValidator() . ", claim key: " . $check['claim']->getClaimKey() . "\n"; $tmch = new Metaregistrar\TMCH\cnisTmchConnection(true, 'settingslive.ini'); $claim = array(); $output = $tmch->getCnis($check['claim']->getClaimKey()); /* @var $output Metaregistrar\TMCH\tmchClaimData */ $claim['noticeid'] = $output->getNoticeId(); $claim['notafter'] = $output->getNotAfter(); $claim['confirmed'] = gmDate("Y-m-d\\TH:i:s\\Z"); return $claim; } else { throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no valid claim key is present"); } } else { throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no claim key is present"); } } } } else { echo "ERROR2\n"; } return null; }
/** * @param $conn Metaregistrar\EPP\eppConnection * @param $domains array */ function checkdomains($conn, $domains) { try { $check = new Metaregistrar\EPP\eppLaunchCheckRequest($domains); $check->setLaunchPhase('claims'); if (($response = $conn->writeandread($check)) instanceof Metaregistrar\EPP\eppLaunchCheckResponse && $response->Success()) { /* @var $response Metaregistrar\EPP\eppLaunchCheckResponse */ $checks = $response->getCheckedDomains(); foreach ($checks as $check) { echo $check['domainname'] . " is " . ($check['available'] ? 'free' : 'taken') . " (" . $check['reason'] . ")\n"; } } else { echo "ERROR\n"; } } catch (Metaregistrar\EPP\eppException $e) { echo $e->getMessage() . "\n"; } }