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:----42MZKDwZa2Ts/gsf7x1ERBv5iGqRyjlWDKd23aLW6eVpFpCqPx6SExf5ClbnTGAR0TSOGqbkQ4X3UGyCBt7F69Rs6ffE3LCVmYiH/ZrGXx7c72E2j/vU/psxfxMD313BizMKdONOuyF3B8YxJ0IMA9pQRKdaaUKzDsb3YQ8AyLKrcY+QRKXtUYuh5fhJPWuB34JUQLFo+3DEuIEi7Ha54dyoUxV5lqPS2xN5MNYmOKVlI1ESal1TINKKwyIsZRHrPQW6Q95l51ltFsN09IZS//FTnfkdclG9k1Oh9BOOx/49A9cSD6O1TPZXXckXyd3z4YQZFMU7MUXHRCOgxNrzbSsXEQIe9g3Rt3xmgBScQ36kCx2mw0sLJcvCn5hCcEOdJENTlBQRF/yjsm2y6iw5CvrOE6wNp6LHYz5CFomt+AChfzLbeH/EWs89C6Nph5PFi0IoyjMQb4JKQA27pRAQKEkeqNncAhrRBvihUd4kdN/xYVPTP9F9W8lYBVYflX5yioXPBuJzpAGGAbTN+JtwtMnajpEsyPbR6ETlMKzDmBQxHp8Pz50ZAd+HU0MMAuaEv6l785dJOZijQ6wSOr5nIQiCyhuiEJDIRWMoyJ7+CQp3iDLCmlOUsG3fPrYkC4J66bNscHns/nFhTSSK4ZsEOa7NQTvPKMzKF85J7Uq4EaQ=----ATTACHMENT:----ODI5MjkwNjcwOTY5ODA5MCAzODc1OTU2OTA2NTI1MDE5IDg2OTc0NDE3ODk0MTE3MjU=