1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ninjacto\OrtcPhp\Configs; |
4
|
|
|
|
5
|
|
|
class OrtcConfig |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* Realtime.co balanced url. |
9
|
|
|
* |
10
|
|
|
* @var string |
11
|
|
|
*/ |
12
|
|
|
protected $balancedUrl = 'https://ortc-developers.realtime.co/server/2.1?appkey={APP_KEY}'; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Your realtime.co application key. |
16
|
|
|
* |
17
|
|
|
* @var string |
18
|
|
|
*/ |
19
|
|
|
protected $applicationKey; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Your realtime.co private key. |
23
|
|
|
* |
24
|
|
|
* @var string |
25
|
|
|
*/ |
26
|
|
|
protected $privateKey; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* authentication path. |
30
|
|
|
* |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
protected $authenticationPath = '/authenticate'; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* send push message to channel(s) path. |
37
|
|
|
* |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
protected $sendPath = '/send'; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* maximum size of message chunk in bytes. |
44
|
|
|
* |
45
|
|
|
* @var int |
46
|
|
|
*/ |
47
|
|
|
protected $maxChunkSize = 700; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* maximum size of message chunk in bytes. |
51
|
|
|
* |
52
|
|
|
* @var int |
53
|
|
|
*/ |
54
|
|
|
protected $batchPoolSize = 5; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* pre concatenating string for every message chunks. |
58
|
|
|
* |
59
|
|
|
* @var string |
60
|
|
|
*/ |
61
|
|
|
protected $preMessageString = '{RANDOM}_{PART}-{TOTAL_PARTS}_'; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* verify ssl/tls certificate. |
65
|
|
|
* |
66
|
|
|
* @var bool |
67
|
|
|
*/ |
68
|
|
|
protected $verifySsl = true; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return string |
72
|
|
|
*/ |
73
|
5 |
|
public function getApplicationKey() |
74
|
|
|
{ |
75
|
5 |
|
return $this->applicationKey; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param string $applicationKey |
80
|
|
|
* @return $this |
81
|
|
|
*/ |
82
|
5 |
|
public function setApplicationKey($applicationKey) |
83
|
|
|
{ |
84
|
5 |
|
$this->applicationKey = $applicationKey; |
85
|
|
|
|
86
|
5 |
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return string |
91
|
|
|
*/ |
92
|
3 |
|
public function getBalancedUrl() |
93
|
|
|
{ |
94
|
3 |
|
return $this->balancedUrl; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param string $balancedUrl |
99
|
|
|
* @return $this |
100
|
|
|
*/ |
101
|
1 |
|
public function setBalancedUrl($balancedUrl) |
102
|
|
|
{ |
103
|
1 |
|
$this->balancedUrl = $balancedUrl; |
104
|
|
|
|
105
|
1 |
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return string |
110
|
|
|
*/ |
111
|
4 |
|
public function getPrivateKey() |
112
|
|
|
{ |
113
|
4 |
|
return $this->privateKey; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param string $privateKey |
118
|
|
|
* @return $this |
119
|
|
|
*/ |
120
|
3 |
|
public function setPrivateKey($privateKey) |
121
|
|
|
{ |
122
|
3 |
|
$this->privateKey = $privateKey; |
123
|
|
|
|
124
|
3 |
|
return $this; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @return string |
129
|
|
|
*/ |
130
|
3 |
|
public function getAuthenticationPath() |
131
|
|
|
{ |
132
|
3 |
|
return $this->authenticationPath; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @param string $authenticationPath |
137
|
|
|
* @return $this |
138
|
|
|
*/ |
139
|
1 |
|
public function setAuthenticationPath($authenticationPath) |
140
|
|
|
{ |
141
|
1 |
|
$this->authenticationPath = $authenticationPath; |
142
|
|
|
|
143
|
1 |
|
return $this; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @return string |
148
|
|
|
*/ |
149
|
3 |
|
public function getSendPath() |
150
|
|
|
{ |
151
|
3 |
|
return $this->sendPath; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @param string $sendPath |
156
|
|
|
* @return $this |
157
|
|
|
*/ |
158
|
1 |
|
public function setSendPath($sendPath) |
159
|
|
|
{ |
160
|
1 |
|
$this->sendPath = $sendPath; |
161
|
|
|
|
162
|
1 |
|
return $this; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @return int |
167
|
|
|
*/ |
168
|
3 |
|
public function getMaxChunkSize() |
169
|
|
|
{ |
170
|
3 |
|
return $this->maxChunkSize; |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* @param int $maxChunkSize |
175
|
|
|
* @return $this |
176
|
|
|
*/ |
177
|
2 |
|
public function setMaxChunkSize($maxChunkSize) |
178
|
|
|
{ |
179
|
2 |
|
$this->maxChunkSize = $maxChunkSize; |
180
|
|
|
|
181
|
2 |
|
return $this; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @return string |
186
|
|
|
*/ |
187
|
3 |
|
public function getPreMessageString() |
188
|
|
|
{ |
189
|
3 |
|
return $this->preMessageString; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @param string $preMessageString |
194
|
|
|
* @return $this |
195
|
|
|
*/ |
196
|
1 |
|
public function setPreMessageString($preMessageString) |
197
|
|
|
{ |
198
|
1 |
|
$this->preMessageString = $preMessageString; |
199
|
|
|
|
200
|
1 |
|
return $this; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @return bool |
205
|
|
|
*/ |
206
|
1 |
|
public function isVerifySsl() |
207
|
|
|
{ |
208
|
1 |
|
return $this->verifySsl; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* @param bool $verifySsl |
213
|
|
|
* @return $this |
214
|
|
|
*/ |
215
|
1 |
|
public function setVerifySsl($verifySsl) |
216
|
|
|
{ |
217
|
1 |
|
$this->verifySsl = (bool) $verifySsl; |
218
|
|
|
|
219
|
1 |
|
return $this; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* @return int |
224
|
|
|
*/ |
225
|
2 |
|
public function getBatchPoolSize() |
226
|
|
|
{ |
227
|
2 |
|
return $this->batchPoolSize; |
228
|
|
|
} |
229
|
|
|
|
230
|
|
|
/** |
231
|
|
|
* @param int $batchPoolSize |
232
|
|
|
* @return $this |
233
|
|
|
*/ |
234
|
1 |
|
public function setBatchPoolSize($batchPoolSize) |
235
|
|
|
{ |
236
|
1 |
|
$this->batchPoolSize = $batchPoolSize; |
237
|
|
|
|
238
|
1 |
|
return $this; |
239
|
|
|
} |
240
|
|
|
} |
241
|
|
|
|