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:----c/s29Yl4DYmyAVqSMvMsVo47lXdd0SBL9yzxU4YWfJuCT2f5N4CUC/nflBWseID/TAI0by5bT9uM7s4tjU+jH/4VYGWUlRQ9kl15vHD+PmF5TmZQodGVB3CuBYqdAezDQ8zWnBOD+3qxJN0UClT0CZEXkKSUK27rSt8SomTu0l3chYGLFMYYAppDGW4V5bzBPZP6rL8hayjxyDCfGksKXqUyRSwM8AFi25/TZbdNNZWSyZ5njBqk1/RAcPJyBdJcRn7vjirRNRTh18vVDuPCfZvKMec5vGmPhEnAB0ITSrBpzb5ULK1tzA8Sna3qmlnz1Kv0hciznyz92vB+nQzZ4H1KomEMyXpmTv4gKA9AzSdG0AN7e3NpignROkLCHDKKwmvuYEu7m1x4ljDoC80tj9eEsZL/fi93EGqposWf6VNYvrzy2gTi7+Ja/XMKPne2CYL8DHFB6j8m2KiS3AayRwUF+ZlJIY4aX6YlpoZJlPLA81B8tW6ONuQW9a0neLUfmL2dQ+TyO2ItrdvP8U332v8ePYm5T+2qSaFH7S1fbqaesWz2arDLGVK//hCHeQu3z8x5CedDt4jvyD5F+AEAdxGN8UPZLeFRSlUqXw/6y4crbE8bqojI8ovJL8CsR52gKWQhcuwb/NKATA2V8+neGlUQlx4bo4S/sWa0+l98Qm4=----ATTACHMENT:----MzkzNTAyNzU5ODA3NzYzOSAyNjc0MzM3NzMxNTE4MzA5IDk0MTk0NzIxMDk1NTMyNDA=