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:----CGQgL/EB5D/MjTMFRlb67Ju2mu45Hc8GhEHuIojPHuqKRirALzCHTCOxkSB7RALS3TAIaJhnAFifTOAfwILcsS4nRP8e3vWIPJDMHdmCGo7zzlAx2XiyqJUD8+mEBnjOOApbVHmbeisU5dd5kddNP3KNVx8qMtw8dQJd9WPSF5hZVovtbFs4Z28ZkU2YeiEbfUh/q5ZpbSf5rZxfZz2Nfwj6gafUvsTHKXa+mLCMWBVOlwlIqV9VSjqsGG0ya78htJlc2kHVwHuBCgYz5WRm4LpbVQf0IZ6eCl5vNE3p/VHEW7mprDyuOpiKn9tuO5GwdnVD6bAOcivVDabJQIy+8y8TsGUrBqrzfD2fMviFb0o1I1y1Kaz0SU/5ODbGxu97WIA01VDh5emU6nUwTL1BwUXGjlCE0Z65ocEpfjMR/WKDKVtCp6L8EjsAdQmYWx6HlXFCaBFdCrydghq9XF28aXHiSBymJmYR5L90KKbnr9p5j/d+M5oHoabWOdVyoBqy3aWEk/VCE8E28dg9e7kbLbH/p3fi2MM/QJVfJFKZ1g02wZ42p1KjIvv1YtFmM0EILIpMU9Ha9w2kXibNW9VY+8I6V0vFdOWqOLFzq9P59qIcFNe+s51yl9oeiu51GS6L5/hQtIqTCmHySDPpvKGsnsFZkyg5+dtuX4cMU+otW28=----ATTACHMENT:----NDc5NDI2MzY0NTM5NTEzNyA4OTkzOTQ2NTQyMTcwNjYxIDIzNjExNzg3OTkzOTY5NDY=