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:----Q5j+A3UD7JI2ZpJgnzY1swITL4VSeRJrRph9EuXX9T+X9jxo5Vk4JLQb1hJpqaD4LKbq55szWiwl8UPsouKG/GGh6FsWtDasq6iDa58u5/fdevWr/hiVZSp4hTxdCEURmqVLf3vXqRaeOWMPg7zlvt9d2gHTCAoD0ZHRgxH49fYW/pJP8dzidXckR+03MlVC/hjI9RwEzWzkikLQFYNoCkxPfIrUZ31at7SwVnCtcYGQj6A0DJkjvW01duji2CujV4sufs5hhSjGuOA+CvhdJgszrko2m5MHCfY9KZmDG+ZmnMCgyQknrjIqIp44mVtUDKR6scq0jbNxmhcuQKIKfWwLpUPj2nZSviWEdkd8VwAJK4CjsKgZ/ZeMrGRO5VGTwn5J6x+vK3g/f8hzyWMMUQGY0HUN+fclamLOipjnLxC+OHpRzv0TNnmU7RTQFwDQpb8ITKMoGGgR5qdL3zrcNTeAY07TsfKmRe7BKbdPEwu0xwuISOcepkMEJgmBZSnJhVtLIQBBfLVIij3Q4TIlKcSANpcasKAWW3x/AvFfM3GOkNV5txX1xu4FHIlPlDERgazLsMGqkWCtD+aFnZNpJu3QfG9qHAcCI8xqQR0aRIuOmlRDU8y4sq5eZCW6/us2qh7IvXx7/G/tlEdK1TqeJAD1uEJByjHKVMbThhLqtmY=----ATTACHMENT:----MTQxMDY5ODExMTQzNjE1IDcwMDc2MTI1MjEzMTA0MjcgNzE4MzYxNTM1NjExODY1Nw==