Skip to content

Commit b7a5d62

Browse files
committed
DEV-6005
Signed-off-by: Christian Pleintinger <christian.pleintinger@internetx.com>
1 parent cae8af5 commit b7a5d62

File tree

3 files changed

+731
-323
lines changed

3 files changed

+731
-323
lines changed

example/domain/DomainWhois.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace Example;
4+
5+
use Domainrobot\Domainrobot;
6+
use Domainrobot\Lib\DomainrobotAuth;
7+
use Domainrobot\Lib\DomainrobotException;
8+
use Domainrobot\Model\Domain;
9+
10+
class SDKController
11+
{
12+
/**
13+
* Perform an Whois Request of an Domain
14+
*/
15+
public function domainWhois()
16+
{
17+
$domainrobot = new Domainrobot([
18+
"url" => "https://api.autodns.com/v1",
19+
"auth" => new DomainrobotAuth([
20+
"user" => "username",
21+
"password" => "password",
22+
"context" => 4
23+
])
24+
]);
25+
26+
try {
27+
$domain = $domainrobot->domain->whois("example.com");
28+
} catch (DomainrobotException $exception) {
29+
return $exception;
30+
}
31+
32+
return $domainrobot::getLastDomainrobotResult()->getResult();
33+
}
34+
}

src/Domainrobot.php

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ class Domainrobot
3737
private static $lastDomainrobotResult;
3838

3939
/**
40-
* Interface for all Certificate related requests
40+
* Interface for all certificate related requests
4141
*
4242
* @var CertificateService
4343
*/
4444
public $certificate;
4545

4646
/**
47-
* Interface for all DomainStudio related requests
47+
* Interface for all contact related requests
4848
*
49-
* @var DomainStudioService
49+
* @var ContactService
5050
*/
51-
public $domainStudio;
51+
public $contact;
5252

5353
/**
5454
* Interface for all domain related requests
@@ -58,130 +58,130 @@ class Domainrobot
5858
public $domain;
5959

6060
/**
61-
* Interface for Domain Bulk Requests
61+
* Interface for domain bulk Requests
6262
*
6363
* @var DomainBulkService
6464
*/
6565
public $domainBulk;
6666

6767
/**
68-
* Interface for all ssl contact related requests
68+
* Interface for all domain cancelation related requests
6969
*
70-
* @var SslContactService
70+
* @var DomainCancelationService
7171
*/
72-
public $sslContact;
72+
public $domainCancelation;
7373

7474
/**
75-
* Interface for all contact related requests
75+
* Interface for domainpremium Requests
7676
*
77-
* @var ContactService
77+
* @var DomainPremiumService
7878
*/
79-
public $contact;
79+
public $domainPremium;
8080

8181
/**
82-
* Interface for all domain cancelation related requests
82+
* Interface for all domainstudio related requests
8383
*
84-
* @var DomainCancelationService
84+
* @var DomainStudioService
8585
*/
86-
public $domainCancelation;
86+
public $domainStudio;
8787

8888
/**
89-
* Interface for all pollmessage related requests
89+
* Interface for job requests
9090
*
91-
* @var PollMessageService
91+
* @var JobService
9292
*/
93-
public $poll;
93+
public $job;
9494

9595
/**
96-
* Interface for all transferOut related requests
96+
* Interface for login Requests
9797
*
98-
* @var TransferOutService
98+
* @var LoginService
9999
*/
100-
public $transferOut;
100+
public $login;
101101

102102
/**
103-
* Interface for all domain trustedApp related requests
103+
* Interface for pcDomains Requests
104104
*
105-
* @var TrustedApplicationService
105+
* @var PcDomainsService
106106
*/
107-
public $trustedApp;
107+
public $pcDomains;
108108

109109
/**
110-
* Interface for all zone related requests
110+
* Interface for all pollmessage related requests
111111
*
112-
* @var ZoneService
112+
* @var PollMessageService
113113
*/
114-
public $zone;
114+
public $poll;
115115

116116
/**
117-
* Interface for all user related requests
117+
* Interface for accounting requests
118118
*
119-
* @var UserService
119+
* @var PriceService
120120
*/
121-
public $user;
121+
public $price;
122122

123123
/**
124-
* Interface all two factor authentication requests
124+
* Interface for redirect requests
125125
*
126-
* @var UserService
126+
* @var RedirectService
127127
*/
128-
public $user2fa;
128+
public $redirect;
129129

130130
/**
131-
* Interface for Accounting Requests
131+
* Interface for restore requests
132132
*
133-
* @var PriceService
133+
* @var RestoreService
134134
*/
135-
public $price;
135+
public $restore;
136136

