コード例 #1
0
ファイル: db_backup.php プロジェクト: carriercomm/amberdms-bs
 function render_html()
 {
     // Title + Summary
     print "<h3>DATABASE BACKUP</h3><br>";
     print "<p>This page allows an administrator to perform an export of the entire MySQL database and download it as a file. This feature\n\t\t\tensures that no matter who runs your instance of the Amberdms Billing System, your data can always be retrieved.</p>";
     print "<p>The file generated is a standard SQL file compressed with gzip, it can be easily restored using the MySQL command line or\n\t\t\tvia a utility such as phpmyadmin.</p>";
     // report on usage
     $sql_obj = new sql_query();
     $usage = $sql_obj->stats_diskusage();
     format_msgbox("info", "<p>Estimated download size: " . format_size_human($usage) . " (before compression)</p>");
     // run check for file-system based journal files
     $sql_obj = new sql_query();
     $sql_obj->string = "SELECT id FROM file_uploads WHERE file_location != 'db' LIMIT 1";
     $sql_obj->execute();
     if ($sql_obj->num_rows()) {
         format_msgbox("important", "<p>Some of the files stored in the journal have been saved to the filesystem rather than the MySQL database. This backup will provide a copy of the database, but you will also need to download the contents of the data/ directory.</p>");
     }
     // export link
     print "<br>";
     print "<a class=\"button\" href=\"admin/db_backup-process.php\">Export Database</a>";
 }