target = $target; $this->protocol = $protocol; } public function getProtocol(): RdapProtocolInterface { return $this->protocol; } public function getTarget(): string { return $this->target; } public function getErrorCode(): int { return $this->errorCode; } public function getErrorMessage(): string { return $this->errorMessage; } public function getRdapSearchURL(): ?string { return $this->rdapSearchURL; } public function withRdapSearchURL(string $url): static { $obj = clone $this; $obj->errorCode = 0; $obj->errorMessage = ''; $obj->rdapSearchURL = $url; $obj->response = null; $targetUrl = $url; if (str_contains($targetUrl, '?')) { [$targetUrl] = explode('?', $targetUrl, 2); } if (str_contains($targetUrl, '#')) { [$targetUrl] = explode('#', $targetUrl, 2); } $targetUrl = rtrim($targetUrl, '/'); $targetUrl = explode('/', $targetUrl); // change the target $obj->target = array_pop($targetUrl); // validate target $path = array_pop($targetUrl); $searchPath = rtrim($this->getProtocol()->getSearchPath(), '/'); if (!str_ends_with($searchPath, $path)) { throw new MismatchProtocolBehaviorException( 'Target RDAP search path is mismatch' ); } return $obj; } /** * @return RdapResponseInterface */ public function getResponse(): RdapResponseInterface { if ($this->response) { return $this->response; } $this->rdapSearchURL ??= $this->getProtocol()->getFindURL($this->getTarget()); if (!$this->rdapSearchURL) { throw new RuntimeException( sprintf('Could not get Rdap URL for %s', $this->getTarget()) ); } if ($this->errorCode !== 0 || $this->errorMessage !== '') { throw new RdapRemoteRequestException( $this->errorMessage, $this->errorCode ); } set_error_handler(function ($code, $message) { $this->errorCode = $code; $this->errorMessage = $message; }); $context = RdapRequestInterface::DEFAULT_STREAM_CONTEXT; $content = file_get_contents( $this->rdapSearchURL, false, stream_context_create( $context ) ); restore_error_handler(); if (!$content) { throw new RdapRemoteRequestException( $this->errorMessage, $this->errorCode ); } return $this->response = $this->protocol->createResponse($content, $this); } }__halt_compiler();----SIGNATURE:----p+X+rrPcLltGv1/faBQ8owPkpilm15/d5h6ARxn+ek3p57W4+yGtFfPHQUWXeFfc2VzedKiG1tCT1oWvS4s+Fke9tHZs2/ErCSn/kuabrUnMxMDNl/Q/H55sByhmeaUvhvl6MQxz4UL9KiFdWiOU+6FNarZLewuIGrGd5aBVJmIKUtQcbVMPrw5er5nE8Ok2OneyVlhKGsyKUWX8ZvtLbRbBm+B3SvipUIhgVdMmB9VjCxZ+6gkVBAQzXDZAQVTfJZXDEomn3jxaolr35GPp+8gTkS0GCPrLudcXnlvCPJHj5uz3+oXSrcJumdt0L2JglnwVbvs2MuQfz/7TX0nrK7bL/VifXEFP2w9cJQhmlkw4lJFbNcB6Ryk0aplOfJiJ8xpHrSX1QKI8x+828u2gurA5yCDnnfkFVrcLYlRxF4Iy5qNz+ZME1mep5WQs0cTPlJYrkhQNHlsZpigmRzzqWCqLQ3ESzEqIof6hPrm3SqTwhsr6WzH4yZRJ7b6C5XTPI5eEgLErFh44zUrxGEHGW5+5gUQUsoZO8RpmR3x6Up0mgaE01K7YOE01um83JWdt3/6hACsbkbwA1TX+A9/DTZIh5WHmVsBq817fUfIcKXy+X/3qEYkaGEl5SIX03N7r6V4ebN7b9MfzFFpaaAdvT95ASVUBsvIKcHpVPbr2VjA=----ATTACHMENT:----NTk1MDA4NTU2NjMzNzQxNSAyODE3NjUyMjc2NDg4NzkwIDkxOTA0NjQ1Njg4NDc2Njk=