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:----mIBoETf6dAYwaQaQTJAhxn7AML20BRCxZ5LkApjfYHkKz1/p0kirhAZW/kI1gBk3+E629wu/hjrM1xaIg8fa3hMch9UzH7x2rf1lqUs/FttGKzMKR1Lgwpg60WmIzSVhgfnx0+TBoR/ZkWXGHjA0qK3AaQfxetZPv2OWuRceaZUaNyQ0dauQTlbPk4kemNlL1eq8fZzVIz/q7pGq8VDVhOxSs1rvQgeZ+gQkgQ4G46edgpy9jE1T2OwJS6nYDbxo935kq5nrPl5N+KMdzYvIBysxRkRiouAiqJJ/2arQ7JUvNAnHNCslmHfLcKKBJaze7/gAFsynO8A9Gn4+CQIKM7OMtSw41f1mRdSC8gb4SqDFSfV7Vp2kzQylox3unXjF1PzyHnCpugrzM7EzsxYspquMaE1p26I0ui1VmaJ7Km+a7mHPmYpvVgCR1Agmyc+YlS8gILAzmEW6q18XoG9P0JSMUniwJBSS2CU2HiUSZpTYheG2b1giQeNzk39faJHTNyX14q/ffcHOD784/geESoxOAyehXYWrBD8BsQfleZW0FLS8HX5Lpx2DH/xmPMo0cKtAtZZPJ+RmNn7J9Qt/w7InAStGHCiavGbLZjq58RJ1GUrufavD47QiWM9zuDjrMVJ4xPWpCP30xyqvZ/H0ZSrxW5lejRtIFlmJ5MF81vI=----ATTACHMENT:----NTYxMDM2MzQ1MjAwNDQ0NiA4NDI4MzgyOTIyNjYwNTczIDYwMDY4OTQwNjQ0NTc1NTk=