function backup_migrate_destination_files::test_file_readable_remotely

cis7 destinations.file.inc backup_migrate_destination_files::test_file_readable_remotely($path, $contents)
cle7 destinations.file.inc backup_migrate_destination_files::test_file_readable_remotely($path, $contents)
elmsmedia7 destinations.file.inc backup_migrate_destination_files::test_file_readable_remotely($path, $contents)
icor7 destinations.file.inc backup_migrate_destination_files::test_file_readable_remotely($path, $contents)
meedjum_blog7 destinations.file.inc backup_migrate_destination_files::test_file_readable_remotely($path, $contents)
mooc7 destinations.file.inc backup_migrate_destination_files::test_file_readable_remotely($path, $contents)

Check if a file can be read remotely via http.

1 call to backup_migrate_destination_files::test_file_readable_remotely()
backup_migrate_destination_files::check_web_dir in sites/all/modules/ulmus/backup_migrate/includes/destinations.file.inc
Check that a web accessible directory has been properly secured, othewise attempt to secure it.

File

sites/all/modules/ulmus/backup_migrate/includes/destinations.file.inc, line 244
A destination type for saving locally to the server.

Class

backup_migrate_destination_files

Code

function test_file_readable_remotely($path, $contents) {
  $url = $GLOBALS['base_url'] . '/' . str_replace('\\', '/', $path);
  $result = drupal_http_request($url);
  if (!empty($result->data) && strpos($result->data, $contents) !== FALSE) {
    return TRUE;
  }
  return FALSE;
}