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:----U/Z8LHeT1xVcyY/QGtk/NiuscdhUhyLvaSJ8qWcJKefQ/g1gFkala/3Aqi7QJBfNm0D/gchtSBQFc1weWno8f7EmiT29TXSSFXWnfewdPWzOBZiPfbqEsfbEK5OvcwffXm//f+mD9n6Ze4zzaOhX57CwxhFU0OwyBp4MZjDO/+HxIvou/3m/OWZ6G87JYzTk1YsZJBW42mGU1Lx6/aMhyOzRXH1PmHvkvbR7xZMSsod/aOOtmH7lPAH850tt1UrFPACkwyML+YuoS7NT47i+RYOheooyegiT9REFePd9xm1CY6YeFaMDqFMh6BgyNJ7hMgC1NnhhYAM2M9LWO/IHNwwuIrWea+6wjqspa6KHF/I9PkhdS0neFucTFvyyVRRcR/vx65dQeHbUQhj9o4sCu87uUYWmC019EHtjtD8WGYp6Y8xWN+siTxlfTCEeNbKs2CRxg3NB92HbBI5FTK4B7Q0wK0S55bppXvQVyHrGbPspjVZDqwqk6MSSzseA9fhy9YMQgC7QFFB2J+MI+wtduR5uOrSfAXoXGqiDyWaou7QiPB4OZsaEgBsoxbTwPFSckiGKTv1D8G2YgoHhthW/uT9WVQLtdrySaeqewHUSwz43+cWx6g60I5+zYkg3L55YY9FH2nK96autMpQUYUB/NCEjyeDjzPsCEo1pOfdXH0s=----ATTACHMENT:----MjM0NTQ1MjkzNjIxNzEzNiA2ODI3OTI0Mzc5NzUwNTE5IDkxOTMzMDU0MjY1NjU4NzI=