|
1
|
|
|
<?php |
|
2
|
|
|
declare(strict_types=1); |
|
3
|
|
|
|
|
4
|
|
|
/** |
|
5
|
|
|
* The Imaging Source Download System PHP Wrapper |
|
6
|
|
|
* |
|
7
|
|
|
* PHP wrapper for The Imaging Source Download System Web API. Authored and supported by The Imaging Source Europe GmbH. |
|
8
|
|
|
* |
|
9
|
|
|
* @link http://dl-gui.theimagingsource.com to learn more about The Imaging Source Download System |
|
10
|
|
|
* @link https://github.com/jonathanmaron/theimagingsource-tisd-sdk for the canonical source repository |
|
11
|
|
|
* @license https://github.com/jonathanmaron/theimagingsource-tisd-sdk/blob/master/LICENSE.md |
|
12
|
|
|
* @copyright © 2022 The Imaging Source Europe GmbH |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
namespace Tisd\Sdk\Defaults; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Class Defaults |
|
19
|
|
|
* |
|
20
|
|
|
* @package Tisd\Sdk\Defaults |
|
21
|
|
|
*/ |
|
22
|
|
|
class Defaults extends AbstractDefaults |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* Defaults constructor |
|
26
|
|
|
*/ |
|
27
|
56 |
|
public function __construct() |
|
28
|
|
|
{ |
|
29
|
56 |
|
$this->setContext(''); |
|
30
|
56 |
|
$this->setHostname(self::HOSTNAME_PRODUCTION); |
|
31
|
56 |
|
$this->setLocale(self::LOCALE); |
|
32
|
56 |
|
$this->setTimeout(self::TIMEOUT); |
|
33
|
56 |
|
$this->setTtl(self::TTL); |
|
34
|
56 |
|
$this->setVersion(self::VERSION); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Get the context |
|
39
|
|
|
* |
|
40
|
|
|
* @return string |
|
41
|
|
|
*/ |
|
42
|
48 |
|
public function getContext(): string |
|
43
|
|
|
{ |
|
44
|
48 |
|
return $this->context; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* Set the context |
|
49
|
|
|
* |
|
50
|
|
|
* @param string $context |
|
51
|
|
|
* |
|
52
|
|
|
* @return $this |
|
53
|
|
|
*/ |
|
54
|
56 |
|
public function setContext(string $context): self |
|
55
|
|
|
{ |
|
56
|
56 |
|
$this->context = $context; |
|
57
|
|
|
|
|
58
|
56 |
|
return $this; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Get the hostname |
|
63
|
|
|
* |
|
64
|
|
|
* @return string |
|
65
|
|
|
*/ |
|
66
|
48 |
|
public function getHostname(): string |
|
67
|
|
|
{ |
|
68
|
48 |
|
return $this->hostname; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* Set the hostname |
|
73
|
|
|
* |
|
74
|
|
|
* @param string $hostname |
|
75
|
|
|
* |
|
76
|
|
|
* @return $this |
|
77
|
|
|
*/ |
|
78
|
56 |
|
public function setHostname(string $hostname): self |
|
79
|
|
|
{ |
|
80
|
56 |
|
$this->hostname = $hostname; |
|
81
|
|
|
|
|
82
|
56 |
|
return $this; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* Get the locale |
|
87
|
|
|
* |
|
88
|
|
|
* @return string |
|
89
|
|
|
*/ |
|
90
|
48 |
|
public function getLocale(): string |
|
91
|
|
|
{ |
|
92
|
48 |
|
return $this->locale; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* Set the locale |
|
97
|
|
|
* |
|
98
|
|
|
* @param string $locale |
|
99
|
|
|
* |
|
100
|
|
|
* @return $this |
|
101
|
|
|
*/ |
|
102
|
56 |
|
public function setLocale(string $locale): self |
|
103
|
|
|
{ |
|
104
|
56 |
|
$this->locale = $locale; |
|
105
|
|
|
|
|
106
|
56 |
|
return $this; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* Get the timeout |
|
111
|
|
|
* |
|
112
|
|
|
* @return int |
|
113
|
|
|
*/ |
|
114
|
48 |
|
public function getTimeout(): int |
|
115
|
|
|
{ |
|
116
|
48 |
|
return $this->timeout; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
/** |
|
120
|
|
|
* Set the timeout |
|
121
|
|
|
* |
|
122
|
|
|
* @param int $timeout |
|
123
|
|
|
* |
|
124
|
|
|
* @return $this |
|
125
|
|
|
*/ |
|
126
|
56 |
|
public function setTimeout(int $timeout): self |
|
127
|
|
|
{ |
|
128
|
56 |
|
$this->timeout = $timeout; |
|
129
|
|
|
|
|
130
|
56 |
|
return $this; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
/** |
|
134
|
|
|
* Get the time-to-live |
|
135
|
|
|
* |
|
136
|
|
|
* @return int |
|
137
|
|
|
*/ |
|
138
|
|
|
public function getTtl(): int |
|
139
|
|
|
{ |
|
140
|
|
|
return $this->ttl; |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
/** |
|
144
|
|
|
* Set the time-to-live |
|
145
|
|
|
* |
|
146
|
|
|
* @param int $ttl |
|
147
|
|
|
* |
|
148
|
|
|
* @return $this |
|
149
|
|
|
*/ |
|
150
|
56 |
|
public function setTtl(int $ttl): self |
|
151
|
|
|
{ |
|
152
|
56 |
|
$this->ttl = $ttl; |
|
153
|
|
|
|
|
154
|
56 |
|
return $this; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* Get the version |
|
159
|
|
|
* |
|
160
|
|
|
* @return string |
|
161
|
|
|
*/ |
|
162
|
48 |
|
public function getVersion(): string |
|
163
|
|
|
{ |
|
164
|
48 |
|
return $this->version; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
/** |
|
168
|
|
|
* Set the version |
|
169
|
|
|
* |
|
170
|
|
|
* @param string $version |
|
171
|
|
|
* |
|
172
|
|
|
* @return $this |
|
173
|
|
|
*/ |
|
174
|
56 |
|
public function setVersion(string $version): self |
|
175
|
|
|
{ |
|
176
|
56 |
|
$this->version = $version; |
|
177
|
|
|
|
|
178
|
56 |
|
return $this; |
|
179
|
|
|
} |
|
180
|
|
|
} |
|
181
|
|
|
|