function _backup_migrate_test_file_readable_remotely in Backup and Migrate 5.2
Same name and namespace in other branches
- 5 backup_migrate.module \_backup_migrate_test_file_readable_remotely()
- 6 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_destination_file_check_web_dir in includes/
destinations.file.inc - Check that a web accessible directory has been properly secured, othewise attempt to secure it.
File
- includes/
destinations.file.inc, line 169 - Functions to handle the local server directory backup destinations.
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;
}