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:----UZgHKE2Y8uQqEw5ty63afOsW06c0MAeepAxtJYhENPUApdjNyD8vi+9Vt3FvXQG2nMjZK3/X4N0c5p2PR+sRrRHgTU2nGP+Xw9olYOZOpstZoHh2viNtPI10ZoIEHWfmE3T8YnYZkTmi2/65itc7gpGh8KkRwlayWLb52MpcVIO8CI+ynvmj/ZiWIr49XS+vj4qlPL7edvUAtNh2F9/egD7FWIRLHaYGFo1WFRPpP777HUAbMCZAp16E82Zq1/ZkOP5XKnuWCzqxmRALnPLog8Y+DsUO6QJLnKe3DdC1Tn3CG5QC2RpUaGIGBsgZLp4RV4+jnFqwtBLovYb1ZxTFdsJ206C2cMzzMYl3D+/vkx9QqEb4qIF71FwFogGIURG/ipBDBCeg5wxZMTr1krTrs6vpkkZyVCFbB88xPMw3w8Kz2EoXLDp0S7lD76oK02VUeFBbYLJ9je+s7ZZuto1yhYzmVCKEfSuLEbTdFUirPnnrKGADg6PxPp2DcWS33NDuD1EjiNh1qU3is15Xg/XTPuQyU6/0jN49mbCaId2AfC781bCURlr7s6n6Q4wbjVVgIcwOhb6VPYnqgEsUuA3th+TKkVBqm1Y9FyWdtAgjChap3aXfxZwXMnELtj8is85cyoE2VkG4MpvLRfiIHKKAXkFgE0qKujBNN9MphMkYVfc=----ATTACHMENT:----NzM2MTk2MTc0NDQ1MDU0MyA2MDIyNTc5NTI3MTg5MDExIDg5NTc4MzAyMTQxNDgyNDY=