1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 04:30:29 +01:00

[ticket/16783] Add back data only backups

PHPBB3-16783
This commit is contained in:
Marc Alexander 2021-05-25 20:34:31 +02:00
parent d8ef094a9a
commit acf0885948
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
3 changed files with 33 additions and 3 deletions

View File

@ -55,6 +55,11 @@
<fieldset>
<legend>{L_BACKUP_OPTIONS}</legend>
<dl>
<dt><label for="type">{L_BACKUP_TYPE}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="type" value="full" id="type" checked="checked" /> {L_FULL_BACKUP}</label>
<label><input type="radio" class="radio" name="type" value="data" /> {L_DATA_ONLY}</label></dd>
</dl>
<dl>
<dt><label for="method">{L_FILE_TYPE}{L_COLON}</label></dt>
<dd><!-- BEGIN methods -->

View File

@ -55,6 +55,7 @@ class acp_database
switch ($action)
{
case 'download':
$type = $request->variable('type', '');
$table = array_intersect($this->db_tools->sql_list_tables(), $request->variable('table', array('')));
$format = $request->variable('method', '');
@ -84,9 +85,34 @@ class acp_database
foreach ($table as $table_name)
{
// Get the table structure
$extractor->write_table($table_name);
if ($type == 'full')
{
$extractor->write_table($table_name);
}
else
{
// We might wanna empty out all that junk :D
switch ($db->get_sql_layer())
{
case 'sqlite3':
$extractor->flush('DELETE FROM ' . $table_name . ";\n");
break;
// Data
case 'mssql_odbc':
case 'mssqlnative':
$extractor->flush('TRUNCATE TABLE ' . $table_name . "GO\n");
break;
case 'oracle':
$extractor->flush('TRUNCATE TABLE ' . $table_name . "/\n");
break;
default:
$extractor->flush('TRUNCATE TABLE ' . $table_name . ";\n");
}
}
// Only supported types are full and data, therefore always write the data
$extractor->write_data($table_name);
}

View File

@ -70,7 +70,6 @@ $lang = array_merge($lang, array(
'START_RESTORE' => 'Start restore',
'STORE_AND_DOWNLOAD' => 'Store and download',
'STORE_LOCAL' => 'Store file locally',
'STRUCTURE_ONLY' => 'Structure only',
'TABLE_SELECT' => 'Table select',
'TABLE_SELECT_ERROR'=> 'You must select at least one table.',