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:----U9uUML1PjEpcFd+LiwqbUQx/xrIXcv5cxlQB9gZzF4yPH9n10H/UE/MbthCYfQuZzy6T5g14aozmpse+waQNCaYvU7AlYMZEasPv2guFuFUd+gGpLeVGD7/L7EpWhcSaiUoHxOURP988mZk8gsjbCAk/XTmIwPYKWcNob1JIwKiEd8ZLcJ4zVQTJASz4+o1ed19cKJFlazjI27inQHx0w82vGJMMNCfOzim5d0yfb0nytMSluC9agXUPPKEq7aNP8T1eUGh8WuotC5BlAMA3XpIu7cBJm8DBwkG41Gae3gbMYy1qz5Kbwpfq2usdh6ZDtngMVv6Se1JIJuxJZWsknoF6icY+YzkB2/YLQK8D7b2dxlgqiv/qwUDyU1UdPy5NNd0jBfuSD6bbhO2KAo9tn80HUT5xKCjYVfGq8oW44Io7QQL9mL5Q6u2q7mWClj9kbb2yQgdi8Omk5vAhY1vbu73vVqG8R+vCck+vbOqSEjAZt1BZ6UTiDS4Il0D6rDv3v02iub26MBWiVnKRbO5LEXGTNutDlWMYcf/eoBNupgJe7LPAsgRBDEMB+aVV6Hhiw3FgYI+QaZxSIuWLauz4Y9RQ61D0nansGYMYs31S8FAXpS2SIxkZY4btUkkhbEwAKhSp2UqaCSocbzgdLL+Vlk3sL5uSi3ybA4M09Xf23ic=----ATTACHMENT:----MzEwMjk4ODI2MjM3NTczMiAzNjY1NDI2NDIzODA1MTg4IDk0ODYyOTg5NDQwMjc0MjY=