public function getDomainClaims() { $idna = new eppIDNA(); if ($this->getResultCode() == self::RESULT_SUCCESS) { $result = array(); $xpath = $this->xPath(); $domains = $xpath->query('/epp:epp/epp:response/epp:extension/launch:chkData/launch:cd'); foreach ($domains as $domain) { $childs = $domain->childNodes; $checkeddomain = array('domainname' => null, 'available' => false, 'reason' => null, 'claimed' => false); foreach ($childs as $child) { if ($child instanceof \domElement) { if (strpos($child->tagName, ':name')) { $exists = $child->getAttribute('exists'); switch ($exists) { case '0': case 'false': $checkeddomain['claimed'] = false; break; case '1': case 'true': $checkeddomain['claimed'] = true; break; } } if (strpos($child->tagName, ':claimKey')) { $checkeddomain['claim'] = new eppDomainClaim(); $checkeddomain['claim']->setValidator($child->getAttribute('validatorID')); $checkeddomain['claim']->setClaimKey($child->nodeValue); } if (strpos($child->tagName, ':name')) { $checkeddomain['domainname'] = $idna->decode($child->nodeValue); } if (strpos($child->tagName, ':reason')) { $checkeddomain['reason'] = $child->nodeValue; } } } $result[] = $checkeddomain; } } return $result; }
/** * Attempts to return a concrete IDNA instance for either php4 or php5, * only creating a new instance if no IDNA instance with the same * parameters currently exists. * * @param array $params Set of paramaters * * @return object idna_convert * @access public */ public function singleton($params = array()) { static $instances; if (!isset($instances)) { $instances = array(); } $signature = serialize($params); if (!isset($instances[$signature])) { $instances[$signature] = eppIDNA::getInstance($params); } return $instances[$signature]; }