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:----b/+4zdZCpgPbbPEi6YCamL76SPnYEZTHkNyseWydQrHCNC3OhnC5wHMNnQsABMXM7rz+Dk91qntBGW9KypCe3ncDbT+vEZZ1a91VVSFXNFntdhZ9ZIBQTvKZgpOh1PantGAmAx9YD/ak5mAvNfK/3BAqyXmokt7t5rTw95iUmy18xSg0Vq6YANxtlaoINRQJtQSbLXOPH0xbGQKCCtF6QV5CNFIj8T39CrHkq7NuF7Eo4y96QggftojIladNywDoucC+KZldZ5ZZrzFOmnbS6X1JWY74HlrDHo9tpDU4sVqaKmG6wre2XiUZjfb1b5ZMIgSXaBohmsXkuKDZhsEPLlO7eTst6cth9tdMtK7L7KYlud/FaoP/H0TiATVNW2Ewdw7Se6lv/GmPWLDw6GaoUQfAz8LekJKExxKY/LG8vvO3/SaidHLKyTdH4uykrKbPfHg/pTXkh6XIrCpZ5BlZmntV4ZBuMwds6MgpjCqugis/9KC25BMcxJ04/o1IqwIp/mfIUjF0HcE6iBgnB9VQY0sCI5MzsG/jbhWTljmwuPR1q5o6Hnbfi4+mys9Dg1PEnqrChxfrz74mMTfo41dGcwqeZ4Kyoim2+URQjmXsJVA2mZ8smIQmLDJJF8cxcXrSjR9JjBQGwJE8BhqmyVrC0FUEJMhquzPeUJtCRGUdeNM=----ATTACHMENT:----OTY5NTkyMzQyMDAxMjkxMiA3Mzg3MTk0ODQ0MjEwMTE3IDYwOTU4MzE0OTc3ODQ3Nzg=