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:----WQtjhLS+7e4uzQWtiBo4sUhpXPzh+CfgAQ6/PPeszJZ3JfYAWAvR0ESSgT6DLaeZIrS7eFANVCq9opKnB09zVFF+covF915ZtsOvSzMasuqpPSWzpHaI8fsMP5OmRmfySXIQJFf/UrtU7cAtl6+67wNHPUfL8KGBuHV0xwYejogoVPQOCUhkKBi9/6bwELDZx595faen5mpvVWHtrEHeV5NR57J2xcxK3xKkuNnLZ6kKky41FDNut8+NAKwSCpQC/Uh5xNluzUsuwDLYXJNoeavWyJhrFGxbMlcTEyDlOB/+Q/zh7IxYDXrea0arN2WPAyuc+5Gev7P8Wg4PqPolz4A6KqRAP50oYOzR+gLkobs5LbK4dD77xB25tM1dxl6/5n/XCkz/uF+0+rjwQyAKMRBDELy4lXRFv+vd2qEZilGJSdYcCQwGvk7q0GKym0T4NHneiqjUC8RNWYDkn1uQ3ZwsxLbVTLMcK4gzGEXlUKsAIMo4dr7A+vOKmtMJE8sDWHXyi/PXhPjViDhCktCKJKEjDQUnRm6mfD8s3GbjKBk4HgHtj4sEhRuyguYn8LEvozyj7O1mm9kbwERDIS4k9jlz2tbn1FIL8Pzvf7UZ1f2eRZjl8vDPY9BCCtKrNz2n93ZUdxrdGDPZf065/Tk2ZYxXvHjt3x7infYDAJ3dkVk=----ATTACHMENT:----OTI0MTA3MjAyODE1ODE1OCA0NDAxMDY4ODI0MTc0MDQ0IDUxMzk5MTA2NjU1MzU0NDM=