function ecFileMove($from, $to, $replace = 0) { if (file_exists($from)) { $data = implode('', file($from)); if ($replace == 1) { $datei = fopen($to, 'w'); fwrite($datei, $data); fclose($datei); } else { if (!file_exists($to)) { $datei = fopen($to, 'w'); fwrite($datei, $data); fclose($datei); } } ecFileDelete($from); } else { return false; } return $to; }
} $path1 = $path . $ecDb['name'] . '_' . $curDate . '_' . $i . '_structur' . "." . $filetype; for ($i = 1; file_exists($path . $ecDb['name'] . '_' . $curDate . '_' . $i . '_data' . ".sql") || file_exists($path . $ecDb['name'] . '_' . $curDate . '_' . $i . '_data' . ".sql.gz"); $i++) { } $path2 = $path . $ecDb['name'] . '_' . $curDate . '_' . $i . '_data' . "." . $filetype; dbBackup($ecDb['name'], $path1, $path2, $compression); $next = ecReferer('index.php?view=system&site=database'); echo ecTemplate('system', 'database', 'dbDumped'); } elseif ($do == 'import') { $file = 'backups/database/' . $_REQUEST['backup']; dbImport($file, 'abcd'); $next = ecReferer('index.php?view=system&site=database'); echo ecTemplate('system', 'database', 'backupImported'); } elseif ($do == 'delete') { $file = 'backups/database/' . $_REQUEST['backup']; ecFileDelete($file); $next = ecReferer('index.php?view=system&site=database'); echo ecTemplate('system', 'database', 'backupDeleted'); } else { echo ecTemplate('system', 'database', 'siteHead'); echo ecTemplate('system', 'database', 'dbOptimize'); echo ecTemplate('system', 'database', 'tablesHead'); $ecTablesData = dbShowtable(); while ($tables = mysql_fetch_object($ecTablesData)) { $tablesName = $tables->Name; $tablesRows = $tables->Rows; $tablesOptimized = $tables->Data_free == 0 ? $ecLang['yes'] : $ecLang['no']; echo ecTemplate('system', 'database', 'tablesData'); } echo ecTemplate('system', 'database', 'tablesFoot'); echo ecTemplate('system', 'database', 'dbDumpHead');