git-svn-id: file:///svn/phpbb/trunk@5874 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-05-02 17:59:51 +00:00
parent 14adf393c2
commit 9a0ad16272

View file

@ -46,7 +46,7 @@ class acp_database
$format = request_var('method', ''); $format = request_var('method', '');
$where = request_var('where', ''); $where = request_var('where', '');
$store = $download = false; $store = $download = $structure = $schema_data = false;
if ($where == 'store_and_download' || $where == 'store') if ($where == 'store_and_download' || $where == 'store')
{ {
@ -58,6 +58,16 @@ class acp_database
$download = true; $download = true;
} }
if ($type == 'full' || $type == 'structure')
{
$structure = true;
}
if ($type == 'full' || $type == 'data')
{
$schema_data = true;
}
@set_time_limit(1200); @set_time_limit(1200);
$filename = time(); $filename = time();
@ -142,7 +152,7 @@ class acp_database
foreach ($table as $table_name) foreach ($table as $table_name)
{ {
// Get the table structure // Get the table structure
if ($type == 'full' || $type == 'structure') if ($structure)
{ {
switch (SQL_LAYER) switch (SQL_LAYER)
{ {
@ -194,7 +204,7 @@ class acp_database
$sql_data = ''; $sql_data = '';
// Data // Data
if ($type == 'full' || $type == 'data') if ($schema_data)
{ {
$sql_data .= "\n"; $sql_data .= "\n";
@ -1040,20 +1050,18 @@ class acp_database
} }
$file = request_var('file', ''); $file = request_var('file', '');
$data = '';
preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches); preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches);
$data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]);
switch ($matches[2]) switch ($matches[2])
{ {
case 'sql':
$data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]);
break;
case 'sql.bz2': case 'sql.bz2':
$data = bzdecompress(file_get_contents($phpbb_root_path . 'store/' . $matches[0])); $data = bzdecompress($data);
break; break;
case 'sql.gz': case 'sql.gz':
$data = implode(gzfile($phpbb_root_path . 'store/' . $matches[0])); $data = gzinflate(substr($data, 10));
break; break;
} }