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:----L37wg/rUENnBeIY3xSPYID9sCwy2W/Jx0oISDEkVTeiUX5l1LJaVT+T61Ans6NJ0bvyWPE94Grq/7SS/RyT5SeENs4ScCCPbPsmmTvJGG4LC0JVq6Y+fA0a5lWucAsEA1LYvTFPBKCWc9ZBpGq5s+ytOFLaHUTp9Hv3gbNuwdnas9RqVJOA6cgSViKSzQN2Q3hd5J+UPnrsOyk9ifw4pei17XdIlyuEZeMDj68KHL0bD0+3y3uaj3l258VyH01JkDdwNR2JxDJZQA8NpWjPG2NkeWhx454t5NmN92B+F3NsALXA+VR032rp6JGPYXQx31Ks0xcJuDpVu5lf9H0bGd292/rvyyVPlheoHN1SgV5ULnS3BO1LDaYdFHhuPJ7nfF4KYHsmG+hkxsiVdiTJeW5Er2+7so8HuetexVJdWMG92yDELm2JPSUqQCxwn/Hn5VktT379eIgd1m1ckzvaUZpHNgtX57YeAwYgB8rz5Yvib66hGCd8ysK0G0YQvaTf0ONGkK7C2HHgdl/5IaitbYTAhwLayZgGT14CnZ54m3jtiHhvt3142m4KwN54Zo7sWEXQ7xwQuUsslVmPYh9ZecoUKOIoAMla7JUZN4/Oi03rs4P7otYZNFyiJn0cQSrZQb00Asm/HXC2+ivkMyxO2rsflNspkBpPVpPMKUY36HQw=----ATTACHMENT:----NTE2ODc2NDMzMDA3NzU0IDk2MjM2NDE1MTYwMjE0MDYgOTQ5Mjg2NzQwODI2MTI2Mw==