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:----XFd7cxdgt9KEu0sT8GDIT8H57N2hf7ZtXROTWCLDvQG31+usnk4MzRE7SnUVjyhkL4dN937ncVKw28VNQVjV7nbB2ZicrtF0vyqjI42lfQObR9d74/HtONoEpICl0ldWFkz+WQWBye6ymSjk0xTdasoPYCXaK3+uUqUmNnq1kAKpIxd/eLSWePKjthHJxQwfXUSBLFbdey1rz0sLiKHyTCWUy3dXj5n7eXcv2i9XbANOverxqIYF3uPVSPnoC7FA+801vD8G71JmGWlDaXkYn10RAP45X06rDb7fPDRCBD3CkZ05wWcD2WN93cr/VvExyDWvUdsdSngsUkJqY/qTXXVO1qozBUaFNuo437PeuYXwmT4HSIQFGR6/bwu2A3bqbBAGtTjzRAw3QcX/md/YnE1apg2ImHZBTMSk3mZvVyxepfdor+vg/jR3ipnEbJd8jVOjUJB3a4S9xaUeczKPwKGitMwrA3qWRC4pJgzkYcq7rGS3295c07q36nxgSROhM+QI6r+DXN5+3AlscF3BA7UKo1urBPhjmLrwBA369+AkCDnYWmriS0rLo/kM/NSzzGT0sK6nlL92eBqrZKujMtjOjBRSJNURPIyLLv9ETDpE+MKlgrSKvbMd5+gyjW32oBJQMHjytPW43RTeuMb0Wzjpf+XlHqjZUnhbPPS/qWw=----ATTACHMENT:----NjkxOTIyMjAxNzY3MTYxMiAyODgxNjcyMDY3NzI0NzM1IDgzOTczNzA1MzUxNDU1NTY=