-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New setup for parsing the responses from bNamed
- Loading branch information
Marc
committed
May 24, 2024
1 parent
e026c37
commit b4ade91
Showing
11 changed files
with
125 additions
and
121 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace Mvdgeijn\BNamed\Responses; | ||
|
||
use SimpleXMLElement; | ||
|
||
class GetDomainResponse extends Response | ||
{ | ||
public string $sld; | ||
|
||
public string $tld; | ||
|
||
public string $statusCode; | ||
|
||
public string $statusText; | ||
|
||
public string $dnsType; | ||
|
||
public array $dnsServers; | ||
|
||
public array $dnsIpList; | ||
|
||
public string $authKey; | ||
|
||
public bool $transferLock; | ||
|
||
public \Carbon $expiration; | ||
|
||
public \Carbon $renewlDeadline; | ||
|
||
public \Carbon $registrationISO; | ||
|
||
public string $extendType; | ||
|
||
public bool $trustee; | ||
|
||
public function __construct(SimpleXMLElement $element) | ||
{ | ||
$this->tld = (string)$element->Result->TLD; | ||
|
||
$this->sld = (string)$element->Result->SLD; | ||
|
||
$this->statusCode = (string)$element->Result->StatusCode; | ||
|
||
$this->statusText = (string)$element->Result->StatusText; | ||
|
||
$this->dnsType = (string)$element->Result->DNSType; | ||
|
||
$this->authKey = (string)$element->Result->AuthKey; | ||
|
||
$this->trustee = ( (string)$element->Result->Trustee == "true" ); | ||
|
||
$this->transferLock = ( (string)$element->Result->TransferLock == "true"); | ||
|
||
$this->expiration = \Carbon::parseFromLocale( (string)$element->Result->Expiration ); | ||
|
||
$this->renewlDeadline = \Carbon::parseFromLocale( (string)$element->Result->RenewalDeadline ); | ||
|
||
$this->registrationISO = \Carbon::parseFromLocale( (string)$element->Result->RegistrationISO ); | ||
|
||
$this->dnsServers = explode(",", (string)$element->Result->DNSList ); | ||
|
||
$this->dnsIpList = explode( ",", (string)$element->Result->DNSIPList ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Mvdgeijn\BNamed\Responses; | ||
|
||
class Response | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Mvdgeijn\BNamed\Responses; | ||
|
||
class TLDAllResponse extends Response | ||
{ | ||
public array $data = []; | ||
public function __construct( \SimpleXMLElement $element ) | ||
{ | ||
foreach( $element->Result->TLDs->children() as $tld ) { | ||
$this->data[] = new TLDResponse( $tld ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.