[geeklog-cvs] geeklog: Bigdump.php updated from version 0.29b to 0.32b
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Feb 26 15:14:10 EST 2011
changeset 8135:17c1e0318b57
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/17c1e0318b57
user: Rouslan Placella <rouslan at placella.com>
date: Tue May 18 12:30:11 2010 +0100
description:
Bigdump.php updated from version 0.29b to 0.32b
diffstat:
public_html/admin/install/bigdump.php | 38 ++++-----
public_html/admin/install/language/chinese_simplified_utf-8.php | 10 +-
public_html/admin/install/language/chinese_traditional_utf-8.php | 10 +-
public_html/admin/install/language/english.php | 6 +-
public_html/admin/install/language/german.php | 6 +-
public_html/admin/install/language/hebrew_utf-8.php | 4 +-
public_html/admin/install/language/japanese_utf-8.php | 7 +-
public_html/admin/install/language/polish.php | 4 +-
8 files changed, 35 insertions(+), 50 deletions(-)
diffs (265 lines):
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/bigdump.php
--- a/public_html/admin/install/bigdump.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/bigdump.php Tue May 18 12:30:11 2010 +0100
@@ -2,7 +2,7 @@
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
-// | Geeklog 1.6 |
+// | Geeklog 1.7 |
// +---------------------------------------------------------------------------+
// | bigdump.php |
// | |
@@ -10,8 +10,9 @@
// +---------------------------------------------------------------------------+
// | Copyright (C) 2008-2009 by the following authors: |
// | |
-// | Authors: Alexey Ozerov - alexey AT ozerov DOT de (BigDump author) |
-// | Matt West - matt.danger.west AT gmail DOT com |
+// | Authors: Alexey Ozerov - alexey AT ozerov DOT de (BigDump author) |
+// | Matt West - matt.danger.west AT gmail DOT com |
+// | Rouslan Placella - rouslan AT placella DOT com |
// +---------------------------------------------------------------------------+
// | |
// | This program is free software; you can redistribute it and/or |
@@ -58,7 +59,6 @@
// Other settings (optional)
$filename = ''; // Specify the dump filename to suppress the file selection dialog
-$csv_insert_table = ''; // Destination table for CSV files
$linespersession = 3000; // Lines to be executed per one import session
$delaypersession = 0; // You can specify a sleep time in milliseconds after each session
// Works only if JavaScript is activated. Use to reduce server overrun
@@ -83,19 +83,28 @@
// If not familiar with PHP please don't change anything below this line
// *******************************************************************************************
-//define ('VERSION','0.29b');
+//define ('VERSION','0.32b');
define ('DATA_CHUNK_LENGTH',16384); // How many chars are read per time
define ('MAX_QUERY_LINES',300); // How many lines may be considered to be one query (except text lines)
define ('TESTMODE',false); // Set to true to process the file without actually accessing the database
@ini_set('auto_detect_line_endings', true);
@set_time_limit(0);
+if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get"))
+ @date_default_timezone_set(@date_default_timezone_get());
+
header('Content-Type: text/html; charset=' . $LANG_CHARSET);
echo INST_getHeader($LANG_MIGRATE[17]);
$error = false;
$file = false;
+// Check if mysql extension is available
+if (!$error && !function_exists('mysql_connect')) {
+ echo '<p>' . $LANG_BIGDUMP[11] . '</p>' . LB;
+ $error=true;
+}
+
// Get the current directory
if (isset($_SERVER["CGIA"]))
$upload_dir=dirname($_SERVER["CGIA"]);
@@ -141,12 +150,12 @@
$curfilename = "";
// Recognize GZip filename
- if (eregi("\.gz$",$curfilename))
+ if (preg_match("/\.gz$/i",$curfilename))
$gzipmode = true;
else
$gzipmode = false;
- if ((!$gzipmode && !$file=@fopen($curfilename,"rt")) || ($gzipmode && !$file=@gzopen($curfilename,"rt"))) {
+ if ((!$gzipmode && !$file=@fopen($curfilename,"r")) || ($gzipmode && !$file=@gzopen($curfilename,"r"))) {
echo INST_getAlertMsg($LANG_BIGDUMP[5] . $curfilename . $LANG_BIGDUMP[6]);
$error = true;
}
@@ -165,7 +174,7 @@
// START IMPORT SESSION HERE
// *******************************************************************************************
-if (!$error && isset($_REQUEST["start"]) && isset($_REQUEST["foffset"]) && eregi("(\.(sql|gz|csv))$",$curfilename)) {
+if (!$error && isset($_REQUEST["start"]) && isset($_REQUEST["foffset"]) && preg_match("/(\.(sql|gz))$/i",$curfilename)) {
// Check start and foffset are numeric values
if (!is_numeric($_REQUEST["start"]) || !is_numeric($_REQUEST["foffset"])) {
@@ -213,17 +222,6 @@
}
if ($dumpline==="") break;
- // Stop if csv file is used, but $csv_insert_table is not set
- if (($csv_insert_table == "") && (eregi("(\.csv)$",$curfilename))) {
- echo INST_getAlertMsg($LANG_BIGDUMP[11] . $linenumber . $LANG_BIGDUMP[12] . $csv_insert_table . $LANG_BIGDUMP[13]);
- $error=true;
- break;
- }
-
- // Create an SQL query from CSV line
- if (($csv_insert_table != "") && (eregi("(\.csv)$",$curfilename)))
- $dumpline = 'INSERT INTO '.$csv_insert_table.' VALUES ('.$dumpline.');';
-
// Handle DOS and Mac encoded linebreaks (I don't know if it will work on Win32 or Mac Servers)
$dumpline=str_replace("\r\n", "\n", $dumpline);
$dumpline=str_replace("\r", "\n", $dumpline);
@@ -268,7 +266,7 @@
}
// Execute query if end of query detected (; as last character) AND NOT in parents
- if (ereg(";$",trim($dumpline)) && !$inparents) {
+ if (preg_match("/;$/",trim($dumpline)) && !$inparents) {
if (!TESTMODE && !mysql_query(trim($query), $dbconnection)) {
echo INST_getAlertMsg($LANG_BIGDUMP[17] . $linenumber . ': ' . trim($dumpline) . '.<br ' . XHTML . '>' . $LANG_BIGDUMP[18] . trim(nl2br(htmlentities($query))) . '<br ' . XHTML . '>' . $LANG_BIGDUMP[19] . mysql_error());
$error=true;
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/language/chinese_simplified_utf-8.php
--- a/public_html/admin/install/language/chinese_simplified_utf-8.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/language/chinese_simplified_utf-8.php Tue May 18 12:30:11 2010 +0100
@@ -14,9 +14,9 @@
// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
// | Jason Whittenburg - jwhitten AT securitygeeks DOT com |
// | Dirk Haun - dirk AT haun-online DOT de |
-// | Randy Kolenko - randy AT nextide DOT ca |
-// | Matt West - matt AT mattdanger DOT net |
-// | Samuel Maung Stone - sam AT stonemicro DOT com |
+// | Randy Kolenko - randy AT nextide DOT ca |
+// | Matt West - matt AT mattdanger DOT net |
+// | Samuel Maung Stone - sam AT stonemicro DOT com |
// +---------------------------------------------------------------------------+
// | |
// | This program is free software; you can redistribute it and/or |
@@ -287,9 +287,7 @@
8 => 'Processing file:',
9 => 'Can\'t set file pointer behind the end of file.',
10 => 'Can\'t set file pointer to offset: ',
- 11 => 'Stopped at the line ',
- 12 => '. At this place the current query is from csv file, but ',
- 13 => ' was not set.',
+ 11 => 'There is no mySQL extension available in your PHP installation.',
14 => 'Stopped at the line ',
15 => '. At this place the current query includes more than ',
16 => ' dump lines. That can happen if your dump file was created by some tool which doesn\'t place a semicolon followed by a linebreak at the end of each query, or if your dump contains extended inserts. Please read the BigDump FAQs for more information.',
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/language/chinese_traditional_utf-8.php
--- a/public_html/admin/install/language/chinese_traditional_utf-8.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/language/chinese_traditional_utf-8.php Tue May 18 12:30:11 2010 +0100
@@ -14,9 +14,9 @@
// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
// | Jason Whittenburg - jwhitten AT securitygeeks DOT com |
// | Dirk Haun - dirk AT haun-online DOT de |
-// | Randy Kolenko - randy AT nextide DOT ca |
-// | Matt West - matt AT mattdanger DOT net |
-// | Samuel Maung Stone - sam AT stonemicro DOT com |
+// | Randy Kolenko - randy AT nextide DOT ca |
+// | Matt West - matt AT mattdanger DOT net |
+// | Samuel Maung Stone - sam AT stonemicro DOT com |
// +---------------------------------------------------------------------------+
// | |
// | This program is free software; you can redistribute it and/or |
@@ -287,9 +287,7 @@
8 => 'Processing file:',
9 => 'Can\'t set file pointer behind the end of file.',
10 => 'Can\'t set file pointer to offset: ',
- 11 => 'Stopped at the line ',
- 12 => '. At this place the current query is from csv file, but ',
- 13 => ' was not set.',
+ 11 => 'There is no mySQL extension available in your PHP installation.',
14 => 'Stopped at the line ',
15 => '. At this place the current query includes more than ',
16 => ' dump lines. That can happen if your dump file was created by some tool which doesn\'t place a semicolon followed by a linebreak at the end of each query, or if your dump contains extended inserts. Please read the BigDump FAQs for more information.',
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/language/english.php
--- a/public_html/admin/install/language/english.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/language/english.php Tue May 18 12:30:11 2010 +0100
@@ -14,7 +14,7 @@
// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
// | Jason Whittenburg - jwhitten AT securitygeeks DOT com |
// | Dirk Haun - dirk AT haun-online DOT de |
-// | Randy Kolenko - randy AT nextide DOT ca
+// | Randy Kolenko - randy AT nextide DOT ca |
// | Matt West - matt AT mattdanger DOT net |
// +---------------------------------------------------------------------------+
// | |
@@ -286,9 +286,7 @@
8 => 'Processing file:',
9 => 'Can\'t set file pointer behind the end of file.',
10 => 'Can\'t set file pointer to offset: ',
- 11 => 'Stopped at the line ',
- 12 => '. At this place the current query is from csv file, but ',
- 13 => ' was not set.',
+ 11 => 'There is no mySQL extension available in your PHP installation.',
14 => 'Stopped at the line ',
15 => '. At this place the current query includes more than ',
16 => ' dump lines. That can happen if your dump file was created by some tool which doesn\'t place a semicolon followed by a linebreak at the end of each query, or if your dump contains extended inserts. Please read the BigDump FAQs for more information.',
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/language/german.php
--- a/public_html/admin/install/language/german.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/language/german.php Tue May 18 12:30:11 2010 +0100
@@ -14,7 +14,7 @@
// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
// | Jason Whittenburg - jwhitten AT securitygeeks DOT com |
// | Dirk Haun - dirk AT haun-online DOT de |
-// | Randy Kolenko - randy AT nextide DOT ca
+// | Randy Kolenko - randy AT nextide DOT ca |
// | Matt West - matt AT mattdanger DOT net |
// +---------------------------------------------------------------------------+
// | |
@@ -286,9 +286,7 @@
8 => 'Backup-Datei:',
9 => 'Can\'t set file pointer behind the end of file.',
10 => 'Can\'t set file pointer to offset: ',
- 11 => 'Stopped at the line ',
- 12 => '. At this place the current query is from csv file, but ',
- 13 => ' was not set.',
+ 11 => 'There is no mySQL extension available in your PHP installation.',
14 => 'Stopped at the line ',
15 => '. At this place the current query includes more than ',
16 => ' dump lines. That can happen if your dump file was created by some tool which doesn\'t place a semicolon followed by a linebreak at the end of each query, or if your dump contains extended inserts. Please read the BigDump FAQs for more information.',
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/language/hebrew_utf-8.php
--- a/public_html/admin/install/language/hebrew_utf-8.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/language/hebrew_utf-8.php Tue May 18 12:30:11 2010 +0100
@@ -282,9 +282,7 @@
8 => '××¢×× ×ת ×ק×××¥:',
9 => '×× ×××× ×××××ר ס×× ×§×××¥ ×××¨× ×¡××£ ×ק×××¥.',
10 => '×× ×××× ×ק×××¢ ×ת ס×× ×ק×××¥ ×××פ-ס×: ',
- 11 => '× ×¢×¦×¨ ×ש××¨× ',
- 12 => '. ××ק×× ×× ××ש×× ×× ×××× ××× ×ק×××¥ csv, ××× ',
- 13 => ' ×× ××××.',
+ 11 => 'There is no mySQL extension available in your PHP installation.',
14 => '× ×¢×¦×¨ ×ש××¨× ',
15 => '. ××ק×× ×× ××ש×× ×× ×××× ×××× ××תר ××שר ',
16 => ' ש×ר×ת dump. ×× ×××× ×קר×ת ×× ×§×××¥ ×-dump ש××× × ×צר ×¢× ××× ××× ×©×× ×©× × ×§××× ×¤×¡×ק ××× ×¢××ר ש××¨× ×ס××£ ×©× ×× ×ש××, ×× ×©×-dump ש××× ×××× ××× ×¡×ת ××ר×××ת. ×× × ×§×ר×× ×ת ×ש×××ת ×ש××××ת ×©× BigDump ×××××¢ × ×סף.',
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/language/japanese_utf-8.php
--- a/public_html/admin/install/language/japanese_utf-8.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/language/japanese_utf-8.php Tue May 18 12:30:11 2010 +0100
@@ -288,9 +288,7 @@
8 => 'ä½æ¥ä¸ ãã¡ã¤ã«:',
9 => 'ãã¡ã¤ã«ã®æ«å°¾ã«ãã¡ã¤ã«ãã¤ã³ã¿ã移åã§ãã¾ããã',
10 => 'ãã¡ã¤ã«ãã¤ã³ã¿ç§»åä¸å¯:',
- 11 => 'ä¸æ¢ããè¡çªå·:',
- 12 => 'ãããã®ã«ã¬ã³ãã¯ã¨ãªã¯CSVãã¡ã¤ã«ããã§ããã',
- 13 => 'ã¯ã»ããããã¾ããã§ããã',
+ 11 => 'There is no mySQL extension available in your PHP installation.',
14 => 'ä¸æ¢ããè¡ç:',
15 => 'ããã®ã¯ã¨ãªã«ã¯',
16 => 'è¡ä»¥ä¸ãå«ã¾ãã¦ãã¾ããåã¯ã¨ãªã®æ«å°¾ã«ã»ãã³ãã³ãä»ããªããã¼ã«ã§ãã³ããã¡ã¤ã«ãçæããå ´åãããã³ããã¡ã¤ã«ã®ä¸ã«è¤æ°è¡INSERTæãå«ã¾ããå ´åã«çºçããå¯è½æ§ãããã¾ãã',
@@ -308,7 +306,8 @@
28 => 'ã¾ãã¯å¾
ã£ã¦!',
29 => 'ã¨ã©ã¼ãçºçãã¾ããã',
30 => 'æåããã¹ã¿ã¼ã',
- 31 => '(åèµ·åããåã«å¤ããã¼ãã«ãåé¤ãã¦ãã ãã)'
+ 31 => '(åèµ·åããåã«å¤ããã¼ãã«ãåé¤ãã¦ãã ãã)',
+ 32 => 'There is no mySQL extension available in your PHP installation.'
);
// +---------------------------------------------------------------------------+
diff -r 72c18beafdb1 -r 17c1e0318b57 public_html/admin/install/language/polish.php
--- a/public_html/admin/install/language/polish.php Fri Feb 25 22:27:43 2011 +0000
+++ b/public_html/admin/install/language/polish.php Tue May 18 12:30:11 2010 +0100
@@ -286,9 +286,7 @@
8 => 'Processing file:',
9 => 'Can\'t set file pointer behind the end of file.',
10 => 'Can\'t set file pointer to offset: ',
- 11 => 'Stopped at the line ',
- 12 => '. At this place the current query is from csv file, but ',
- 13 => ' was not set.',
+ 11 => 'There is no mySQL extension available in your PHP installation.',
14 => 'Stopped at the line ',
15 => '. At this place the current query includes more than ',
16 => ' dump lines. That can happen if your dump file was created by some tool which doesn\'t place a semicolon followed by a linebreak at the end of each query, or if your dump contains extended inserts. Please read the BigDump FAQs for more information.',
More information about the geeklog-cvs
mailing list