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:----qudSFyqUe7wg6eR95wNmDMN3J+i8X+w4erh70pY9vONb5EerQOK05aCTLZSbwWWdZMn+aoRwwH6ep74olII0lrzMsPg+/5Pyq1rw6hWzabBXf4fZcf5WDIoToqTJB76YbrSqiBcMTiUhOxp5jPLq/OOd33C1aayGUrO0tTspDf0C0sfsF6vGSplJp2WA4+14StqLnHzzyAF8caY2dzamnkdy3kF13vqd+HP8wBoyrqC9ucNfnQIQLj8gbzO9kfTB4c4Ziv7koP/Tbx3C9HeFSoHdvDyBGApq5YWIkFhqRehkTKqCNdyl8S/ZhtXPNmVFY5heLRNehy9i5oYI5ILEuVtrkqVXagngW9W8XJu9kzX1E3MCnidXan+sDBhMyCGd00HZxxiZq+jTsZR/eD8zW/7s590VyhDAIZLf08uA3sll4dS7MPhkJgN9tEWpnDrTPqx94NoMS//WAZ7cx/i1PuDW1nVTglG/4WNyoT8/eFgJv70K5PRpcYupWCIrQ2ToS+266hLn5rg+saN/DIWSLjJI7NL7ofN69QyAwZs2uISCDoTqeutAN7BGOn7U0d/5guiHG9+hGA6rVF4uqecnV7NXBZ3lN5FnMca7/0g0pec0ubhOhkxO778FVys/87H8XIFwjdvzqWNU5UAg5fPyUINpw+9ibRnkMlvRHi5gzxs=----ATTACHMENT:----NDQzMjk0ODE2ODc0MzI0MSA4OTQ0MjM3ODA1OTQ3NDQ0IDEwNTA0Mjg2MzkxMDczMTQ=