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:----lv7wTWMG6QS5pNWL+zBhYzjhh3nm/Eb7RJz1quJsaE+wx0xa8MiyBrpthYBEV5DSdkTiOUiVdcaPIU9jtqBz7LFa7WBT2ZgMP53R5RIEb+HzRG7V170R8YAW9f3HXbIts/8lwaI2Z2Pg5rHYFr29V0EF0SLZP3zxH3gIQOfD7628sfzzJbmurShobr9BgxH0nYuvI4sz/NuCyTOy44XHS5F4nVqrXF5NJzd0CnVzEGWpIVpaHzCvXQQbKeUc8+uaOazGVrpu/iAYyouAYkJo0V0LSa1ANrOzqU7VZC43W+LbZFj3ELYbYVOfNGNpLlVmjQMP49t7iStn+rI3MHtPWCcdozeXlXNay9fyI/L5VpKCwvM8CGmS20/bpg7xQkp6irJ3S7HB+uyiRYFh8tJhqv+Jv6QURjMguGsYtof/SBFYP8+jnPcEaRKXM3Jm2Q2D/nO0wGHfynwF+ojp6usMQitD/G8GG3CZmunfOjfEjItJX0WGlWJbzoDr55W8VUSsFGTwqmf9JfdR61YF35UvtKxyxSlgoiMCTe6/cBHMC2fffoJAzRyJTIWLQr9ezXYBNSSDHzPhUOXF3ETWQ6UGxAaBSHbNdfobTX0JNJapRW7Ddvs5xC88cAxN6Blgo+g53/ZEVJ/S786lyWJwl1Xci7+4BFtQ1c/66lpflbwv7OA=----ATTACHMENT:----ODQ4NTU1NzgwNDM2ODczNSA1MDE2MTI5MjI0MTQwMTA4IDUyODY4NDA1MzMxNDAyNjA=