1 | <?php |
||
47 | class BigBlueButton |
||
48 | { |
||
49 | private $securitySalt; |
||
50 | private $bbbServerBaseUrl; |
||
51 | private $urlBuilder; |
||
52 | |||
53 | public function __construct() |
||
59 | |||
60 | /** |
||
61 | * @return ApiVersionResponse |
||
62 | * |
||
63 | * @throws \Exception |
||
64 | */ |
||
65 | public function getApiVersion() |
||
69 | |||
70 | /* __________________ BBB ADMINISTRATION METHODS _________________ */ |
||
71 | /* The methods in the following section support the following categories of the BBB API: |
||
72 | -- create |
||
73 | -- getDefaultConfigXML |
||
74 | -- join |
||
75 | -- end |
||
76 | */ |
||
77 | |||
78 | /** |
||
79 | * @param $createMeetingParams CreateMeetingParameters |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getCreateMeetingUrl($createMeetingParams) |
||
87 | |||
88 | /** |
||
89 | * @param CreateMeetingParameters $createMeetingParams |
||
90 | * @return CreateMeetingResponse |
||
91 | * @throws \Exception |
||
92 | */ |
||
93 | public function createMeeting($createMeetingParams) |
||
99 | |||
100 | /** |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getDefaultConfigXMLUrl() |
||
107 | |||
108 | /** |
||
109 | * |
||
110 | * @return GetDefaultConfigXMLResponse |
||
111 | */ |
||
112 | public function getDefaultConfigXML() |
||
118 | |||
119 | /** |
||
120 | * @param $joinMeetingParams JoinMeetingParameters |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | public function getJoinMeetingURL($joinMeetingParams) |
||
128 | |||
129 | /** |
||
130 | * @param $endParams EndMeetingParameters |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getEndMeetingURL($endParams) |
||
138 | |||
139 | /** |
||
140 | * @param $endParams EndMeetingParameters |
||
141 | * |
||
142 | * @return EndMeetingResponse |
||
143 | */ |
||
144 | public function endMeeting($endParams) |
||
150 | |||
151 | /* __________________ BBB MONITORING METHODS _________________ */ |
||
152 | /* The methods in the following section support the following categories of the BBB API: |
||
153 | -- isMeetingRunning |
||
154 | -- getMeetings |
||
155 | -- getMeetingInfo |
||
156 | */ |
||
157 | |||
158 | /** |
||
159 | * @param $meetingParams IsMeetingRunningParameters |
||
160 | * @return string |
||
161 | */ |
||
162 | public function getIsMeetingRunningUrl($meetingParams) |
||
166 | |||
167 | /** |
||
168 | * @param $meetingParams |
||
169 | * @return IsMeetingRunningResponse |
||
170 | * @throws \Exception |
||
171 | */ |
||
172 | public function isMeetingRunning($meetingParams) |
||
178 | |||
179 | /** |
||
180 | * @return string |
||
181 | */ |
||
182 | public function getMeetingsUrl() |
||
186 | |||
187 | /** |
||
188 | * @return GetMeetingsResponse |
||
189 | */ |
||
190 | public function getMeetings() |
||
196 | |||
197 | /** |
||
198 | * @param $meetingParams GetMeetingInfoParameters |
||
199 | * @return string |
||
200 | */ |
||
201 | public function getMeetingInfoUrl($meetingParams) |
||
205 | |||
206 | /** |
||
207 | * @param $meetingParams GetMeetingInfoParameters |
||
208 | * @return GetMeetingInfoResponse |
||
209 | */ |
||
210 | public function getMeetingInfo($meetingParams) |
||
216 | |||
217 | /* __________________ BBB RECORDING METHODS _________________ */ |
||
218 | /* The methods in the following section support the following categories of the BBB API: |
||
219 | -- getRecordings |
||
220 | -- publishRecordings |
||
221 | -- deleteRecordings |
||
222 | */ |
||
223 | |||
224 | /** |
||
225 | * @param $recordingsParams GetRecordingsParameters |
||
226 | * @return string |
||
227 | */ |
||
228 | public function getRecordingsUrl($recordingsParams) |
||
232 | |||
233 | /** |
||
234 | * @param $recordingParams |
||
235 | * @return GetRecordingsResponse |
||
236 | * @throws \Exception |
||
237 | */ |
||
238 | public function getRecordings($recordingParams) |
||
244 | |||
245 | /** |
||
246 | * @param $recordingParams PublishRecordingsParameters |
||
247 | * @return string |
||
248 | */ |
||
249 | public function getPublishRecordingsUrl($recordingParams) |
||
253 | |||
254 | /** |
||
255 | * @param $recordingParams PublishRecordingsParameters |
||
256 | * @return PublishRecordingsResponse |
||
257 | * @throws \Exception |
||
258 | */ |
||
259 | public function publishRecordings($recordingParams) |
||
265 | |||
266 | /** |
||
267 | * @param $recordingParams DeleteRecordingsParameters |
||
268 | * @return string |
||
269 | */ |
||
270 | public function deleteRecordingsUrl($recordingParams) |
||
274 | |||
275 | /** |
||
276 | * @param $recordingParams |
||
277 | * @return DeleteRecordingsResponse |
||
278 | * @throws \Exception |
||
279 | */ |
||
280 | public function deleteRecordings($recordingParams) |
||
286 | |||
287 | /* ____________________ INTERNAL CLASS METHODS ___________________ */ |
||
288 | |||
289 | /** |
||
290 | * A private utility method used by other public methods to process XML responses. |
||
291 | * |
||
292 | * @param $url |
||
293 | * @param string $xml |
||
294 | * @return bool|SimpleXMLElement |
||
295 | * @throws \Exception |
||
296 | */ |
||
297 | private function processXmlResponse($url, $xml = '') |
||
335 | } |
||
336 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: