function biblio_import_from_url in Bibliography Module 6
Same name and namespace in other branches
- 6.2 includes/biblio.import.export.inc \biblio_import_from_url()
- 7 includes/biblio.import.export.inc \biblio_import_from_url()
- 7.2 includes/biblio.import.export.inc \biblio_import_from_url()
File
- ./
biblio.import.export.inc, line 345 - Functions that are used to import and export biblio data.
Code
function biblio_import_from_url($URL) {
$handle = fopen($URL, "r");
// fetch data from URL in read mode
$data = "";
if ($handle) {
while (!feof($handle)) {
$data .= fread($handle, 4096);
// read data in chunks
}
fclose($handle);
}
else {
$errorMessage = t("Error occurred: Failed to open ") . check_plain($URL);
// network error
drupal_set_message($errorMessage, 'error');
}
return $data;
}