Skip to content

Commit 4e376a2

Browse files
authored
Merge pull request #43 from InterNetX/PPM-1714
PPM-1714
2 parents a2cff72 + 04cc2fd commit 4e376a2

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "internetx/php-domainrobot-sdk",
3-
"version": "0.9.23",
3+
"version": "0.9.24",
44
"description": "A php package for easy integration of the domainrobot API powered by InterNetX GmbH.",
55
"type": "library",
66
"license": "MIT",

example/document/DocumentInfo.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
require_once "vendor/autoload.php";
3+
4+
use Domainrobot\Domainrobot;
5+
use Domainrobot\Lib\DomainrobotAuth;
6+
7+
$domainrobot = new Domainrobot([
8+
'url' => "https://api.autodns.com/v1",
9+
'auth' => new DomainrobotAuth([
10+
'user' => 'USER',
11+
'password' => 'PASS',
12+
'context' => 4
13+
])
14+
]);
15+
16+
17+
$targetFolder = 'path/to/folder/';
18+
$targetFile = 'price_list.xml';
19+
20+
$domainrobot->document->info('price_list.xml', $targetFolder . $targetFile);

src/Service/DocumentService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88

99
class DocumentService extends DomainrobotService
1010
{
11-
public function info($id, $fileURI)
11+
public function info($id, $targetFileURI)
1212
{
13-
$domainrobotPromise = $this->infoAsync($id, $fileURI);
13+
$domainrobotPromise = $this->infoAsync($id, $targetFileURI);
1414
$domainrobotResult = $domainrobotPromise->wait();
1515

1616
Domainrobot::setLastDomainrobotResult($domainrobotResult);
1717

1818
return $domainrobotResult->getStatusCode();
1919
}
2020

21-
public function infoAsync($id, $fileURI)
21+
public function infoAsync($id, $targetFileURI)
2222
{
2323
return $this->sendRequest(
2424
$this->domainrobotConfig->getUrl() . "/document/$id",
2525
'GET',
26-
['sink' => $fileURI]
26+
['sink' => $targetFileURI]
2727
);
2828
}
2929
}

0 commit comments

Comments
 (0)