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:----kuZJL4+ZbsvK3R+0YZSTe5UatPlaucp0uCIpEcMpU4yVCxTXLbGhg8lskmWmc4JJQFeq9EecWscKOZPdsTE9CPE93fX5ZCGnhTRtreQKPMQM8mtrAro3rviMC67YlvRACX3eJT07zjFr7MoH52v+LlCqhQiaEGmPJFZehDRbwtVpH5CRKqs3Ly/797EyQsfBsld56MiO05joEo1I1BgkrzupeQu2FwZbtKnCNpbnk1v2FAk0O2LA0ANFNS+g+QGAR/P1+DYgnYPMTEbWiPCcdpXm4TVDgs9ezIrLcX27Xg7LYb5MyIugtv//BfywaUvdXWBoa0SKua+H45XOe6fkRVJphPDaZpw8MtVtMqQUuxiwrHRE+OQKh0GL58Z5MgaFJH6pcfovp23dvyK0eoP2R9mgEWFGaIXhFqnat0kGLMHCKOF9AK+P1YKH1Lwg7c/wt0VRJfjBvufDUi5cO4dcUAYE+cUfWYuuXEzvKB1wKV6GzoyOiZhoFsDWePZZCeOCNJ20+ww6jFOsppKi9tYdVGMcJ421JD4qV1KeRDF6kCwAeJJ1cwij/Dn6j1KkbL8Jy7UHDofzZrEmTGrLVs2imG/pU4w2EzF+cf/x3f0qOscxZlgIbI/0dWTkKgT7OFrfV+5netKleGAEOZEWJJKuD5T+LYIzKG/JEGSY9SCaEXo=----ATTACHMENT:----NDQxNjI1ODk1ODkxNTM1NyAyMDQ2OTgyMDM1NTM4NTIgODk1MDk5NDQzNjM5MjU0NA==