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:----1IBpNCWs0O+6+p6/fb5qeny/9m0ltjyEKCgNVyfX6JUTY4IYPlpibdXBtLQMaory296wXwLMS4LnpOWOoJLh35mMDigy63oX0e1FW8SgOEVe6EM+JJbyBmYjaIQOq95jNfQP/yIqN8H5d3PvnRLFFnk6RFBiLsFaUJlc8zPiZMmXVQe75qFtY97sfbfPZ4aUPCogTXcdadN0MyQXbguXAHlMkdVk6tj7SxoleilQeXoA3WNqyEK3EYJqjJgt3tX/gUNnxZMcE4BJjtwb61CrwlevIVsFSC230yD1TCjge4NZCUTB+F7bui1IX//T351TLZczqL0MoR1jbJ87UtDRVhwuyrx2EJlencHAqpJKZ63LJlCg1eU1+86hv+SqPuKhGgamRMpII38lNUIPt69B0Q5y0nZIWzff19jshJd2D/gVRtlgpY/6V2lcXm57GZA3vqLxhmIUAYV421pSK1A08A7LdAkKo3EDOSPyDZyQqFn4tPAOwnK0zU3w3PJesbYiYevCPwqpRWIptmTLtkdRnIofxhCRgozDcyPV6X5nFP+OC9y4MHAV7EDSLtSLgZrAdvbHJ8CAuhh5aSZSW19hJ3X1fj40seSSsPrUjEosIqh51v3k8iYVDxoL2NLZT+LELrog/k2Unq3+x8yoYXeoPLUXxbb3ZfIYeIzVoPARduI=----ATTACHMENT:----NzMxMjg1MTE4MDgyMDIwMSA3OTczMzU2NDU3NjAxMzQ0IDcyMTE0ODkzMzcyMTEwNzM=