function _backup_migrate_temp_file in Backup and Migrate 5
Same name and namespace in other branches
- 6 backup_migrate.module \_backup_migrate_temp_file()
Get a temp file. Store it in the normal save path for slightly better security in shared environments.
6 calls to _backup_migrate_temp_file()
- BackupMigrateUnitTest::testFileDownloadHook in tests/
BackupMigrateUnitTest.test - BackupMigrateUnitTest::testGetFileInfo in tests/
BackupMigrateUnitTest.test - BackupMigrateUnitTest::testTempFile in tests/
BackupMigrateUnitTest.test - _backup_migrate_dump_tables in ./
backup_migrate.module - Build the database dump file. Takes a list of tables to exclude and some formatting options.
- _backup_migrate_restore_file in ./
backup_migrate.module - Restore from a previously backed up files. Accepts any file created by the backup function.
File
- ./
backup_migrate.module, line 939 - 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_temp_file($extension = "", $delete_all = FALSE) {
static $files = array();
if ($delete_all) {
_backup_migrate_temp_files_delete($files);
}
else {
$file = tempnam(file_directory_temp(), 'backup_migrate_');
if (!empty($extension)) {
unlink($file);
$file .= '.' . $extension;
}
$files[] = $file;
return $file;
}
}