1 | <?php |
||
46 | class BigBlueButton |
||
47 | { |
||
48 | private $securitySalt; |
||
49 | private $bbbServerBaseUrl; |
||
50 | private $urlBuilder; |
||
51 | |||
52 | public function __construct() |
||
58 | |||
59 | /** |
||
60 | * @return ApiVersionResponse |
||
61 | * |
||
62 | * @throws \Exception |
||
63 | */ |
||
64 | public function getApiVersion() |
||
68 | |||
69 | /* __________________ BBB ADMINISTRATION METHODS _________________ */ |
||
70 | /* The methods in the following section support the following categories of the BBB API: |
||
71 | -- create |
||
72 | -- join |
||
73 | -- end |
||
74 | */ |
||
75 | |||
76 | /** |
||
77 | * @param $createMeetingParams CreateMeetingParameters |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getCreateMeetingUrl($createMeetingParams) |
||
85 | |||
86 | /** |
||
87 | * @param CreateMeetingParameters $createMeetingParams |
||
88 | * @return CreateMeetingResponse |
||
89 | * @throws \Exception |
||
90 | */ |
||
91 | public function createMeeting($createMeetingParams) |
||
97 | |||
98 | /** |
||
99 | * @param $joinMeetingParams JoinMeetingParameters |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getJoinMeetingURL($joinMeetingParams) |
||
107 | |||
108 | /** |
||
109 | * @param $endParams EndMeetingParameters |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getEndMeetingURL($endParams) |
||
117 | |||
118 | /** |
||
119 | * @param $endParams EndMeetingParameters |
||
120 | * |
||
121 | * @return EndMeetingResponse |
||
122 | */ |
||
123 | public function endMeeting($endParams) |
||
129 | |||
130 | /* __________________ BBB MONITORING METHODS _________________ */ |
||
131 | /* The methods in the following section support the following categories of the BBB API: |
||
132 | -- isMeetingRunning |
||
133 | -- getMeetings |
||
134 | -- getMeetingInfo |
||
135 | */ |
||
136 | |||
137 | /** |
||
138 | * @param $meetingParams IsMeetingRunningParameters |
||
139 | * @return string |
||
140 | */ |
||
141 | public function getIsMeetingRunningUrl($meetingParams) |
||
145 | |||
146 | /** |
||
147 | * @param $meetingParams |
||
148 | * @return IsMeetingRunningResponse |
||
149 | * @throws \Exception |
||
150 | */ |
||
151 | public function isMeetingRunning($meetingParams) |
||
157 | |||
158 | /** |
||
159 | * @return string |
||
160 | */ |
||
161 | public function getMeetingsUrl() |
||
165 | |||
166 | /** |
||
167 | * @return GetMeetingsResponse |
||
168 | */ |
||
169 | public function getMeetings() |
||
175 | |||
176 | /** |
||
177 | * @param $meetingParams GetMeetingInfoParameters |
||
178 | * @return string |
||
179 | */ |
||
180 | public function getMeetingInfoUrl($meetingParams) |
||
184 | |||
185 | /** |
||
186 | * @param $meetingParams GetMeetingInfoParameters |
||
187 | * @return GetMeetingInfoResponse |
||
188 | */ |
||
189 | public function getMeetingInfo($meetingParams) |
||
195 | |||
196 | /* __________________ BBB RECORDING METHODS _________________ */ |
||
197 | /* The methods in the following section support the following categories of the BBB API: |
||
198 | -- getRecordings |
||
199 | -- publishRecordings |
||
200 | -- deleteRecordings |
||
201 | */ |
||
202 | |||
203 | /** |
||
204 | * @param $recordingsParams GetRecordingsParameters |
||
205 | * @return string |
||
206 | */ |
||
207 | public function getRecordingsUrl($recordingsParams) |
||
211 | |||
212 | /** |
||
213 | * @param $recordingParams |
||
214 | * @return GetRecordingsResponse |
||
215 | * @throws \Exception |
||
216 | */ |
||
217 | public function getRecordings($recordingParams) |
||
223 | |||
224 | /** |
||
225 | * @param $recordingParams PublishRecordingsParameters |
||
226 | * @return string |
||
227 | */ |
||
228 | public function getPublishRecordingsUrl($recordingParams) |
||
232 | |||
233 | /** |
||
234 | * @param $recordingParams PublishRecordingsParameters |
||
235 | * @return PublishRecordingsResponse |
||
236 | * @throws \Exception |
||
237 | */ |
||
238 | public function publishRecordings($recordingParams) |
||
244 | |||
245 | /** |
||
246 | * @param $recordingParams DeleteRecordingsParameters |
||
247 | * @return string |
||
248 | */ |
||
249 | public function deleteRecordingsUrl($recordingParams) |
||
253 | |||
254 | /** |
||
255 | * @param $recordingParams |
||
256 | * @return DeleteRecordingsResponse |
||
257 | * @throws \Exception |
||
258 | */ |
||
259 | public function deleteRecordings($recordingParams) |
||
265 | |||
266 | /* ____________________ INTERNAL CLASS METHODS ___________________ */ |
||
267 | |||
268 | /** |
||
269 | * A private utility method used by other public methods to process XML responses. |
||
270 | * |
||
271 | * @param $url |
||
272 | * @param string $xml |
||
273 | * @return bool|SimpleXMLElement |
||
274 | * @throws \Exception |
||
275 | */ |
||
276 | private function processXmlResponse($url, $xml = '') |
||
314 | } |
||
315 |
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: