Don't add static files if it's not necessary.
This commit is contained in:
parent
8cc1f77fe9
commit
c113f295e0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue