/* somewhere inside my cron script */
foreach($classes as $key => $class) {
$url = 'http://localhost:8010/webex/createMeetingLayer.php?WID='.$hosts[$key]['webExID'].'&PW='.$hosts[$key]['password'].'&topic=test';
$parallel_curl->
startRequest($url,
'on_request_done',
array('class' =>
$class,
'host' =>
$hosts[$key]));
}
/* ----------------------------------- */
/* createMeetingLayer.php : My 'intermediary resourse' */
<?php
$webExID = $_GET['WID'];
$password = $_GET['PW'];
$topic = $_GET['topic'];
date_default_timezone_set('PRC');
/*Generate meeting password*/
include_once('webex.php');
$webex = new WebEx($webExID, $password);
$results =
$webex->
meeting_CreateMeeting($meetingPass,
$topic,
date('m/d/Y H:00:00',
strtotime('+ 1 hour')),
'5');
$results = new SimpleXMLElement($results);
$success = $results->xpath('//serv:result');
$return['result'] = (string) $success[0];
if($return['result'] == "SUCCESS") {
$meetingKey = $results->xpath('//meet:meetingkey');
$return['meetingKey'] = (string) $meetingKey[0];
$return['password'] = $meetingPass;
}
echo json_encode
($return);
}
?>
/* ----------------------------------- */
/* inside webex.php which is my API wrapper */
$ch = curl_init('https://' . $this->siteURL);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
$response = curl_exec($ch);
return $response;
/* ----------------------------------- */