PHP Code:
//download meshs
$url_meshs = CLIENT . 'global/data/meshLibrary.xml';
$xml_meshs = SrcToXML($url_meshs);
foreach ($xml_meshs['library']['mesh'] as $mesh)
{
$mesha = $mesh['attrib'];
$type = 'object';
$id = $mesha['id'];
$src = $mesha['dir'] . $id . '.obj';
$url = URL . $src;
if (!Download($url, CLIENT, true))
{
Write('Unable to download: ' . $src);
continue;
}
Write('Downloaded ' . $type . ': ' . $src);
//styles
foreach ($mesh['styles']['style'] as $style)
{
if (isset($style['attrib']))
{
$style = $style['attrib'];
}
if (!isset($style['src']))
{
Write('No styles found...');
continue;
}
$type = 'image';
$src = $mesha['dir'] . $style['src'];
$url = URL . $src;
if (!Download($url, CLIENT, true))
{
Write('Unable to download: ' . $src);
continue;
}
Write('Downloaded ' . $type . ': ' . $src);
}
}