1 | <?php |
||
50 | class BigBlueButton |
||
51 | { |
||
52 | private $securitySalt; |
||
53 | private $bbbServerBaseUrl; |
||
54 | private $urlBuilder; |
||
55 | |||
56 | public function __construct() |
||
57 | { |
||
58 | $this->securitySalt = getenv('BBB_SECURITY_SALT'); |
||
59 | $this->bbbServerBaseUrl = getenv('BBB_SERVER_BASE_URL'); |
||
60 | $this->urlBuilder = new UrlBuilder($this->securitySalt, $this->bbbServerBaseUrl); |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @return ApiVersionResponse |
||
65 | * |
||
66 | * @throws \RuntimeException |
||
67 | */ |
||
68 | public function getApiVersion() |
||
72 | |||
73 | /* __________________ BBB ADMINISTRATION METHODS _________________ */ |
||
74 | /* The methods in the following section support the following categories of the BBB API: |
||
75 | -- create |
||
76 | -- getDefaultConfigXML |
||
77 | -- join |
||
78 | -- end |
||
79 | */ |
||
80 | |||
81 | /** |
||
82 | * @param CreateMeetingParameters $createMeetingParams |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getCreateMeetingUrl($createMeetingParams) |
||
89 | |||
90 | /** |
||
91 | * @param CreateMeetingParameters $createMeetingParams |
||
92 | * @return CreateMeetingResponse |
||
93 | * @throws \RuntimeException |
||
94 | */ |
||
95 | public function createMeeting($createMeetingParams) |
||
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getDefaultConfigXMLUrl() |
||
109 | |||
110 | /** |
||
111 | * @return GetDefaultConfigXMLResponse |
||
112 | * @throws \RuntimeException |
||
113 | */ |
||
114 | public function getDefaultConfigXML() |
||
120 | |||
121 | /** |
||
122 | * @param $joinMeetingParams JoinMeetingParameters |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getJoinMeetingURL($joinMeetingParams) |
||
130 | |||
131 | /** |
||
132 | * @param $joinMeetingParams JoinMeetingParameters |
||
133 | * |
||
134 | * @return JoinMeetingResponse |
||
135 | * @throws \RuntimeException |
||
136 | */ |
||
137 | public function joinMeeting($joinMeetingParams) |
||
143 | |||
144 | /** |
||
145 | * @param $endParams EndMeetingParameters |
||
146 | * |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getEndMeetingURL($endParams) |
||
153 | |||
154 | /** |
||
155 | * @param $endParams EndMeetingParameters |
||
156 | * |
||
157 | * @return EndMeetingResponse |
||
158 | * @throws \RuntimeException |
||
159 | * */ |
||
160 | public function endMeeting($endParams) |
||
166 | |||
167 | /* __________________ BBB MONITORING METHODS _________________ */ |
||
168 | /* The methods in the following section support the following categories of the BBB API: |
||
169 | -- isMeetingRunning |
||
170 | -- getMeetings |
||
171 | -- getMeetingInfo |
||
172 | */ |
||
173 | |||
174 | /** |
||
175 | * @param $meetingParams IsMeetingRunningParameters |
||
176 | * @return string |
||
177 | */ |
||
178 | public function getIsMeetingRunningUrl($meetingParams) |
||
182 | |||
183 | /** |
||
184 | * @param $meetingParams |
||
185 | * @return IsMeetingRunningResponse |
||
186 | * @throws \RuntimeException |
||
187 | */ |
||
188 | public function isMeetingRunning($meetingParams) |
||
194 | |||
195 | /** |
||
196 | * @return string |
||
197 | */ |
||
198 | public function getMeetingsUrl() |
||
202 | |||
203 | /** |
||
204 | * @return GetMeetingsResponse |
||
205 | * @throws \RuntimeException |
||
206 | */ |
||
207 | public function getMeetings() |
||
213 | |||
214 | /** |
||
215 | * @param $meetingParams GetMeetingInfoParameters |
||
216 | * @return string |
||
217 | */ |
||
218 | public function getMeetingInfoUrl($meetingParams) |
||
222 | |||
223 | /** |
||
224 | * @param $meetingParams GetMeetingInfoParameters |
||
225 | * @return GetMeetingInfoResponse |
||
226 | * @throws \RuntimeException |
||
227 | */ |
||
228 | public function getMeetingInfo($meetingParams) |
||
234 | |||
235 | /* __________________ BBB RECORDING METHODS _________________ */ |
||
236 | /* The methods in the following section support the following categories of the BBB API: |
||
237 | -- getRecordings |
||
238 | -- publishRecordings |
||
239 | -- deleteRecordings |
||
240 | */ |
||
241 | |||
242 | /** |
||
243 | * @param $recordingsParams GetRecordingsParameters |
||
244 | * @return string |
||
245 | */ |
||
246 | public function getRecordingsUrl($recordingsParams) |
||
250 | |||
251 | /** |
||
252 | * @param $recordingParams |
||
253 | * @return GetRecordingsResponse |
||
254 | * @throws \RuntimeException |
||
255 | */ |
||
256 | public function getRecordings($recordingParams) |
||
262 | |||
263 | /** |
||
264 | * @param $recordingParams PublishRecordingsParameters |
||
265 | * @return string |
||
266 | */ |
||
267 | public function getPublishRecordingsUrl($recordingParams) |
||
271 | |||
272 | /** |
||
273 | * @param $recordingParams PublishRecordingsParameters |
||
274 | * @return PublishRecordingsResponse |
||
275 | * @throws \RuntimeException |
||
276 | */ |
||
277 | public function publishRecordings($recordingParams) |
||
283 | |||
284 | /** |
||
285 | * @param $recordingParams DeleteRecordingsParameters |
||
286 | * @return string |
||
287 | */ |
||
288 | public function getDeleteRecordingsUrl($recordingParams) |
||
292 | |||
293 | /** |
||
294 | * @param $recordingParams DeleteRecordingsParameters |
||
295 | * @return DeleteRecordingsResponse |
||
296 | * @throws \RuntimeException |
||
297 | */ |
||
298 | public function deleteRecordings($recordingParams) |
||
304 | |||
305 | /** |
||
306 | * @param $recordingParams UpdateRecordingsParameters |
||
307 | * @return string |
||
308 | */ |
||
309 | public function getUpdateRecordingsUrl($recordingParams) |
||
313 | |||
314 | /** |
||
315 | * @param $recordingParams UpdateRecordingsParameters |
||
316 | * @return UpdateRecordingsResponse |
||
317 | * @throws \RuntimeException |
||
318 | */ |
||
319 | public function updateRecordings($recordingParams) |
||
325 | |||
326 | /* ____________________ INTERNAL CLASS METHODS ___________________ */ |
||
327 | |||
328 | /** |
||
329 | * A private utility method used by other public methods to process XML responses. |
||
330 | * |
||
331 | * @param string $url |
||
332 | * @param string $xml |
||
333 | * @return SimpleXMLElement |
||
334 | * @throws \RuntimeException |
||
335 | */ |
||
336 | private function processXmlResponse($url, $xml = '') |
||
371 | } |
||
372 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: