Batch operation callback: Check the availability of a remote po file.
Checks the presence and creation time of one po file per batch process. The file URL and timestamp are stored.
array $source: A translation source object of the project for which to check the state of a remote po file.
array $context: The batch context array. The collected state is stored in the 'results' parameter of the context.
locale_translation_batch_status_fetch_local()
locale_translation_batch_status_compare()
function locale_translation_batch_status_fetch_remote($source, &$context) {
// Check the translation file at the remote server and update the source
// data with the remote status.
if (isset($source->files['remote'])) {
$remote_file = $source->files['remote'];
$result = locale_translation_http_check($remote_file->url);
// Update the file object with the result data. In case of a redirect we
// store the resulting url.
if ($result && !empty($result->updated)) {
$remote_file->url = isset($result->redirect_url) ? $result->redirect_url : $remote_file->url;
$remote_file->timestamp = $result->updated;
$source->files['remote'] = $remote_file;
}
$context['results'][$source->name][$source->language] = $source;
}
}