} else { fwrite($fp, $activateForeignKeys, strlen($activateForeignKeys)); } if (OUTPUT_COMPRESSION_TYPE == 'bzip2') { bzclose($bp); } elseif (OUTPUT_COMPRESSION_TYPE == 'gzip') { gzclose($zp); } else { fclose($fp); } if (file_exists($newfullfilename)) { unlink($newfullfilename); // Windows won't allow overwriting via rename } rename($backupabsolutepath . $tempbackupfilename, $newfullfilename); } else { echo '<b>Warning:</b> failed to open ' . $backupabsolutepath . $tempbackupfilename . ' for writing!<br><br>'; if (is_dir($backupabsolutepath)) { echo '<i>CHMOD 777</i> on the directory (' . htmlentities($backupabsolutepath) . ') should fix that.'; } else { echo 'The specified directory does not exist: "' . htmlentities($backupabsolutepath) . '"'; } } // End original backupDB echo '<div class="alert alert-success form-alert"><span class="glyphicon glyphicon-ok"></span><strong>' . $gL10n->get('BAC_BACKUP_COMPLETED', FormattedTimeRemaining(getmicrotime() - $starttime, 2)) . '.</strong><br /><br /> ' . $gL10n->get('BAC_BACKUP_FILE') . ' <a href="' . $g_root_path . '/adm_program/modules/backup/backup_file_function.php?job=get_file&filename=' . basename($newfullfilename) . '">' . basename($newfullfilename) . '</a> (' . FileSizeNiceDisplay(filesize($newfullfilename), 2) . ')</div>'; OutputInformation('cancel_link', ''); OutputInformation('topprogress', '');
$newfullfilename = $backupabsolutepath . $partbackupfilename; } if (file_exists($newfullfilename)) { unlink($newfullfilename); // Windows won't allow overwriting via rename } rename($backupabsolutepath . $tempbackupfilename, $newfullfilename); if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { touch($newfullfilename); if (!chmod($newfullfilename, 0777)) { } } echo '<br>Backup complete in ' . FormattedTimeRemaining(getmicrotime() - $starttime, 2) . '.<br>'; echo '<a href="' . str_replace(@$_SERVER['DOCUMENT_ROOT'], '', $backupabsolutepath) . basename($newfullfilename) . '"><b>' . basename($newfullfilename) . '</b> (' . FileSizeNiceDisplay(filesize($newfullfilename), 2); echo ')</a><br><br><a href="' . $_SERVER['PHP_SELF'] . '">Back to MySQL Database Backup main menu</a><br>'; OutputInformation('cancellink', ''); } else { echo '<b>Warning:</b> failed to open ' . $backupabsolutepath . $tempbackupfilename . ' for writing!<br><br>'; if (is_dir($backupabsolutepath)) { echo '<i>CHMOD 777</i> on the directory (' . htmlentities($backupabsolutepath) . ') should fix that.'; } else { echo 'The specified directory does not exist: "' . htmlentities($backupabsolutepath) . '"'; } } } else { // !$_REQUEST['StartBackup'] if (file_exists($backupabsolutepath . $fullbackupfilename)) { echo 'It is now ' . gmdate('F j, Y g:ia T', time() + date('Z')) . '<br>'; echo 'Last full backup of MySQL databases: '; $lastbackuptime = filemtime($backupabsolutepath . $fullbackupfilename); echo gmdate('F j, Y g:ia T', $lastbackuptime + date('Z'));