function _backup_migrate_zip_encode in Backup and Migrate 6
Same name and namespace in other branches
- 5.2 includes/files.inc \_backup_migrate_zip_encode()
- 5 backup_migrate.module \_backup_migrate_zip_encode()
Zip encode a file.
1 call to _backup_migrate_zip_encode()
- _backup_migrate_dump_tables in ./
backup_migrate.module - Build the database dump file. Takes a list of tables to exclude and some formatting options.
File
- ./
backup_migrate.module, line 1163 - 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_zip_encode($source, $dest, $filename) {
$success = FALSE;
if (class_exists('ZipArchive')) {
$zip = new ZipArchive();
$res = $zip
->open($dest, constant("ZipArchive::CREATE"));
if ($res === TRUE) {
$zip
->addFile($source, $filename);
$success = $zip
->close();
}
}
return $success;
}