[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