function locale_translation_http_check

Check if remote file exists and when it was last updated.

Parameters

string $url: URL of remote file.

array $headers: HTTP request headers.

Return value

stdClass Result object containing the HTTP request headers, response code, headers, data, redirect status and updated timestamp.

1 call to locale_translation_http_check()
locale_translation_batch_status_fetch_remote in drupal/core/modules/locale/locale.batch.inc
Batch operation callback: Check the availability of a remote po file.

File

drupal/core/modules/locale/locale.batch.inc, line 188
Batch process to check the availability of remote or local po files.

Code

function locale_translation_http_check($url, $headers = array()) {
  $result = drupal_http_request($url, array(
    'headers' => $headers,
    'method' => 'HEAD',
  ));
  if ($result && $result->code == '200') {
    $result->updated = isset($result->headers['last-modified']) ? strtotime($result->headers['last-modified']) : 0;
  }
  return $result;
}