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:----cb5+sbshJlA6VFKOG9C6ZxpAHrh1xWwlk6ol6f8E5OmUZ+ZTReYC0k1QVRpAnWe4NXfToVTfj4ohwneD7ogj38jcIBy2uJKhRGiLT1gocI892rIG14a/9zoXUria3xdj988rQlU61PK/T7h8roXz8H0A/IHsfMpXcFryJ286cik1h8jfbIOr/IRMCJnbXBKreXWfzqLYlmOrssVCGZxCUglE5mgAI1q/04rVJpFRQIdg+YbLH3L/vcV0b76nJj4w8pnoSQtFJU2hmDUL1dVY903InVTFQuDd7+mBexbj0EZqhkGqtsU4XM9BqdcbJ5VdyVQGJ4F9Lx5jwhP4t8tu8qqLGKjRB3DK8G/xm6/N0HWTlltQtri8nfuAtOXSmP6O7uIKufTsgm9xhjiCj1yDLotWhdy7pJ/3mzjYX2biR2FKnFg4ZDQKaXhF2quDtGgfkgbrgRN4iJ+T8lKpkjDn8PpR0Vqk5VEKwodHgv3K0iB6BVqvwfBUMsk7MsBFkoe4iZKrUlauhzgYwiI2ZyfmEOfm2b0EViLGZrpV7lw9fZkloekwpfLwaGlCyA14n7votzFMPr5G44Yk9P+EXl2edsxwAsNQlyov3TtUhigwLGkZRa/k7gySjrQi/6GHtFb1TfifAH1K1aS8eulK2+UpVKJC3OEAKgbAO6ZLUPl8rpc=----ATTACHMENT:----ODA5ODg4NzkwNzcxOTgwMCA2MjgxODgxNzM3OTUxNTEgNzc3MjM1MDAyODg5Mzc2OQ==