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:----hg3GKAa/4eny5ptjfjuhT2AgKwzQdqZSMtE3AEP1VM7ZJPzSkZiTfe4lgY8nJyfdDDqmoMKYZ1aCSoeak0IzDrgHPs+fybYeVi59YRlk8g9WFwkw0iW9TJXRYhEq0/m/WaC2uiMwdbz95y6MYTWy+9+ojA32r3z2W/FoBxUq6zmV3H5owbaB0NrqNROm3iBGj7FBikGJ26iVPitwZhgUvunupaW4SqsKzC5d/Z8JGGahvtW3AC+wFiKQdtf02DS92C7Ihjhxw7qHXKVf8vOJ1gZQSOmvU+DpktGHmnCQCXbu2jQkq/ypO5DAxUP/F/TABcS6VfQEwvqNlgnzaxi705fO0QKnQB676tuucys+xqFBNUQZ43LTY07VXHhQV/fCT3mySchkNNwz5MlHa4+GjAaQDvUA8eoa6PccbYj3xDoSos8PTBL+rkQ+cGPUaOHI3fEJ7FgTUJRjwuKQjDCYpk3Z4MI08Z+yqV4CkrTtTjTn9vbfHKR8YNNTnT15DPTU++6tvm9TmCCWbMpkj3FyBoez/MkvqQbPcYgJfY/g9/Ke8TAc37zCoOesqgVvsEdTkVKRmXOGqdGMRYG4bdADJv/8DwPfMY7dyom5bb5nVybw8RAW+Of2cy9KEpL1KDZ1lgxVnxR8gvhdQRcQ/xpicsEgFJ3CeuLqGN2lt4DuYB0=----ATTACHMENT:----ODE5MTc4MTE1MTQ5ODg4NyA2NTc0MDM1MDMxMzc5NDEwIDE1ODQwNzAxNzgxMjYyNDE=