|
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
|
|
|
public function getApplicationKey() |
|
74
|
|
|
{ |
|
75
|
|
|
return $this->applicationKey; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* @param string $applicationKey |
|
80
|
|
|
* @return $this |
|
81
|
|
|
*/ |
|
82
|
|
|
public function setApplicationKey($applicationKey) |
|
83
|
|
|
{ |
|
84
|
|
|
$this->applicationKey = $applicationKey; |
|
85
|
|
|
|
|
86
|
|
|
return $this; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @return string |
|
91
|
|
|
*/ |
|
92
|
|
|
public function getBalancedUrl() |
|
93
|
|
|
{ |
|
94
|
|
|
return $this->balancedUrl; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* @param string $balancedUrl |
|
99
|
|
|
* @return $this |
|
100
|
|
|
*/ |
|
101
|
|
|
public function setBalancedUrl($balancedUrl) |
|
102
|
|
|
{ |
|
103
|
|
|
$this->balancedUrl = $balancedUrl; |
|
104
|
|
|
|
|
105
|
|
|
return $this; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* @return string |
|
110
|
|
|
*/ |
|
111
|
|
|
public function getPrivateKey() |
|
112
|
|
|
{ |
|
113
|
|
|
return $this->privateKey; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @param string $privateKey |
|
118
|
|
|
* @return $this |
|
119
|
|
|
*/ |
|
120
|
|
|
public function setPrivateKey($privateKey) |
|
121
|
|
|
{ |
|
122
|
|
|
$this->privateKey = $privateKey; |
|
123
|
|
|
|
|
124
|
|
|
return $this; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* @return string |
|
129
|
|
|
*/ |
|
130
|
|
|
public function getAuthenticationPath() |
|
131
|
|
|
{ |
|
132
|
|
|
return $this->authenticationPath; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* @param string $authenticationPath |
|
137
|
|
|
* @return $this |
|
138
|
|
|
*/ |
|
139
|
|
|
public function setAuthenticationPath($authenticationPath) |
|
140
|
|
|
{ |
|
141
|
|
|
$this->authenticationPath = $authenticationPath; |
|
142
|
|
|
|
|
143
|
|
|
return $this; |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
/** |
|
147
|
|
|
* @return string |
|
148
|
|
|
*/ |
|
149
|
|
|
public function getSendPath() |
|
150
|
|
|
{ |
|
151
|
|
|
return $this->sendPath; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* @param string $sendPath |
|
156
|
|
|
* @return $this |
|
157
|
|
|
*/ |
|
158
|
|
|
public function setSendPath($sendPath) |
|
159
|
|
|
{ |
|
160
|
|
|
$this->sendPath = $sendPath; |
|
161
|
|
|
|
|
162
|
|
|
return $this; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
/** |
|
166
|
|
|
* @return int |
|
167
|
|
|
*/ |
|
168
|
|
|
public function getMaxChunkSize() |
|
169
|
|
|
{ |
|
170
|
|
|
return $this->maxChunkSize; |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
/** |
|
174
|
|
|
* @param int $maxChunkSize |
|
175
|
|
|
* @return $this |
|
176
|
|
|
*/ |
|
177
|
|
|
public function setMaxChunkSize($maxChunkSize) |
|
178
|
|
|
{ |
|
179
|
|
|
$this->maxChunkSize = $maxChunkSize; |
|
180
|
|
|
|
|
181
|
|
|
return $this; |
|
182
|
|
|
} |
|
183
|
|
|
|
|
184
|
|
|
/** |
|
185
|
|
|
* @return string |
|
186
|
|
|
*/ |
|
187
|
|
|
public function getPreMessageString() |
|
188
|
|
|
{ |
|
189
|
|
|
return $this->preMessageString; |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
/** |
|
193
|
|
|
* @param string $preMessageString |
|
194
|
|
|
* @return $this |
|
195
|
|
|
*/ |
|
196
|
|
|
public function setPreMessageString($preMessageString) |
|
197
|
|
|
{ |
|
198
|
|
|
$this->preMessageString = $preMessageString; |
|
199
|
|
|
|
|
200
|
|
|
return $this; |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
/** |
|
204
|
|
|
* @return bool |
|
205
|
|
|
*/ |
|
206
|
|
|
public function isVerifySsl() |
|
207
|
|
|
{ |
|
208
|
|
|
return $this->verifySsl; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
/** |
|
212
|
|
|
* @param bool $verifySsl |
|
213
|
|
|
* @return $this |
|
214
|
|
|
*/ |
|
215
|
|
|
public function setVerifySsl($verifySsl) |
|
216
|
|
|
{ |
|
217
|
|
|
$this->verifySsl = (bool)$verifySsl; |
|
218
|
|
|
|
|
219
|
|
|
return $this; |
|
220
|
|
|
} |
|
221
|
|
|
|
|
222
|
|
|
/** |
|
223
|
|
|
* @return int |
|
224
|
|
|
*/ |
|
225
|
|
|
public function getBatchPoolSize() |
|
226
|
|
|
{ |
|
227
|
|
|
return $this->batchPoolSize; |
|
228
|
|
|
} |
|
229
|
|
|
|
|
230
|
|
|
/** |
|
231
|
|
|
* @param int $batchPoolSize |
|
232
|
|
|
* @return $this |
|
233
|
|
|
*/ |
|
234
|
|
|
public function setBatchPoolSize($batchPoolSize) |
|
235
|
|
|
{ |
|
236
|
|
|
$this->batchPoolSize = $batchPoolSize; |
|
237
|
|
|
|
|
238
|
|
|
return $this; |
|
239
|
|
|
} |
|
240
|
|
|
} |
|
241
|
|
|
|