OK,
I have added the following function to the class. It works, but feel free to double check..
Btw, in php you can use the .= operator to do recursive value assignment to a variable, much quicker :-)
ciao Luca
public function GetOptimalUrls($sessionToken, $filePaths, $expiration, $consumerIP, $ipRestricted)
{
global $DEBUG;
global $IMFSHOST;
// Set the parameters
$filePathParams = 'sessionToken=' . $sessionToken . '&';
$filePathParams .= 'expiration=' . $expiration . '&';
$filePathParams .= 'consumerIP=' . $consumerIP . '&';
$filePathParams .= 'ipRestricted=' . $ipRestricted. '&';
// loop through each source file path building the arrray.
foreach ($filePaths as $filePath)
{
$filePathParams .= 'filePath=' . $filePath . '&';
}
// retrieve from the REST interface the response xml.
$xmlstring = curlGet($IMFSHOST . '/ws/IMFS/GetOptimalUrls.ashx?' . $filePathParams);
if ($DEBUG)
{
print '<!--GetOptimalUrls: ';
print($filePathParams);
print_r($xmlstring);
print '-->';
}
// turn into an object for easier handling.
$xml = new SimpleXMLElement($xmlstring);
return $xml;
}