137137
/**
138-
* Interface for Job Requests
138+
* Interface for all ssl contact related requests
139139
*
140-
* @var JobService
140+
* @var SslContactService
141141
*/
142-
public $job;
142+
public $sslContact;
143143

144144
/**
145-
* Interface for Restore Requests
145+
* Interface for all transferout related requests
146146
*
147-
* @var RestoreService
147+
* @var TransferOutService
148148
*/
149-
public $restore;
149+
public $transferOut;
150150

151151
/**
152-
* Interface for pcDomains Requests
152+
* Interface for all domain trustedapp related requests
153153
*
154-
* @var PcDomainsService
154+
* @var TrustedApplicationService
155155
*/
156-
public $pcDomains;
156+
public $trustedApp;
157157

158158
/**
159-
* Interface for Whois Requests
159+
* Interface for all user related requests
160160
*
161-
* @var WhoisService
161+
* @var UserService
162162
*/
163-
public $whois;
163+
public $user;
164164

165165
/**
166-
* Interface for Login Requests
166+
* Interface all two factor authentication requests
167167
*
168-
* @var LoginService
168+
* @var UserService
169169
*/
170-
public $login;
170+
public $user2fa;
171171

172172
/**
173-
* Interface for DomainPremium Requests
173+
* Interface for whois requests
174174
*
175-
* @var DomainPremiumService
175+
* @var WhoisService
176176
*/
177-
public $domainPremium;
177+
public $whois;
178178

179179
/**
180-
* Interface for Redirect Requests
180+
* Interface for all zone related requests
181181
*
182-
* @var RedirectService
182+
* @var ZoneService
183183
*/
184-
public $redirect;
184+
public $zone;
185185

186186
/**
187187
* [
@@ -195,26 +195,26 @@ public function __construct($domainrobotConfig = [])
195195
{
196196
$this->setDomainrobotConfig(new DomainrobotConfig($domainrobotConfig));
197197
$this->certificate = new CertificateService($this->domainrobotConfig);
198-
$this->domainStudio = new DomainStudioService($this->domainrobotConfig);
198+
$this->contact = new ContactService($this->domainrobotConfig);
199199
$this->domain = new DomainService($this->domainrobotConfig);
200200
$this->domainBulk = new DomainBulkService($this->domainrobotConfig);
201-
$this->sslContact = new SslContactService($this->domainrobotConfig);
202-
$this->contact = new ContactService($this->domainrobotConfig);
203201
$this->domainCancelation = new DomainCancelationService($this->domainrobotConfig);
202+
$this->domainPremium = new DomainPremiumService($this->domainrobotConfig);
203+
$this->domainStudio = new DomainStudioService($this->domainrobotConfig);
204+
$this->job = new JobService($this->domainrobotConfig);
205+
$this->login = new LoginService($this->domainrobotConfig);
206+
$this->pcDomains = new PcDomainsService($this->domainrobotConfig);
204207
$this->poll = new PollMessageService($this->domainrobotConfig);
208+
$this->price = new PriceService($this->domainrobotConfig);
209+
$this->redirect = new RedirectService($this->domainrobotConfig);
210+
$this->restore = new RestoreService($this->domainrobotConfig);
211+
$this->sslContact = new SslContactService($this->domainrobotConfig);
205212
$this->transferOut = new TransferOutService($this->domainrobotConfig);
206213
$this->trustedApp = new TrustedApplicationService($this->domainrobotConfig);
207-
$this->zone = new ZoneService($this->domainrobotConfig);
208214
$this->user = new UserService($this->domainrobotConfig);
209215
$this->user2fa = new User2faService($this->domainrobotConfig);
210-
$this->price = new PriceService($this->domainrobotConfig);
211-
$this->job = new JobService($this->domainrobotConfig);
212-
$this->restore = new RestoreService($this->domainrobotConfig);
213-
$this->pcDomains = new PcDomainsService($this->domainrobotConfig);
214216
$this->whois = new WhoisService($this->domainrobotConfig);
215-
$this->login = new LoginService($this->domainrobotConfig);
216-
$this->domainPremium = new DomainPremiumService($this->domainrobotConfig);
217-
$this->redirect = new RedirectService($this->domainrobotConfig);
217+
$this->zone = new ZoneService($this->domainrobotConfig);
218218
}
219219

220220
public function setDomainrobotConfig(DomainrobotConfig $domainrobotConfig)

0 commit comments

Comments
 (0)