Merge branch '3.3.x'

This commit is contained in:
Marc Alexander 2021-05-29 20:25:57 +02:00
commit 072d62b0c0
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
3 changed files with 42 additions and 62 deletions

View file

@ -58,7 +58,6 @@
<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" name="type" class="radio" value="structure" /> {L_STRUCTURE_ONLY}</label>
<label><input type="radio" class="radio" name="type" value="data" /> {L_DATA_ONLY}</label></dd>
</dl>
<dl>

View file

@ -73,20 +73,6 @@ class acp_database
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$store = true;
$structure = false;
$schema_data = false;
if ($type == 'full' || $type == 'structure')
{
$structure = true;
}
if ($type == 'full' || $type == 'data')
{
$schema_data = true;
}
@set_time_limit(1200);
@set_time_limit(0);
@ -98,14 +84,14 @@ class acp_database
{
/** @var phpbb\db\extractor\extractor_interface $extractor Database extractor */
$extractor = $phpbb_container->get('dbal.extractor');
$extractor->init_extractor($format, $filename, $time, false, $store);
$extractor->init_extractor($format, $filename, $time, false, true);
$extractor->write_start($table_prefix);
foreach ($table as $table_name)
{
// Get the table structure
if ($structure)
if ($type == 'full')
{
// Add table structure to the backup
// This method also add a "drop the table if exists" after trying to write the table structure
@ -135,12 +121,9 @@ class acp_database
}
}
// Write schema data if it exists
if ($schema_data)
{
// Only supported types are full and data, therefore always write the data
$extractor->write_data($table_name);
}
}
$extractor->write_end();
}
@ -150,8 +133,6 @@ class acp_database
}
try
{
if ($store)
{
// Get file name
switch ($format)
@ -159,9 +140,11 @@ class acp_database
case 'text':
$ext = '.sql';
break;
case 'bzip2':
$ext = '.sql.gz2';
break;
case 'gzip':
$ext = '.sql.gz';
break;
@ -194,7 +177,6 @@ class acp_database
VALUES ('$file');";
$db->sql_query($sql);
}
}
catch (\phpbb\exception\runtime_exception $e)
{
trigger_error($e->getMessage(), E_USER_ERROR);

View file

@ -72,7 +72,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.',