Permalink
Browse files

Bzip2 import

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1041 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent afbba65 commit 0a2d81d75a84e5543c7e6a34a95ea921060cd835 jakubvrana committed Aug 29, 2009
Showing with 8 additions and 2 deletions.
  1. +4 −1 adminer/include/functions.inc.php
  2. +4 −1 adminer/sql.inc.php
@@ -166,7 +166,10 @@ function get_file($key, $decompress = false) {
if (!$file || $file["error"]) {
return $file["error"];
}
- return file_get_contents($decompress && ereg('\\.gz$', $file["name"]) ? "compress.zlib://$file[tmp_name]" : $file["tmp_name"]); //! may not be reachable because of open_basedir
+ return file_get_contents($decompress && ereg('\\.gz$', $file["name"]) ? "compress.zlib://$file[tmp_name]"
+ : ($decompress && ereg('\\.bz2$', $file["name"]) ? "compress.bzip2://$file[tmp_name]"
+ : $file["tmp_name"]
+ )); //! may not be reachable because of open_basedir
}
function upload_error($error) {
View
@@ -10,7 +10,10 @@
if (!$error && $_POST) {
$query = $_POST["query"];
if ($_POST["webfile"]) {
- $query = @file_get_contents(file_exists("adminer.sql") ? "adminer.sql" : "compress.zlib://adminer.sql.gz");
+ $query = @file_get_contents(file_exists("adminer.sql") ? "adminer.sql"
+ : (file_exists("adminer.sql.gz") ? "compress.zlib://adminer.sql.gz"
+ : "compress.bzip2://adminer.sql.bz2"
+ ));
} elseif ($_POST["file"]) {
$query = get_file("sql_file", true);
}

0 comments on commit 0a2d81d

Please sign in to comment.