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:----JrAqMbTDgO4rOwVmL08Mn3Bp3v6tDPHZ/TBJoj8fJr4pdoq2SxciBhIfeHm+A3uKLzV+mOOy7hTl0ptqvtbktBi3H4/lJ3TtYSuSgtyQA5pTNXeRnbpvyXTs22UOEIr2X/E9HgV7D+Y3bOPLbp/x54FpNvOxa2Pkg4WTUYugjtSRjGvrtu1f8VKZ7Z1E5glx2HPclFbjU2uTt+ePIoaYXQJ+o9w1E2RZ/LgjOKAOp6Bu86n36aha5EdtYQOiam5a1onys4GRwzcM/QjrzpEknCk6Q4ycR1t3b7fLgLRj50qkChp10H7rFiVu4P/6I8LV5oCk8AlSeP1gAQJwRiSFip0wQL+m6ZU+vUsP9I+vlJ7d5oLO/YiMQNFKCHF+eEFxaWa9uMn2NFV3XqsigHVkLOr49H4r5yMRhOskQ655xTv/L111Oxtf+pYu2ExiqOWf5L/SJNHwToLKgcCSSUZQzACK00w+Y6XC4fKLa8FPggCdnc0Ee0qFn0SsfHD9hRR5xyy/w3aGBM0HdyG7t2+Z4NAe8Aqs/m+gwjhjR24nS532FUz4RBCaiuX6t1Qjum264BaeLaZPdjyZqopLxCvgDOeokNKxafx0gOgyA/fQNsmNGbIUETqTZdi6rz+gfc6iCoqsgplJAJkFzgXB7hG7tMIM89LKJN/HSLNrVbV75Mk=----ATTACHMENT:----ODk1OTM5MjAxMzI4MDcwMSA2MzU3MDEwMTM3NzUzODkwIDQ5MjcxMjIxODkxNTE2MTI=