From 605356a6ca9174f6d448f93405453ef648237244 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Fri, 3 Aug 2001 17:17:08 +0000 Subject: [PATCH] Why do PHP insist the read size for a gzip file be the uncompressed length ... silly git-svn-id: file:///svn/phpbb/trunk@809 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_db_utilities.php | 9 +++++++-- phpBB/language/lang_english.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/phpBB/admin/admin_db_utilities.php b/phpBB/admin/admin_db_utilities.php index eb8160bac6..a9a067d1c3 100644 --- a/phpBB/admin/admin_db_utilities.php +++ b/phpBB/admin/admin_db_utilities.php @@ -997,7 +997,12 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) if($do_gzip_compress) { - $sql_query = gzread(gzopen($backup_file_tmpname, 'rb'), filesize($backup_file_tmpname)); + $gz_ptr = gzopen($backup_file_tmpname, 'rb'); + $sql_query = ""; + while( !gzeof($gz_ptr) ) + { + $sql_query .= gzgets($gz_ptr, 100000); + } } else { @@ -1045,7 +1050,7 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) echo "Executing: $sql\n
"; flush(); } - + $result = $db->sql_query($sql); if(!$result && ( !(SQL_LAYER == 'postgres' && eregi("drop table", $sql) ) ) ) diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 6879d66c46..e8c9c9c90f 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -671,7 +671,7 @@ $lang['Not_available'] = "Not available"; $lang['Database_Utilities'] = "Database Utilities"; $lang['Restore'] = "Restore"; $lang['Backup'] = "Backup"; -$lang['Restore_explain'] = "This will perform a full restore of all phpBB tables from a saved file. If your server supports it you may upload a gzip compressed text file and it will automatically be decompressed. WARNING This will overwrite any existing data."; +$lang['Restore_explain'] = "This will perform a full restore of all phpBB tables from a saved file. If your server supports it you may upload a gzip compressed text file and it will automatically be decompressed. WARNING This will overwrite any existing data. The restore may take a long time to process please do not move from this page till it is complete."; $lang['Backup_explain'] = "Here you can backup all your phpBB related data. If you have any additional custom tables in the same database with phpBB that you would like to back up as well please enter their names seperated by commas in the Additional Tables textbox below. If your server supports it you may also gzip compress the file to reduce its size before download."; $lang['Backup_options'] = "Backup options"; $lang['Start_backup'] = "Start Backup";