Project

General

Profile

« Previous | Next » 

Revision 191

Added by ryan about 19 years ago

Finished backup module

View differences:

trunk/wb/modules/backup/backup-sql.php
23 23

  
24 24
*/
25 25

  
26
// Filename to use
27
$filename = $_SERVER['HTTP_HOST'].'-backup-'.gmdate('Y-m-d', mktime()+TIMEZONE).'.sql';
28

  
26 29
// Check if user clicked on the backup button
27 30
if(!isset($_POST['backup'])){ header('Location: ../'); }
28 31

  
......
38 41
"#\n".
39 42
"# Website Baker ".WB_VERSION." Database Backup\n".
40 43
"# ".WB_URL."\n".
41
"# ".gmdate(DATE_FORMAT, mktime()+TIMEZONE)." ".gmdate(TIME_FORMAT, mktime()+TIMEZONE)."\n".
44
"# ".gmdate(DATE_FORMAT, mktime()+TIMEZONE).", ".gmdate(TIME_FORMAT, mktime()+TIMEZONE)."\n".
42 45
"#".
43 46
"\n";
44 47

  
......
76 79
}
77 80

  
78 81
// Output file
79
header('Content-Type: application/octet-stream');
80
header('Content-Disposition: attachment');
81
header('Filename: "'.str_replace(WB_PATH.'/temp', '', $temp_file).'"');
82
header('Content-Type: text/html');
83
header('Content-Disposition: attachment; filename='.$filename);
82 84
echo $output;
83 85

  
84 86
?>

Also available in: Unified diff