Don't add static files if it's not necessary.

This commit is contained in:
Buster Neece 2014-06-05 11:44:21 -05:00
parent 8cc1f77fe9
commit c113f295e0
1 changed files with 12 additions and 9 deletions

View File

@ -96,15 +96,18 @@ if (isset($static_result['result']))
{
$local_file = $local_dir.DIRECTORY_SEPARATOR.$file_base;
$fp = fopen($local_file, 'w');
$options = array(
CURLOPT_FILE => $fp,
CURLOPT_TIMEOUT => 28800,
CURLOPT_URL => $remote_url,
);
curl_setopt_array($ch, $options);
curl_exec($ch);
fclose($fp);
if (!file_exists($local_file))
{
$fp = fopen($local_file, 'w');
$options = array(
CURLOPT_FILE => $fp,
CURLOPT_TIMEOUT => 28800,
CURLOPT_URL => $remote_url,
);
curl_setopt_array($ch, $options);
curl_exec($ch);
fclose($fp);
}
}
echo ' - Finished importing "'.$dir_name.'".'.PHP_EOL;