1. /* somewhere inside my cron script */
  2.  
  3. foreach($classes as $key => $class) {
  4. $url = 'http://localhost:8010/webex/createMeetingLayer.php?WID='.$hosts[$key]['webExID'].'&PW='.$hosts[$key]['password'].'&topic=test';
  5. $parallel_curl->startRequest($url, 'on_request_done', array('class' => $class, 'host' =>$hosts[$key]));
  6. }
  7.  
  8. /* ----------------------------------- */
  9.  
  10.  
  11.  
  12. /* createMeetingLayer.php : My 'intermediary resourse' */
  13.  
  14. <?php
  15.  
  16. $webExID = $_GET['WID'];
  17. $password = $_GET['PW'];
  18. $topic = $_GET['topic'];
  19.  
  20. date_default_timezone_set('PRC');
  21.  
  22. if(isset($webExID) || isset($password)) {
  23.  
  24. /*Generate meeting password*/
  25. $meetingPass = substr(md5(uniqid(rand(), true)), 0, 8);
  26.  
  27. include_once('webex.php');
  28. $webex = new WebEx($webExID, $password);
  29. $results = $webex->meeting_CreateMeeting($meetingPass, $topic, date('m/d/Y H:00:00', strtotime('+ 1 hour')), '5');
  30.  
  31. $results = new SimpleXMLElement($results);
  32. $success = $results->xpath('//serv:result');
  33. $return = array();
  34. $return['result'] = (string) $success[0];
  35. if($return['result'] == "SUCCESS") {
  36. $meetingKey = $results->xpath('//meet:meetingkey');
  37. $return['meetingKey'] = (string) $meetingKey[0];
  38. $return['password'] = $meetingPass;
  39. }
  40. echo json_encode($return);
  41. }
  42.  
  43. ?>
  44.  
  45. /* ----------------------------------- */
  46.  
  47.  
  48. /* inside webex.php which is my API wrapper */
  49.  
  50. $ch = curl_init('https://' . $this->siteURL);
  51. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
  52. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  53. curl_setopt($ch, CURLOPT_POST, true);
  54. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  55. curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
  56. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
  57.  
  58. $response = curl_exec($ch);
  59. return $response;
  60.  
  61. /* ----------------------------------- */
  62.