BMLT Satellite Driver
Loading...
Searching...
No Matches
/home/runner/work/bmlt-satellite-driver/bmlt-satellite-driver/bmlt_satellite_controller.class.php
1<?php
2
3/****************************************************************************************/
4/**
5\brief Provides low-level communication to the BMLT Root Server.
6
7\version 1.1.1
8
9This file is part of the Basic Meeting List Toolbox (BMLT).
10
11Find out more at: https://bmlt.app
12
13BMLT is free software: you can redistribute it and/or modify
14it under the terms of the GNU General Public License as published by
15the Free Software Foundation, either version 3 of the License, or
16(at your option) any later version.
17
18BMLT is distributed in the hope that it will be useful,
19but WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this code. If not, see <http://www.gnu.org/licenses/>.
25 */
26
27/****************************************************************************************//**
28 * \brief This is the main class for the Satellite Controller. It establishes a liaison *
29 * with the root server. *
30 * *
31 * This class will perform the REST communication with the server, and will also aid in *
32 * interpreting and organizing the communications. It does not assemble any HTML, *
33 * JavaScript or CSS. That will be left to View Layer implementations that use this class. *
34 ********************************************************************************************/
35// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
36// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
38// phpcs:enable PSR1.Classes.ClassDeclaration.MissingNamespace
39// phpcs:enable Squiz.Classes.ValidClassName.NotCamelCaps
40{
41 /****************************************************************************************
42 * STATIC DATA MEMBERS *
43 ****************************************************************************************/
44 /// This is a static data member, because the list will apply to all instances. Slot 0 is the default protocol.
45 private static $m_supported_protocols = array ( ///< An array of strings. The supported protocols
46 'http', ///< Standard HTTP (Default protocol)
47 'https' ///< SSL
48 );
49
50 /****************************************************************************************
51 * DYNAMIC DATA MEMBERS *
52 ****************************************************************************************/
53 private $m_root_uri_string = null; ///< This is a string, containing the URI to the root server.
54 private $m_error_message = null; ///< This is a string that will contain any error messages.
55
56 /************************************************************************************//**
57 * The way that the outgoing associative array will work, is that it will be filled *
58 * with the keys that are available to the implementor to be used in a query to the *
59 * root server. Some of these keys will have arrays of still more keys, and some of *
60 * these "contained arrays" of values will be filled at runtime, after some *
61 * transactions have been executed with the server. *
62 ****************************************************************************************/
63 private $m_outgoing_parameters = null; /**< An associative array of mixed values.
64The array keys will be the parameter keys
65for outgoing transaction stimuli.
66This array is preset with keys for the available parameters.
67 */
68 private $m_server_version = null; ///< The server version. Null if the server has not been queried.
69 private $m_current_transaction = null; ///< This will hold an array of transaction parameter values for an outgoing transaction.
70
71 /****************************************************************************************
72 * CONSTRUCTOR *
73 ****************************************************************************************/
74
75 /************************************************************************************//**
76 * \brief Constructor -Set the value of the Root URI. *
77 * If a URI is passed in, then the object establishes and tests a connection, and *
78 * loads up the standard outgoing parameters. *
79 * This object requires that the server be of version 1.8.6 or greater. *
80 ****************************************************************************************/
81 public function __construct($in_root_uri_string = null) ///< The URI to the root server, can be null
82 {
83 if ($in_root_uri_string) {
84 // Don't need to flush the params, as we'll be doing that next.
85 $this->set_m_root_uri($in_root_uri_string, true);
86 }
87
88 // Initialize the parameters.
89 $this->flush_parameters();
90
91 // OK, now we talk to the server, and fill up on the various server-specific things.
92 if ($in_root_uri_string) {
93 // The first thing we do, is get the server version. We must have version 1.8.6 or greater.
94 $version = $this->get_server_version();
95 if (!$this->get_m_error_message()) {
96 $version_int = intval(str_replace('.', '', $version));
97 if ($version_int > 185) {
98 if (!extension_loaded('curl')) { // Must have cURL. This puppy won't work without cURL.
99 $this->set_m_error_message('__construct: The cURL extension is not available! This code will not work on this server!');
100 } else {
102 }
103 } else {
104 $this->set_m_error_message('__construct: The root server at (' . $in_root_uri_string . ') is too old (it is version ' . $version . ')! It needs to be at least Version 1.8.6!');
105 }
106 }
107 }
108 }
109
110 /****************************************************************************************
111 * ACCESSOR FUNCTIONS *
112 ****************************************************************************************/
113
114 /************************************************************************************//**
115 * \brief Accessor -Set the value of the Root URI. *
116 * *
117 * NOTE: If the server URI changes, the parameters are flushed. *
118 ****************************************************************************************/
119 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
120 public function set_m_root_uri(
121 $in_root_uri_string, // A string. The URI to set to the data member. This is set verbatim. Cleaning is performed at recall time.
122 $in_skip_flush = false ///< Optional. If true, the parameters won't be flushed, even if they need to be.
123 ) {
124 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
125 // If we are selecting a new server, or changing servers, we flush all stored parameters.
126 if (!$in_skip_flush && strcmp($in_root_uri_string, $this->m_root_uri_string ?? '')) {
127 $this->flush_parameters();
128 }
129
130 $this->m_root_uri_string = $in_root_uri_string;
131 }
132
133 /************************************************************************************//**
134 * \brief Accessor -Return the value of the Root URI. Perform "cleaning" if necessary. *
135 * *
136 * \returns A string. The root URI, with the protocol preamble. If none is given, *
137 * "http" is used. Also, there is no trailing slash. *
138 ****************************************************************************************/
139 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
140 public function get_m_root_uri()
141 {
142 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
143 $ret_string = $this->m_root_uri_string;
144 $protocols = self::get_m_supported_protocols();
145 $protocol = $protocols[0]; // Element zero has the default protocol.
146
147 // We check for a supported protocol, here. It must be HTTP or HTTPS.
148 $matches = array();
149 $uri = ''; // This will be the base URI to the main_server directory.
150 // See if we have a protocol preamble. Separate the URI into components.
151 if (preg_match('|^(.*?):\/\/(.*?)/?$|', $ret_string, $matches)) {
152 $protocol = strtolower($matches[1]);
153 // See if we are a supported protocol.
154 if (!in_array($protocol, $protocols)) {
155 $protocol = $protocols[0]; // The default protocol is in element zero.
156 }
157
158 $uri = $matches[2]; // This strips off any trailing slash.
159 } else {
160 // Strip off any trailing slash.
161 preg_match('|^(.*?)\/?$|', $ret_string, $matches);
162 $uri = $matches[1];
163 }
164
165 // At this point, we have a protocol, and a URI that has had its trailing slash removed.
166 // Reassemble them into a "cleaned" return string.
167
168 $ret_string = $protocol . '://' . $uri;
169
170 return $ret_string;
171 }
172
173 /************************************************************************************//**
174 * \brief Accessor -Set the server version. *
175 ****************************************************************************************/
176 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
177 private function set_m_server_version($in_version) ///< A string. The version information.
178 {
179 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
180 $this->m_server_version = $in_version;
181 }
182
183 /************************************************************************************//**
184 * \brief Accessor -Return the value of the server version (if any). *
185 * *
186 * \returns A string. *
187 ****************************************************************************************/
188 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
189 private function get_m_server_version()
190 {
191 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
192 return $this->m_server_version;
193 }
194
195 /************************************************************************************//**
196 * \brief Accessor -Set the class error message. *
197 ****************************************************************************************/
198 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
199 private function set_m_error_message($in_error_message) ///< A string. The error message.
200 {
201 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
202 $this->m_error_message = $in_error_message;
203 }
204
205 /************************************************************************************//**
206 * \brief Accessor -Return the value of the class error message (if any). *
207 * *
208 * \returns A string. *
209 ****************************************************************************************/
210 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
211 public function get_m_error_message()
212 {
213 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
214 return $this->m_error_message;
215 }
216
217 /************************************************************************************//**
218 * \brief Accessor -Set the class transaction "bucket" *
219 ****************************************************************************************/
220 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
221 private function set_m_current_transaction($in_current_transaction) ///< An array of mixed.
222 {
223 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
224 $this->m_current_transaction = $in_current_transaction;
225 }
226
227 /************************************************************************************//**
228 * \brief Accessor -Return a reference to the class transaction "bucket." *
229 * *
230 * \returns A reference to an array of mixed. *
231 ****************************************************************************************/
232 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
233 public function &get_m_current_transaction()
234 {
235 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
236 return $this->m_current_transaction;
237 }
238
239 /************************************************************************************//**
240 * \brief Accessor -Return the transaction stimulus array. *
241 * *
242 * \returns A reference to an array of mixed. *
243 ****************************************************************************************/
244 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
245 public function &get_m_outgoing_parameters()
246 {
247 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
248 return $this->m_outgoing_parameters;
249 }
250
251 /****************************************************************************************
252 * CLASS FUNCTIONS *
253 ****************************************************************************************/
254 /************************************************************************************//**
255 * \brief Test the stored URI to see if it points to a valid root server, and return *
256 * the server version. *
257 * *
258 * This will cache the response in the incoming parameter ('m_server_version'), and *
259 * will return the cached value, if possible. *
260 * *
261 * This will set or clear the internal $m_error_message data member. *
262 * *
263 * \returns A string, containing the server version. Null if the test fails. *
264 ****************************************************************************************/
265 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
266 public function get_server_version($in_force_refresh = false) ///< If this is true, then the server will be queried, even if there is a cache.
267 {
268 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
269 $ret = null;
270
271 $error_message = null; // We will collect any error messages.
272
273 // We start by clearing any internal error message.
274 $this->set_m_error_message($error_message);
275
276 if ($in_force_refresh || !$this->get_m_server_version()) {
277 $uri = $this->get_m_root_uri(); // Get the cleaned URI.
278
279 $uri .= '/client_interface/json/?switcher=GetServerInfo'; // We will load the JSON.
280
281 // Get the JSON data from the remote server. We will use GET.
282 $data = self::call_curl($uri, false, $error_message);
283
284 // Save any internal error message from the transaction.
285 $this->set_m_error_message($error_message);
286
287 // If we get a valid response, we then parse the JSON.
288 if (!$this->get_m_error_message() && $data) {
289 $info = json_decode($data, true);
290 $ret = $info[0]["version"];
291 $this->set_m_server_version($ret);
292 }
293
294 if (!$ret && !$this->get_m_error_message()) {
295 $this->set_m_error_message('get_server_version: Invalid URI (' . $uri . ')');
296 }
297 } else {
298 $ret = $this->get_m_server_version();
299 }
300
301 return $ret;
302 }
303
304 /************************************************************************************//**
305 * \brief Return the server supported languages. *
306 * *
307 * This will cache the response in the outgoing parameters ('langs'), and will return *
308 * the cached value, if possible. *
309 * *
310 * This will set or clear the internal $m_error_message data member. *
311 * *
312 * \returns An associative array, containing the server languages (the key will *
313 * indicate the language key, and the value will be an array with the readable *
314 * name of the language, and a "default" if this is the server's "native" language). *
315 ****************************************************************************************/
316 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
317 public function get_server_langs($in_force_refresh = false) ///< If this is true, then the server will be queried, even if there is a cache.
318 {
319 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
320 $ret = null;
321
322 $error_message = null; // We will collect any error messages.
323
324 // We start by clearing any internal error message.
325 $this->set_m_error_message($error_message);
326
327 if ($in_force_refresh || !is_array($this->get_m_outgoing_parameter('langs')) || !count($this->get_m_outgoing_parameter('langs'))) {
328 $uri = $this->get_m_root_uri(); // Get the cleaned URI.
329
330 $uri .= '/client_interface/json/?switcher=GetServerInfo'; // We will load the JSON.
331
332 // Get the JSON data from the remote server. We will use GET.
333 $data = self::call_curl($uri, false, $error_message);
334
335 // Save any internal error message from the transaction.
336 $this->set_m_error_message($error_message);
337
338 // If we get a valid response, we then parse the JSON.
339 if (!$this->get_m_error_message() && $data) {
340 $ret = array();
341
342 $data = json_decode($data, true);
343 $langs = explode(",", $data[0]["langs"]);
344 $default_lang = $data[0]["nativeLang"];
345 foreach ($langs as $lang) {
346 $ret[$lang]['name'] = $lang;
347 $ret[$lang]['default'] = $lang === $default_lang ? true : false;
348 }
349 $this->set_m_outgoing_parameter('langs', $ret);
350 }
351
352 if (!$ret && !$this->get_m_error_message()) {
353 $this->set_m_error_message('get_server_langs: Invalid URI (' . $uri . ')');
354 }
355 } else {
356 $ret = $this->get_m_outgoing_parameter('langs');
357 }
358
359 return $ret;
360 }
361
362 /************************************************************************************//**
363 * \brief Return meeting changes between two dates. *
364 * *
365 * This requires that the server be version 1.8.13 or greater. *
366 * This queries the server for meeting change records between (and including) the two *
367 * dates given. The dates are optional. However, not supplying them means that the *
368 * entire server change record is returned, which is quite a mouthful. You can specify *
369 * just one of the parameters (all the changes after a date to now, or all of the *
370 * changes since the server started until a certain date). *
371 * *
372 * There is no caching of this call. It is always real-time. *
373 * *
374 * The dates are given as PHP UNIX times (integer epoch times). *
375 * *
376 * This will set or clear the internal $m_error_message data member. *
377 * *
378 * \returns An indexed array containing the change records as associative arrays. *
379 ****************************************************************************************/
380 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
381 public function get_meeting_changes(
382 $in_start_date = null, ///< Optional. If given (a PHP time() format UNIX Epoch time), the changes will be loaded from midnight (00:00:00) of the date of the time.
383 $in_end_date = null, ///< Optional. If given (a PHP time() format UNIX Epoch time), the changes will be loaded until midnight (23:59:59) of the date of the time.
384 $in_meeting_id = null, ///< If supplied, an ID for a particular meeting. Only changes for that meeting will be returned.
385 $in_service_body_id = null ///< If supplied, an ID for a particular Service body. Only changes for meetings within that Service body will be returned.
386 ) {
387 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
388 $ret = null;
389
390 $error_message = null; // We will collect any error messages.
391
392 // We start by clearing any internal error message.
393 $this->set_m_error_message($error_message);
394
395 $uri = $this->get_m_root_uri(); // Get the cleaned URI.
396
397 $uri .= '/client_interface/json/?switcher=GetChanges'; // We will load the JSON data.
398
399 if (intval($in_start_date)) {
400 $uri .= '&start_date=' . date('Y-m-d', intval($in_start_date));
401 }
402
403 if (intval($in_end_date)) {
404 $uri .= '&end_date=' . date('Y-m-d', intval($in_end_date));
405 }
406
407 if (intval($in_meeting_id)) {
408 $uri .= '&meeting_id=' . intval($in_meeting_id);
409 }
410
411 if (intval($in_service_body_id)) {
412 $uri .= '&service_body_id=' . intval($in_service_body_id);
413 }
414
415 // Get the JSON data from the remote server. We will use GET.
416 $data = self::call_curl($uri, false, $error_message);
417
418 // Save any internal error message from the transaction.
419 $this->set_m_error_message($error_message);
420
421 // If we get a valid response, we then parse the JSON.
422 if (!$this->get_m_error_message() && $data) {
423 if ($data && $data !== '{}' && $data !== '[]') {
424 $ret = array();
425 $data = json_decode($data, true);
426 foreach ($data as $key => $value) {
427 $ret[$key] = $value;
428 $ret[$key]["json_data"] = json_encode($ret[$key]["json_data"]);
429 }
430 }
431 } elseif (!$this->get_m_error_message()) {
432 $this->set_m_error_message('get_meeting_changes: Invalid URI (' . $uri . ')');
433 }
434
435 return $ret;
436 }
437
438 /************************************************************************************//**
439 * \brief Return the server supported formats. *
440 * *
441 * This will cache the response in the outgoing parameters ('formats'), and will *
442 * return the cached value, if possible. *
443 * *
444 * This will set or clear the internal $m_error_message data member. *
445 * *
446 * \returns An associative array containing the formats as arrays. The array index is *
447 * that format's shared ID, for quick lookup. *
448 ****************************************************************************************/
449 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
450 public function get_server_formats($in_force_refresh = false) ///< If this is true, then the server will be queried, even if there is a cache.
451 {
452 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
453 $ret = null;
454
455 $error_message = null; // We will collect any error messages.
456
457 // We start by clearing any internal error message.
458 $this->set_m_error_message($error_message);
459
460 if ($in_force_refresh || !is_array($this->get_m_outgoing_parameter('formats')) || !count($this->get_m_outgoing_parameter('formats'))) {
461 $uri = $this->get_m_root_uri(); // Get the cleaned URI.
462
463 $uri .= '/client_interface/json/?switcher=GetFormats'; // We will load the JSON.
464
465 // Get the JSON data from the remote server. We will use GET.
466 $data = self::call_curl($uri, false, $error_message);
467
468 // Save any internal error message from the transaction.
469 $this->set_m_error_message($error_message);
470
471 // If we get a valid response, we then parse the JSON.
472 if (!$this->get_m_error_message() && $data) {
473 $ret = array();
474 $data = json_decode($data, true);
475 foreach ($data as $format) {
476 $ret[$format['id']] = $format;
477 }
478 } elseif (!$this->get_m_error_message()) {
479 $this->set_m_error_message('get_server_formats: Invalid URI (' . $uri . ')');
480 }
481 } else {
482 $ret = $this->get_m_outgoing_parameter('formats');
483 }
484
485 return $ret;
486 }
487
488 /************************************************************************************//**
489 * \brief Return the server's Service bodies, in hierarchical fashion. *
490 * *
491 * This will cache the response in the outgoing parameters ('services'), and will *
492 * return the cached value, if possible. *
493 * *
494 * This will set or clear the internal $m_error_message data member. *
495 * *
496 * \returns An associative array, containing the server Service bodies
497 ****************************************************************************************/
498 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
499 public function get_server_service_bodies($in_force_refresh = false) ///< If this is true, then the server will be queried, even if there is a cache.
500 {
501 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
502 $ret = null;
503
504 $error_message = null; // We will collect any error messages.
505
506 // We start by clearing any internal error message.
507 $this->set_m_error_message($error_message);
508
509 if ($in_force_refresh || !is_array($this->get_m_outgoing_parameter('services')) || !count($this->get_m_outgoing_parameter('services'))) {
510 $uri = $this->get_m_root_uri(); // Get the cleaned URI.
511
512 $uri .= '/client_interface/json/?switcher=GetServiceBodies'; // We will load the JSON.
513
514 // Get the JSON data from the remote server. We will use GET.
515 $data = self::call_curl($uri, false, $error_message);
516
517 // Save any internal error message from the transaction.
518 $this->set_m_error_message($error_message);
519
520 // If we get a valid response, we then parse the JSON.
521 if (!$this->get_m_error_message() && $data) {
522 $ret = array();
523 $data = json_decode($data, true);
524 foreach ($data as $serviceBody) {
525 $ret[$serviceBody['id']] = $serviceBody;
526 }
527 } elseif (!$this->get_m_error_message()) {
528 $this->set_m_error_message('get_server_service_bodies: Invalid URI (' . $uri . ')');
529 }
530 } else {
531 $ret = $this->get_m_outgoing_parameter('services');
532 }
533
534 return $ret;
535 }
536
537 /************************************************************************************//**
538 * \brief Return a list of the supported meeting_key values.. *
539 * *
540 * Each root server can define its own meeting data item keys, so we need to fetch the *
541 * ones defined by this server. We do this by parsing the dynamically-generated *
542 * schema document from the server. *
543 * *
544 * This will cache the response in the outgoing parameters ('meeting_keys'), and will *
545 * return the cached value, if possible. *
546 * *
547 * This will set or clear the internal $m_error_message data member. *
548 * *
549 * \returns An array of strings, containing the server meeting_key values. *
550 ****************************************************************************************/
551 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
552 public function get_server_meeting_keys($in_force_refresh = false) ///< If this is true, then the server will be queried, even if there is a cache.
553 {
554 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
555 $ret = null;
556
557 $error_message = null; // We will collect any error messages.
558
559 // We start by clearing any internal error message.
560 $this->set_m_error_message($error_message);
561
562 if ($in_force_refresh || !is_array($this->get_m_outgoing_parameter('meeting_key')) || !count($this->get_m_outgoing_parameter('meeting_key'))) {
563 $uri = $this->get_m_root_uri(); // Get the cleaned URI.
564
565 $uri .= '/client_interface/json/?switcher=GetFieldKeys'; // We will load the JSON.
566
567 // Get the JSON data from the remote server. We will use GET.
568 $data = self::call_curl($uri, false, $error_message);
569 // Save any internal error message from the transaction.
570 $this->set_m_error_message($error_message);
571
572 // If we get a valid response, we then parse the JSON.
573 if (!$this->get_m_error_message() && $data) {
574 $data = json_decode($data, true);
575 foreach ($data as $field_key) {
576 $ret[] = $field_key["key"];
577 }
578 } elseif (!$this->get_m_error_message()) {
579 $this->set_m_error_message('get_server_meeting_keys: Invalid URI (' . $uri . ')');
580 }
581 } else {
582 $ret = $this->get_m_outgoing_parameter('meeting_key');
583 }
584
585 return $ret;
586 }
587
588 /************************************************************************************//**
589 * \brief See if a given parameter key is valid for an outgoing parameter. *
590 * *
591 * This will set or clear the error message. *
592 * *
593 * \returns An array, or null. If an array, it will be an array of possible values. *
594 * Null is not an error. It simply means that this transaction key does not have a set *
595 * of preset values. *
596 ****************************************************************************************/
597 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
598 public function get_transaction_key_values($in_parameter_key) ///< A string. The key for this parameter..
599 {
600 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
601 $ret = null;
602
603 $this->set_m_error_message(null); // Clear the error message.
604
605 if ($this->is_legal_transaction_key($in_parameter_key)) {
606 // We start by getting a reference to the outgoing parameters array.
607 $outgoing_parameters =& $this->get_m_outgoing_parameters();
608
609 // We only respond with keys if the parameter value is a non-empty array.
610 if (is_array($outgoing_parameters[$in_parameter_key]) && count($outgoing_parameters[$in_parameter_key])) {
611 $ret = $outgoing_parameters[$in_parameter_key];
612 }
613 } else {
614 $this->set_m_error_message('get_transaction_key_values: Invalid Parameter Key: "' . $in_parameter_key . '"');
615 }
616
617 return $ret;
618 }
619
620 /************************************************************************************//**
621 * \brief See if a given parameter key is valid for an outgoing parameter. *
622 * *
623 * \returns A Boolean. True if it is legal, false, otherwise. *
624 ****************************************************************************************/
625 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
627 $in_parameter_key, ///< A string. The key for this parameter.
628 $in_sub_key = null ///< Optional. If this is a meeting_key value, see if it is legal. Ignored, otherwise.
629 ) {
630 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
631 // We start by getting a reference to the outgoing parameters array.
632 $legal_entities =& $this->get_m_outgoing_parameters();
633
634 $ret = array_key_exists($in_parameter_key, $legal_entities);
635
636 if (($in_parameter_key == 'meeting_key') && isset($in_sub_key)) {
637 $ret = $ret && array_key_exists($in_sub_key, $legal_entities[$in_parameter_key]);
638 }
639
640 return $ret;
641 }
642
643 /************************************************************************************//**
644 * \brief Add a transaction parameter to a transaction being built. *
645 * *
646 * This will set or clear the error message. *
647 * *
648 * \returns A Boolean. True if it is OK, false, otherwise. *
649 ****************************************************************************************/
650 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
652 $in_parameter_key, ///< A string. The key for this parameter. If there is one already set, this will overwrite that.
653 $in_parameter_value = null ///< Mixed. It can be any value. If an array, then the value will be presented as multiple values.
654 ) {
655 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
656 $ret = false;
657
658 $this->set_m_error_message(null); // Clear the error message.
659
660 if ($this->is_legal_transaction_key($in_parameter_key, $in_parameter_value)) {
661 // We start by getting a reference to our transaction array.
662 $transaction_array =& $this->get_m_current_transaction();
663
664 $transaction_array[$in_parameter_key] = $in_parameter_value;
665 $ret = true;
666 } else {
667 $this->set_m_error_message('set_current_transaction_parameter: Invalid Parameter Key: "' . $in_parameter_key . '"');
668 }
669
670 return $ret;
671 }
672
673 /************************************************************************************//**
674 * \brief Clear the Error Message. *
675 ****************************************************************************************/
676 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
677 public function clear_m_error_message()
678 {
679 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
680 $this->m_error_message = null;
681 }
682
683 /************************************************************************************//**
684 * \brief Return a value from the transaction stimuli array. *
685 * *
686 * \returns A reference to a mixed. This is the value in the array. *
687 ****************************************************************************************/
688 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
689 public function &get_m_outgoing_parameter(
690 $in_parameter_key_string, ///< A string. The parameter key
691 $in_parameter_secondary_key_string = null ///< If the parameter has an embedded array, a key for that (optional)
692 ) {
693 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
694 $ret = null;
695
696 if (!isset($this->m_outgoing_parameters[$in_parameter_key_string])) {
697 $this->set_m_error_message('get_m_outgoing_parameter: Invalid Key: "' . $in_parameter_key_string . '"');
698 } else {
699 if (isset($in_parameter_secondary_key_string)) {
700 if (!isset($this->m_outgoing_parameters[$in_parameter_key_string][$in_parameter_secondary_key_string])) {
701 $this->set_m_error_message('get_m_outgoing_parameter: Invalid Secondary Key: "' . $in_parameter_secondary_key_string . '"');
702 } else {
703 $ret =& $this->m_outgoing_parameters[$in_parameter_key_string][$in_parameter_secondary_key_string];
704 }
705 } else {
706 $ret =& $this->m_outgoing_parameters[$in_parameter_key_string];
707 }
708 }
709
710 return $ret;
711 }
712
713 /************************************************************************************//**
714 * \brief Set a parameter value to the transaction stimulus array. *
715 * *
716 * The outgoing array is "pre-keyed" with the possible parameters. You cannot change *
717 * the keys or access the values by reference. *
718 * *
719 * This will set or clear the internal $m_error_message data member. *
720 ****************************************************************************************/
721 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
723 $in_parameter_key_string, ///< A string. The parameter key
724 $in_parameter_value_mixed ///< A mixed value
725 ) {
726 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
727 // We start by clearing any internal error message.
728 $this->set_m_error_message(null);
729
730 if (isset($this->m_outgoing_parameters[$in_parameter_key_string])) { // Null is not allowed.
731 if ($in_parameter_value_mixed === null) {
732 $in_parameter_value_mixed = '';
733 }
734 $this->m_outgoing_parameters[$in_parameter_key_string] = $in_parameter_value_mixed;
735 } else {
736 $this->set_m_error_message('set_m_outgoing_parameter: Invalid Key: "' . $in_parameter_key_string . '"');
737 }
738 }
739
740 /************************************************************************************//**
741 * \brief Sets the outgoing parameter array to its default values. *
742 ****************************************************************************************/
743 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
744 private function set_default_outgoing()
745 {
746 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
747 $this->m_outgoing_parameters = array (
748 /// Weekdays the meeting gathers.
749 'weekdays' => array (),
750
751 /// Meeting start time values
752 'StartsAfterH' => 0,
753 'StartsAfterM' => 0,
754 'StartsBeforeH' => 0,
755 'StartsBeforeM' => 0,
756
757 /// Meeting duration values
758 'MinDurationH' => 0,
759 'MinDurationM' => 0,
760 'MaxDurationH' => 0,
761 'MaxDurationM' => 0,
762
763 /// Search string values
764 'SearchString' => '',
765 'SearchStringAll' => false,
766 'SearchStringExact' => false,
767
768 /// String address values
769 'StringSearchIsAnAddress' => false,
770 'SearchStringRadius' => 0,
771
772 /// Location radius values
773 'geo_width' => 0,
774 'geo_width_km' => 0,
775 'long_val' => 0,
776 'lat_val' => 0,
777
778 /// Meeting data items (Array of keys completed at runtime)
779 'meeting_key' => array (),
780 'meeting_key_value' => '',
781 'meeting_key_match_case' => false,
782 'meeting_key_contains' => false,
783
784 /// Sorting
785 'sort_key' => array ( 'weekday' => true,
786 'time' => false,
787 'town' => false
788 ),
789 'sort_dir' => array ( 'asc' => true,
790 'desc' => false
791 ),
792 'sort_results_by_distance' => false, ///< This allows a sort of the results by distance.
793
794 /// Service body IDs (Array of keys completed at runtime)
795 'services' => array (),
796
797 /// Meeting IDs -Array of values filled by implementor
798 'meeting_ids' => array (),
799
800 /// Formats (Array of keys completed at runtime)
801 'formats' => array (),
802
803 /// Languages (Array of keys completed at runtime)
804 'langs' => array (),
805
806 /// This allows filtered responses.
807 'data_field_key' => null
808 );
809 }
810
811 /************************************************************************************//**
812 * \brief Flush all the parameters, and the dynamically-filled outgoing ones. *
813 ****************************************************************************************/
814 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
815 public function flush_parameters()
816 {
817 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
818 $this->set_m_server_version(null);
819 $this->set_m_current_transaction(null);
820 $this->set_default_outgoing();
821 $this->clear_m_error_message();
822 }
823
824 /************************************************************************************//**
825 * \brief Read all the standard parameters from the server *
826 * *
827 * This will set or clear the internal $m_error_message data member. *
828 ****************************************************************************************/
829 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
831 {
832 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
833 // We start off with a clean slate.
834 $this->clear_m_error_message();
835 $this->set_m_outgoing_parameter('meeting_key', array());
836 $this->set_m_outgoing_parameter('services', array());
837 $this->set_m_outgoing_parameter('formats', array());
838 $this->set_m_outgoing_parameter('langs', array());
839 // Now, we get the values from the server.
840 $this->get_server_formats();
841 if (!$this->get_m_error_message()) {
842 $this->get_server_langs();
843 if (!$this->get_m_error_message()) {
845 if (!$this->get_m_error_message()) {
847 }
848 }
849 }
850 }
851
852 /************************************************************************************//**
853 * \brief Execute a meeting search transaction *
854 * *
855 * \returns An array of meeting data (mixed). Each element of the array will, itself, *
856 * be an array, and will contain the meeting data. Null if no meetings were found. *
857 ****************************************************************************************/
858 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
859 public function meeting_search()
860 {
861 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
862 $ret = null;
863
864 $error_message = null; // We will collect any error messages.
865
866 // We start by clearing any internal error message.
867 $this->set_m_error_message($error_message);
868
869 $uri = $this->get_m_root_uri(); // Get the cleaned URI.
870
871 // For meeting searches, we ask for the response to be compressed, as it can be verbose.
872 $uri .= '/client_interface/json/?switcher=GetSearchResults'; // We will load the JSON.
873
874 $serialized_list = null;
875
876 if ($transaction_params = $this->build_transaction_parameter_list($serialized_list)) {
877 $uri .= $transaction_params;
878 }
879 // Get the JSON data from the remote server. We will use GET.
880 $data = self::call_curl($uri, false, $error_message);
881
882 $ret['uri'] = $uri;
883 $ret['serialized'] = $serialized_list;
884
885 // Save any internal error message from the transaction.
886 $this->set_m_error_message($error_message);
887
888 if (!$this->get_m_error_message() && $data) {
889 // We now have a whole bunch of meetings. Time to process the response, and turn it into usable data.
890
891 if ($data && $data !== '{}' && $data !== '[]') {
892 $data = json_decode($data, true);
893 foreach ($data as $meeting) {
894 $item = self::extract_meeting_data($meeting);
895 // Needs to be a valid meeting.
896 if ($item) {
897 // We save each meeting in an element with its ID as the key.
898 $ret['meetings'][] = $item;
899 }
900 }
901 }
902 } elseif (!$this->get_m_error_message()) {
903 $this->set_m_error_message('meeting_search: Invalid URI (' . $uri . ')');
904 }
905
906 return $ret;
907 }
908
909 /************************************************************************************//**
910 * \brief Unserialize a serialized transaction. *
911 * *
912 * This allows you to save a transaction, and re-use it. The transaction is not *
913 * executed. You still need to call meeting_search(). However, this replaces the setup *
914 * steps (set_current_transaction_parameter). It clears the transaction parameters *
915 * before it starts, so you cannot rely on any previous data being in the transaction *
916 * array. You can add transaction data afterward. *
917 * *
918 * \returns An array of string. If any of the given parameters cannot be set, their *
919 * key is given here. It is not an error. Null if everything fit. *
920 ****************************************************************************************/
921 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
922 public function apply_serialized_transaction($in_serialized_list) ///< A string that holds the serialized transaction list.
923 {
924 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
925 $ret = null;
926
927 $new_array = unserialize($in_serialized_list);
928 if (isset($new_array) && is_array($new_array) && count($new_array)) {
929 $ret = array();
930 $this->set_m_current_transaction(null); // Clear current transactions.
931 foreach ($new_array as $param_key => $param_value) {
932 if ($this->is_legal_transaction_key($param_key, $param_value)) {
933 $this->set_current_transaction_parameter($param_key, $param_value);
934 } else {
935 $ret[] = $param_key;
936 }
937 }
938 }
939
940 return $ret;
941 }
942
943 /************************************************************************************//**
944 * \brief Return the query parameter list for the next transaction in a serialized *
945 * string. *
946 * *
947 * \returns A string. The transaction parameter list in a serialized form. *
948 ****************************************************************************************/
949 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
951 {
952 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
953 return serialize($this->get_m_current_transaction());
954 }
955
956 /************************************************************************************//**
957 * \brief Return the query parameter list for the next transaction. *
958 * *
959 * \returns A string. The transaction parameter list. *
960 ****************************************************************************************/
961 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
962 private function build_transaction_parameter_list(&$in_out_serialized_list) ///< A reference to a string that will hold the serialized transaction list.
963 {
964 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
965 $ret = null;
966
967 $transaction_array =& $this->get_m_current_transaction();
968
969 if (is_array($transaction_array) && count($transaction_array)) {
970 foreach ($transaction_array as $param_key => &$param_value) {
971 if ($this->is_legal_transaction_key($param_key, $param_value)) {
972 if (is_array($transaction_array[$param_key]) && (count($transaction_array[$param_key]) > 1)) {
973 foreach ($transaction_array[$param_key] as $param) {
974 $ret .= '&';
975 if ($param === true) { // Boolean is converted to a "1"
976 $param = 1;
977 }
978 $ret .= $param_key . '[]=' . urlencode(trim(strval($param)));
979 }
980 } elseif ((is_array($transaction_array[$param_key]) && (count($transaction_array[$param_key]) == 1)) || (!is_array($transaction_array[$param_key]) && isset($transaction_array[$param_key]))) {
981 $ret .= '&';
982 $param = $transaction_array[$param_key];
983 if (is_array($param)) {
984 $param = $param[0];
985 }
986 if ($param === true) { // Boolean is converted to a "1"
987 $param = 1;
988 }
989 $ret .= $param_key . '=' . urlencode(trim(strval($param)));
990 } else {
991 $this->set_m_error_message('build_transaction_parameter_list: Invalid Parameter Value: "' . $param_value . '" (' . $param_key . ')');
992 break;
993 }
994 } else {
995 $this->set_m_error_message('build_transaction_parameter_list: Invalid Parameter Key: "' . $param_key . '"');
996 break;
997 }
998 }
999 }
1000
1001 // This will be used to allow persistent state.
1002 $in_out_serialized_list = $this->get_serialized_transaction();
1003 return $ret;
1004 }
1005
1006 /****************************************************************************************
1007 * STATIC FUNCTIONS *
1008 ****************************************************************************************/
1009
1010 /************************************************************************************//**
1011 * \brief Accessor -Return the array of supported protocols. *
1012 * *
1013 * \returns An array of strings. *
1014 ****************************************************************************************/
1015 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1016 public static function get_m_supported_protocols()
1017 {
1018 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1019 return self::$m_supported_protocols;
1020 }
1021
1022
1023 /************************************************************************************//**
1024 * \brief Extracts the data from one meeting. *
1025 * *
1026 * \returns An associative array, with all the meeting data. *
1027 ****************************************************************************************/
1028 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1029 private static function extract_meeting_data($in_meeting_item)
1030 {
1031 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1032 $ret = null;
1033
1034 foreach ($in_meeting_item as $key => $value) {
1035 if ($value) {
1036 $ret[$key] = $value;
1037 }
1038 }
1039
1040 return $ret;
1041 }
1042
1043 /************************************************************************************//**
1044 * \brief This is a function that returns the results of an HTTP call to a URI. *
1045 * It is a lot more secure than file_get_contents, but does the same thing. *
1046 * *
1047 * \returns a string, containing the response. Null if the call fails to get any data. *
1048 ****************************************************************************************/
1049 // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1050 public static function call_curl(
1051 $in_uri, ///< A string. The URI to call.
1052 $in_post = false, ///< If false, the transaction is a GET, not a POST. Default is true.
1053 &$error_message = null, ///< A string. If provided, any error message will be placed here.
1054 &$http_status = null ///< Optional reference to a string. Returns the HTTP call status.
1055 ) {
1056 // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1057 $ret = null;
1058
1059 // Make sure we don't give any false positives.
1060 if ($error_message) {
1061 $error_message = null;
1062 }
1063
1064 if (!extension_loaded('curl')) { // Must have cURL.
1065 // If there is no error message variable passed, we die quietly.
1066 if (isset($error_message)) {
1067 $error_message = 'call_curl: The cURL extension is not available! This code will not work on this server!';
1068 }
1069 } else {
1070 // This gets the session as a cookie.
1071 if (isset($_COOKIE['PHPSESSID']) && $_COOKIE['PHPSESSID']) {
1072 $strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/';
1073
1074 session_write_close();
1075 }
1076
1077 // Create a new cURL resource.
1078 $resource = curl_init();
1079
1080 if (isset($strCookie) && $strCookie) {
1081 curl_setopt($resource, CURLOPT_COOKIE, $strCookie);
1082 }
1083
1084 // If we will be POSTing this transaction, we split up the URI.
1085 if ($in_post) {
1086 curl_setopt($resource, CURLOPT_POST, true);
1087
1088 $spli = explode("?", $in_uri, 2);
1089
1090 if (is_array($spli) && (1 < count($spli))) {
1091 $in_uri = $spli[0];
1092 $in_params = $spli[1];
1093 // Convert query string into an array using parse_str(). parse_str() will decode values along the way.
1094 parse_str($in_params, $temp);
1095
1096 // Now rebuild the query string using http_build_query(). It will re-encode values along the way.
1097 // It will also take original query string params that have no value and appends a "=" to them
1098 // thus giving them and empty value.
1099 $in_params = http_build_query($temp);
1100
1101 curl_setopt($resource, CURLOPT_POSTFIELDS, $in_params);
1102 }
1103 }
1104
1105 if (isset($strCookie) && $strCookie) {
1106 curl_setopt($resource, CURLOPT_COOKIE, $strCookie);
1107 }
1108
1109 // Set url to call.
1110 curl_setopt($resource, CURLOPT_URL, $in_uri);
1111
1112 // Make curl_exec() function (see below) return requested content as a string (unless call fails).
1113 curl_setopt($resource, CURLOPT_RETURNTRANSFER, true);
1114
1115 // By default, cURL prepends response headers to string returned from call to curl_exec().
1116 // You can control this with the below setting.
1117 // Setting it to false will remove headers from beginning of string.
1118 // If you WANT the headers, see the Yahoo documentation on how to parse with them from the string.
1119 curl_setopt($resource, CURLOPT_HEADER, false);
1120
1121 // Allow cURL to follow any 'location:' headers (redirection) sent by server (if needed set to true, else false- defaults to false anyway).
1122// Disabled, because some servers disable this for security reasons.
1123// curl_setopt ( $resource, CURLOPT_FOLLOWLOCATION, true );
1124
1125 // Set maximum times to allow redirection (use only if needed as per above setting. 3 is sort of arbitrary here).
1126 curl_setopt($resource, CURLOPT_MAXREDIRS, 3);
1127
1128 // Set connection timeout in seconds (very good idea).
1129 curl_setopt($resource, CURLOPT_CONNECTTIMEOUT, 10);
1130
1131 // Direct cURL to send request header to server allowing compressed content to be returned and decompressed automatically (use only if needed).
1132 curl_setopt($resource, CURLOPT_ENCODING, 'gzip,deflate');
1133
1134 // Pretend we're a browser, so that anti-cURL settings don't pooch us.
1135 curl_setopt($resource, CURLOPT_USERAGENT, "cURL Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20130401 Firefox/21.0");
1136
1137 // Trust meeeee...
1138 curl_setopt($resource, CURLOPT_SSL_VERIFYPEER, false);
1139
1140 // Execute cURL call and return results in $content variable.
1141 $content = curl_exec($resource);
1142
1143 // Check if curl_exec() call failed (returns false on failure) and handle failure.
1144 if ($content === false) {
1145 // If there is no error message variable passed, we die quietly.
1146 if (isset($error_message)) {
1147 // Cram as much info into the error message as possible.
1148 $error_message = "call_curl: curl failure calling $in_uri, " . curl_error($resource) . "\n" . curl_errno($resource);
1149 }
1150 } else {
1151 // Do what you want with returned content (e.g. HTML, etc) here or AFTER curl_close() call below as it is stored in the $content variable.
1152
1153 // You MIGHT want to get the HTTP status code returned by server (e.g. 200, 400, 500).
1154 // If that is the case then this is how to do it.
1155 $http_status = curl_getinfo($resource, CURLINFO_HTTP_CODE);
1156 }
1157
1158 // Close cURL and free resource.
1159 curl_close($resource);
1160
1161 // Maybe echo $contents of $content variable here.
1162 if ($content !== false) {
1163 $ret = $content;
1164 }
1165 }
1166
1167 return $ret;
1168 }
1169}
Provides low-level communication to the BMLT Root Server.
& get_m_current_transaction()
Accessor -Return a reference to the class transaction "bucket." * *.
is_legal_transaction_key( $in_parameter_key, $in_sub_key=null)
See if a given parameter key is valid for an outgoing parameter. * *.
& get_m_outgoing_parameter( $in_parameter_key_string, $in_parameter_secondary_key_string=null)
Return a value from the transaction stimuli array. * *.
& get_m_outgoing_parameters()
Accessor -Return the transaction stimulus array. * *.
get_transaction_key_values($in_parameter_key)
See if a given parameter key is valid for an outgoing parameter. *This will set or clear the error me...
get_server_service_bodies($in_force_refresh=false)
Return the server's Service bodies, in hierarchical fashion. *This will cache the response in the out...
get_server_meeting_keys($in_force_refresh=false)
Return a list of the supported meeting_key values.. *Each root server can define its own meeting data...
get_server_version($in_force_refresh=false)
Test the stored URI to see if it points to a valid root server, and return * the server version....
set_m_root_uri( $in_root_uri_string, $in_skip_flush=false)
Accessor -Set the value of the Root URI. *NOTE: If the server URI changes, the parameters are flushed...
meeting_search()
Execute a meeting search transaction * *.
set_current_transaction_parameter( $in_parameter_key, $in_parameter_value=null)
Add a transaction parameter to a transaction being built. *This will set or clear the error message....
get_m_error_message()
Accessor -Return the value of the class error message (if any). * *.
load_standard_outgoing_parameters()
Read all the standard parameters from the server *This will set or clear the internal $m_error_messag...
get_serialized_transaction()
Return the query parameter list for the next transaction in a serialized * string....
static get_m_supported_protocols()
Accessor -Return the array of supported protocols. * *.
get_server_formats($in_force_refresh=false)
Return the server supported formats. *This will cache the response in the outgoing parameters ('forma...
__construct($in_root_uri_string=null)
Constructor -Set the value of the Root URI. * If a URI is passed in, then the object establishes and ...
static call_curl( $in_uri, $in_post=false, &$error_message=null, &$http_status=null)
This is a function that returns the results of an HTTP call to a URI. * It is a lot more secure than ...
get_meeting_changes( $in_start_date=null, $in_end_date=null, $in_meeting_id=null, $in_service_body_id=null)
Return meeting changes between two dates. *This requires that the server be version 1....
apply_serialized_transaction($in_serialized_list)
Unserialize a serialized transaction. *This allows you to save a transaction, and re-use it....
flush_parameters()
Flush all the parameters, and the dynamically-filled outgoing ones. *.
get_m_root_uri()
Accessor -Return the value of the Root URI. Perform "cleaning" if necessary. * *.
get_server_langs($in_force_refresh=false)
Return the server supported languages. *This will cache the response in the outgoing parameters ('lan...
set_m_outgoing_parameter( $in_parameter_key_string, $in_parameter_value_mixed)
Set a parameter value to the transaction stimulus array. *The outgoing array is "pre-keyed" with the ...
clear_m_error_message()
Clear the Error Message. *.