function _backup_migrate_test_file_readable_remotely in Backup and Migrate 6
Same name and namespace in other branches
- 5.2 includes/destinations.file.inc \_backup_migrate_test_file_readable_remotely()
- 5 backup_migrate.module \_backup_migrate_test_file_readable_remotely()
Check if a file can be read remotely via http.
1 call to _backup_migrate_test_file_readable_remotely()
- _backup_migrate_check_destination_dir in ./
backup_migrate.module - Prepare the destination directory for the backups.
File
- ./
backup_migrate.module, line 1112 - Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (f.e. cache_*)
Code
function _backup_migrate_test_file_readable_remotely($path, $contents) {
$url = $GLOBALS['base_url'] . '/' . file_directory_path() . '/' . str_replace('\\', '/', $path);
$result = drupal_http_request($url);
if (strpos($result->data, $contents) !== FALSE) {
return TRUE;
}
return FALSE;
}