diff options
author | David M <davidmj@users.sourceforge.net> | 2006-05-02 17:59:51 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-05-02 17:59:51 +0000 |
commit | 9a0ad16272ccb461a5864b2a0cd8aa8f769ffdad (patch) | |
tree | 7b716799d0c6d487b2d8f565f5808079f261b12d /phpBB/includes/acp/acp_database.php | |
parent | 14adf393c26dc47444d3b18b5030c293e890986a (diff) | |
download | forums-9a0ad16272ccb461a5864b2a0cd8aa8f769ffdad.tar forums-9a0ad16272ccb461a5864b2a0cd8aa8f769ffdad.tar.gz forums-9a0ad16272ccb461a5864b2a0cd8aa8f769ffdad.tar.bz2 forums-9a0ad16272ccb461a5864b2a0cd8aa8f769ffdad.tar.xz forums-9a0ad16272ccb461a5864b2a0cd8aa8f769ffdad.zip |
- Bug #1709
git-svn-id: file:///svn/phpbb/trunk@5874 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_database.php')
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 5249969eb1..cf01af7a07 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -46,7 +46,7 @@ class acp_database $format = request_var('method', ''); $where = request_var('where', ''); - $store = $download = false; + $store = $download = $structure = $schema_data = false; if ($where == 'store_and_download' || $where == 'store') { @@ -58,6 +58,16 @@ class acp_database $download = true; } + if ($type == 'full' || $type == 'structure') + { + $structure = true; + } + + if ($type == 'full' || $type == 'data') + { + $schema_data = true; + } + @set_time_limit(1200); $filename = time(); @@ -142,7 +152,7 @@ class acp_database foreach ($table as $table_name) { // Get the table structure - if ($type == 'full' || $type == 'structure') + if ($structure) { switch (SQL_LAYER) { @@ -194,7 +204,7 @@ class acp_database $sql_data = ''; // Data - if ($type == 'full' || $type == 'data') + if ($schema_data) { $sql_data .= "\n"; @@ -1040,20 +1050,18 @@ class acp_database } $file = request_var('file', ''); - $data = ''; preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches); + $data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]); + switch ($matches[2]) { - case 'sql': - $data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]); - break; case 'sql.bz2': - $data = bzdecompress(file_get_contents($phpbb_root_path . 'store/' . $matches[0])); + $data = bzdecompress($data); break; case 'sql.gz': - $data = implode(gzfile($phpbb_root_path . 'store/' . $matches[0])); + $data = gzinflate(substr($data, 10)); break; } |