@@ -17,14 +17,14 @@ |
||
17 | 17 | * @version $Id $ |
18 | 18 | **/ |
19 | 19 | |
20 | -if ( !include("../../mainfile.php") ) { |
|
20 | +if (!include("../../mainfile.php")) { |
|
21 | 21 | die("XOOPS root path not defined"); |
22 | 22 | } |
23 | -$module_dirname = basename( dirname( __FILE__ ) ) ; |
|
24 | -if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) exit( _NOPERM ); |
|
23 | +$module_dirname = basename(dirname(__FILE__)); |
|
24 | +if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) exit(_NOPERM); |
|
25 | 25 | $xoopsOption["template_main"] = $module_dirname . "_index.html"; |
26 | 26 | |
27 | -include(XOOPS_ROOT_PATH."/header.php"); |
|
27 | +include(XOOPS_ROOT_PATH . "/header.php"); |
|
28 | 28 | |
29 | -include(XOOPS_ROOT_PATH."/footer.php"); |
|
29 | +include(XOOPS_ROOT_PATH . "/footer.php"); |
|
30 | 30 | ?> |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @author Kris <http://www.xoofoo.org> |
17 | 17 | * @version $Id $ |
18 | 18 | **/ |
19 | -$module_dirname = basename( dirname( __FILE__ ) ) ; |
|
19 | +$module_dirname = basename(dirname(__FILE__)); |
|
20 | 20 | $modversion['name'] = _MI_ADMINER_NAME; |
21 | 21 | $modversion['version'] = 3.0; |
22 | 22 | $modversion['description'] = _MI_ADMINER_DESC; |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | * @version $Id $ |
18 | 18 | **/ |
19 | 19 | // connect xoops database |
20 | -if ( !include("../../mainfile.php") ) { |
|
20 | +if (!include("../../mainfile.php")) { |
|
21 | 21 | die("XOOPS root path not defined"); |
22 | 22 | } |
23 | -$module_dirname = basename( dirname( __FILE__ ) ) ; |
|
24 | -include(XOOPS_ROOT_PATH."/header.php"); |
|
25 | -if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) exit( _NOPERM ); |
|
23 | +$module_dirname = basename(dirname(__FILE__)); |
|
24 | +include(XOOPS_ROOT_PATH . "/header.php"); |
|
25 | +if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) exit(_NOPERM); |
|
26 | 26 | |
27 | 27 | function adminer_object() { |
28 | 28 | class AdminerKfr extends Adminer { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return 'XOOPS Admin'; |
31 | 31 | } |
32 | 32 | function credentials() { |
33 | - return array(XOOPS_DB_HOST,XOOPS_DB_USER,XOOPS_DB_PASS); |
|
33 | + return array(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_PASS); |
|
34 | 34 | } |
35 | 35 | function database() { |
36 | 36 | return XOOPS_DB_NAME; |
@@ -47,28 +47,28 @@ discard block |
||
47 | 47 | |
48 | 48 | // Other settings (optional) |
49 | 49 | |
50 | -$filename = ''; // Specify the dump filename to suppress the file selection dialog |
|
51 | -$ajax = true; // AJAX mode: import will be done without refreshing the website |
|
52 | -$linespersession = 3000; // Lines to be executed per one import session |
|
53 | -$delaypersession = 0; // You can specify a sleep time in milliseconds after each session |
|
50 | +$filename = ''; // Specify the dump filename to suppress the file selection dialog |
|
51 | +$ajax = true; // AJAX mode: import will be done without refreshing the website |
|
52 | +$linespersession = 3000; // Lines to be executed per one import session |
|
53 | +$delaypersession = 0; // You can specify a sleep time in milliseconds after each session |
|
54 | 54 | // Works only if JavaScript is activated. Use to reduce server overrun |
55 | 55 | |
56 | 56 | // CSV related settings (only if you use a CSV dump) |
57 | 57 | |
58 | -$csv_insert_table = ''; // Destination table for CSV files |
|
59 | -$csv_preempty_table = false; // true: delete all entries from table specified in $csv_insert_table before processing |
|
60 | -$csv_delimiter = ','; // Field delimiter in CSV file |
|
61 | -$csv_add_quotes = true; // If your CSV data already have quotes around each field set it to false |
|
62 | -$csv_add_slashes = true; // If your CSV data already have slashes in front of ' and " set it to false |
|
58 | +$csv_insert_table = ''; // Destination table for CSV files |
|
59 | +$csv_preempty_table = false; // true: delete all entries from table specified in $csv_insert_table before processing |
|
60 | +$csv_delimiter = ','; // Field delimiter in CSV file |
|
61 | +$csv_add_quotes = true; // If your CSV data already have quotes around each field set it to false |
|
62 | +$csv_add_slashes = true; // If your CSV data already have slashes in front of ' and " set it to false |
|
63 | 63 | |
64 | 64 | // Allowed comment markers: lines starting with these strings will be ignored by BigDump |
65 | 65 | |
66 | -$comment[]='#'; // Standard comment lines are dropped by default |
|
67 | -$comment[]='-- '; |
|
68 | -$comment[]='DELIMITER'; // Ignore DELIMITER switch as it's not a valid SQL statement |
|
66 | +$comment[] = '#'; // Standard comment lines are dropped by default |
|
67 | +$comment[] = '-- '; |
|
68 | +$comment[] = 'DELIMITER'; // Ignore DELIMITER switch as it's not a valid SQL statement |
|
69 | 69 | // $comment[]='---'; // Uncomment this line if using proprietary dump created by outdated mysqldump |
70 | 70 | // $comment[]='CREATE DATABASE'; // Uncomment this line if your dump contains create database queries in order to ignore them |
71 | -$comment[]='/*!'; // Or add your own string to leave out other proprietary things |
|
71 | +$comment[] = '/*!'; // Or add your own string to leave out other proprietary things |
|
72 | 72 | |
73 | 73 | // Pre-queries: SQL queries to be executed at the beginning of each import session |
74 | 74 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | // String quotes character |
90 | 90 | |
91 | -$string_quotes = '\''; // Change to '"' if your dump file uses double qoutes for strings |
|
91 | +$string_quotes = '\''; // Change to '"' if your dump file uses double qoutes for strings |
|
92 | 92 | |
93 | 93 | |
94 | 94 | // ******************************************************************************************* |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | if ($ajax) |
99 | 99 | ob_start(); |
100 | 100 | |
101 | -define ('VERSION','0.34b'); |
|
102 | -define ('DATA_CHUNK_LENGTH',16384); // How many chars are read per time |
|
103 | -define ('MAX_QUERY_LINES',300); // How many lines may be considered to be one query (except text lines) |
|
104 | -define ('TESTMODE',false); // Set to true to process the file without actually accessing the database |
|
101 | +define('VERSION', '0.34b'); |
|
102 | +define('DATA_CHUNK_LENGTH', 16384); // How many chars are read per time |
|
103 | +define('MAX_QUERY_LINES', 300); // How many lines may be considered to be one query (except text lines) |
|
104 | +define('TESTMODE', false); // Set to true to process the file without actually accessing the database |
|
105 | 105 | |
106 | 106 | header("Expires: Mon, 1 Dec 2003 01:00:00 GMT"); |
107 | 107 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | foreach ($_REQUEST as $key => $val) |
121 | 121 | { |
122 | - $val = preg_replace("/[^_A-Za-z0-9-\.&= ;\$]/i",'', $val); |
|
122 | + $val = preg_replace("/[^_A-Za-z0-9-\.&= ;\$]/i", '', $val); |
|
123 | 123 | $_REQUEST[$key] = $val; |
124 | 124 | } |
125 | 125 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | skin_open(); |
275 | -echo ('<h1>BigDump: Staggered MySQL Dump Importer v'.VERSION.'</h1>'); |
|
275 | +echo ('<h1>BigDump: Staggered MySQL Dump Importer v' . VERSION . '</h1>'); |
|
276 | 276 | skin_close(); |
277 | 277 | |
278 | 278 | $error = false; |
@@ -281,56 +281,56 @@ discard block |
||
281 | 281 | // Check PHP version |
282 | 282 | |
283 | 283 | if (!$error && !function_exists('version_compare')) |
284 | -{ echo ("<p class=\"error\">PHP version 4.1.0 is required for BigDump to proceed. You have PHP ".phpversion()." installed. Sorry!</p>\n"); |
|
285 | - $error=true; |
|
284 | +{ echo ("<p class=\"error\">PHP version 4.1.0 is required for BigDump to proceed. You have PHP " . phpversion() . " installed. Sorry!</p>\n"); |
|
285 | + $error = true; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | // Check if mysql extension is available |
289 | 289 | |
290 | 290 | if (!$error && !function_exists('mysql_connect')) |
291 | 291 | { echo ("<p class=\"error\">There is no mySQL extension available in your PHP installation. Sorry!</p>\n"); |
292 | - $error=true; |
|
292 | + $error = true; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | // Calculate PHP max upload size (handle settings like 10M or 100K) |
296 | 296 | |
297 | 297 | if (!$error) |
298 | -{ $upload_max_filesize=ini_get("upload_max_filesize"); |
|
299 | - if (preg_match("/([0-9]+)K/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024; |
|
300 | - if (preg_match("/([0-9]+)M/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024*1024; |
|
301 | - if (preg_match("/([0-9]+)G/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024*1024*1024; |
|
298 | +{ $upload_max_filesize = ini_get("upload_max_filesize"); |
|
299 | + if (preg_match("/([0-9]+)K/i", $upload_max_filesize, $tempregs)) $upload_max_filesize = $tempregs[1] * 1024; |
|
300 | + if (preg_match("/([0-9]+)M/i", $upload_max_filesize, $tempregs)) $upload_max_filesize = $tempregs[1] * 1024 * 1024; |
|
301 | + if (preg_match("/([0-9]+)G/i", $upload_max_filesize, $tempregs)) $upload_max_filesize = $tempregs[1] * 1024 * 1024 * 1024; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | // Get the current directory |
305 | 305 | |
306 | 306 | if (isset($_SERVER["CGIA"])) |
307 | - $upload_dir=dirname($_SERVER["CGIA"]); |
|
307 | + $upload_dir = dirname($_SERVER["CGIA"]); |
|
308 | 308 | else if (isset($_SERVER["ORIG_PATH_TRANSLATED"])) |
309 | - $upload_dir=dirname($_SERVER["ORIG_PATH_TRANSLATED"]); |
|
309 | + $upload_dir = dirname($_SERVER["ORIG_PATH_TRANSLATED"]); |
|
310 | 310 | else if (isset($_SERVER["ORIG_SCRIPT_FILENAME"])) |
311 | - $upload_dir=dirname($_SERVER["ORIG_SCRIPT_FILENAME"]); |
|
311 | + $upload_dir = dirname($_SERVER["ORIG_SCRIPT_FILENAME"]); |
|
312 | 312 | else if (isset($_SERVER["PATH_TRANSLATED"])) |
313 | - $upload_dir=dirname($_SERVER["PATH_TRANSLATED"]); |
|
313 | + $upload_dir = dirname($_SERVER["PATH_TRANSLATED"]); |
|
314 | 314 | else |
315 | - $upload_dir=dirname($_SERVER["SCRIPT_FILENAME"]); |
|
315 | + $upload_dir = dirname($_SERVER["SCRIPT_FILENAME"]); |
|
316 | 316 | |
317 | 317 | // Handle file upload |
318 | 318 | |
319 | 319 | if (!$error && isset($_REQUEST["uploadbutton"])) |
320 | -{ if (is_uploaded_file($_FILES["dumpfile"]["tmp_name"]) && ($_FILES["dumpfile"]["error"])==0) |
|
320 | +{ if (is_uploaded_file($_FILES["dumpfile"]["tmp_name"]) && ($_FILES["dumpfile"]["error"]) == 0) |
|
321 | 321 | { |
322 | - $uploaded_filename=str_replace(" ","_",$_FILES["dumpfile"]["name"]); |
|
323 | - $uploaded_filename=preg_replace("/[^_A-Za-z0-9-\.]/i",'',$uploaded_filename); |
|
324 | - $uploaded_filepath=str_replace("\\","/",$upload_dir."/".$uploaded_filename); |
|
322 | + $uploaded_filename = str_replace(" ", "_", $_FILES["dumpfile"]["name"]); |
|
323 | + $uploaded_filename = preg_replace("/[^_A-Za-z0-9-\.]/i", '', $uploaded_filename); |
|
324 | + $uploaded_filepath = str_replace("\\", "/", $upload_dir . "/" . $uploaded_filename); |
|
325 | 325 | |
326 | 326 | if (file_exists($uploaded_filename)) |
327 | 327 | { echo ("<p class=\"error\">File $uploaded_filename already exist! Delete and upload again!</p>\n"); |
328 | 328 | } |
329 | - else if (!preg_match("/(\.(sql|gz|csv))$/i",$uploaded_filename)) |
|
329 | + else if (!preg_match("/(\.(sql|gz|csv))$/i", $uploaded_filename)) |
|
330 | 330 | { echo ("<p class=\"error\">You may only upload .sql .gz or .csv files.</p>\n"); |
331 | 331 | } |
332 | - else if (!@move_uploaded_file($_FILES["dumpfile"]["tmp_name"],$uploaded_filepath)) |
|
333 | - { echo ("<p class=\"error\">Error moving uploaded file ".$_FILES["dumpfile"]["tmp_name"]." to the $uploaded_filepath</p>\n"); |
|
332 | + else if (!@move_uploaded_file($_FILES["dumpfile"]["tmp_name"], $uploaded_filepath)) |
|
333 | + { echo ("<p class=\"error\">Error moving uploaded file " . $_FILES["dumpfile"]["tmp_name"] . " to the $uploaded_filepath</p>\n"); |
|
334 | 334 | echo ("<p>Check the directory permissions for $upload_dir (must be 777)!</p>\n"); |
335 | 335 | } |
336 | 336 | else |
@@ -338,42 +338,42 @@ discard block |
||
338 | 338 | } |
339 | 339 | } |
340 | 340 | else |
341 | - { echo ("<p class=\"error\">Error uploading file ".$_FILES["dumpfile"]["name"]."</p>\n"); |
|
341 | + { echo ("<p class=\"error\">Error uploading file " . $_FILES["dumpfile"]["name"] . "</p>\n"); |
|
342 | 342 | } |
343 | 343 | } |
344 | 344 | |
345 | 345 | |
346 | 346 | // Handle file deletion (delete only in the current directory for security reasons) |
347 | 347 | |
348 | -if (!$error && isset($_REQUEST["delete"]) && $_REQUEST["delete"]!=basename($_SERVER["SCRIPT_FILENAME"])) |
|
349 | -{ if (preg_match("/(\.(sql|gz|csv))$/i",$_REQUEST["delete"]) && @unlink(basename($_REQUEST["delete"]))) |
|
350 | - echo ("<p class=\"success\">".$_REQUEST["delete"]." was removed successfully</p>\n"); |
|
348 | +if (!$error && isset($_REQUEST["delete"]) && $_REQUEST["delete"] != basename($_SERVER["SCRIPT_FILENAME"])) |
|
349 | +{ if (preg_match("/(\.(sql|gz|csv))$/i", $_REQUEST["delete"]) && @unlink(basename($_REQUEST["delete"]))) |
|
350 | + echo ("<p class=\"success\">" . $_REQUEST["delete"] . " was removed successfully</p>\n"); |
|
351 | 351 | else |
352 | - echo ("<p class=\"error\">Can't remove ".$_REQUEST["delete"]."</p>\n"); |
|
352 | + echo ("<p class=\"error\">Can't remove " . $_REQUEST["delete"] . "</p>\n"); |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | // Connect to the database, set charset and execute pre-queries |
356 | 356 | |
357 | 357 | if (!$error && !TESTMODE) |
358 | -{ $dbconnection = @mysql_connect($db_server,$db_username,$db_password); |
|
358 | +{ $dbconnection = @mysql_connect($db_server, $db_username, $db_password); |
|
359 | 359 | if ($dbconnection) |
360 | 360 | $db = mysql_select_db($db_name); |
361 | 361 | if (!$dbconnection || !$db) |
362 | - { echo ("<p class=\"error\">Database connection failed due to ".mysql_error()."</p>\n"); |
|
363 | - echo ("<p>Edit the database settings in ".$_SERVER["SCRIPT_FILENAME"]." or contact your database provider.</p>\n"); |
|
364 | - $error=true; |
|
362 | + { echo ("<p class=\"error\">Database connection failed due to " . mysql_error() . "</p>\n"); |
|
363 | + echo ("<p>Edit the database settings in " . $_SERVER["SCRIPT_FILENAME"] . " or contact your database provider.</p>\n"); |
|
364 | + $error = true; |
|
365 | 365 | } |
366 | - if (!$error && $db_connection_charset!=='') |
|
366 | + if (!$error && $db_connection_charset !== '') |
|
367 | 367 | @mysql_query("SET NAMES $db_connection_charset", $dbconnection); |
368 | 368 | |
369 | - if (!$error && isset ($pre_query) && sizeof ($pre_query)>0) |
|
369 | + if (!$error && isset ($pre_query) && sizeof($pre_query) > 0) |
|
370 | 370 | { reset($pre_query); |
371 | 371 | foreach ($pre_query as $pre_query_value) |
372 | 372 | { if (!@mysql_query($pre_query_value, $dbconnection)) |
373 | 373 | { echo ("<p class=\"error\">Error with pre-query.</p>\n"); |
374 | - echo ("<p>Query: ".trim(nl2br(htmlentities($pre_query_value)))."</p>\n"); |
|
375 | - echo ("<p>MySQL: ".mysql_error()."</p>\n"); |
|
376 | - $error=true; |
|
374 | + echo ("<p>Query: " . trim(nl2br(htmlentities($pre_query_value))) . "</p>\n"); |
|
375 | + echo ("<p>MySQL: " . mysql_error() . "</p>\n"); |
|
376 | + $error = true; |
|
377 | 377 | break; |
378 | 378 | } |
379 | 379 | } |
@@ -389,38 +389,38 @@ discard block |
||
389 | 389 | |
390 | 390 | // List uploaded files in multifile mode |
391 | 391 | |
392 | -if (!$error && !isset($_REQUEST["fn"]) && $filename=="") |
|
392 | +if (!$error && !isset($_REQUEST["fn"]) && $filename == "") |
|
393 | 393 | { if ($dirhandle = opendir($upload_dir)) |
394 | 394 | { |
395 | - $files=array(); |
|
395 | + $files = array(); |
|
396 | 396 | while (false !== ($files[] = readdir($dirhandle))); |
397 | 397 | closedir($dirhandle); |
398 | - $dirhead=false; |
|
398 | + $dirhead = false; |
|
399 | 399 | |
400 | - if (sizeof($files)>0) |
|
400 | + if (sizeof($files) > 0) |
|
401 | 401 | { |
402 | 402 | sort($files); |
403 | 403 | foreach ($files as $dirfile) |
404 | 404 | { |
405 | - if ($dirfile != "." && $dirfile != ".." && $dirfile!=basename($_SERVER["SCRIPT_FILENAME"]) && preg_match("/\.(sql|gz|csv)$/i",$dirfile)) |
|
405 | + if ($dirfile != "." && $dirfile != ".." && $dirfile != basename($_SERVER["SCRIPT_FILENAME"]) && preg_match("/\.(sql|gz|csv)$/i", $dirfile)) |
|
406 | 406 | { if (!$dirhead) |
407 | 407 | { echo ("<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\">\n"); |
408 | 408 | echo ("<tr><th>Filename</th><th>Size</th><th>Date&Time</th><th>Type</th><th> </th><th> </th>\n"); |
409 | - $dirhead=true; |
|
409 | + $dirhead = true; |
|
410 | 410 | } |
411 | - echo ("<tr><td>$dirfile</td><td class=\"right\">".filesize($dirfile)."</td><td>".date ("Y-m-d H:i:s", filemtime($dirfile))."</td>"); |
|
411 | + echo ("<tr><td>$dirfile</td><td class=\"right\">" . filesize($dirfile) . "</td><td>" . date("Y-m-d H:i:s", filemtime($dirfile)) . "</td>"); |
|
412 | 412 | |
413 | - if (preg_match("/\.sql$/i",$dirfile)) |
|
413 | + if (preg_match("/\.sql$/i", $dirfile)) |
|
414 | 414 | echo ("<td>SQL</td>"); |
415 | - elseif (preg_match("/\.gz$/i",$dirfile)) |
|
415 | + elseif (preg_match("/\.gz$/i", $dirfile)) |
|
416 | 416 | echo ("<td>GZip</td>"); |
417 | - elseif (preg_match("/\.csv$/i",$dirfile)) |
|
417 | + elseif (preg_match("/\.csv$/i", $dirfile)) |
|
418 | 418 | echo ("<td>CSV</td>"); |
419 | 419 | else |
420 | 420 | echo ("<td>Misc</td>"); |
421 | 421 | |
422 | - if ((preg_match("/\.gz$/i",$dirfile) && function_exists("gzopen")) || preg_match("/\.sql$/i",$dirfile) || preg_match("/\.csv$/i",$dirfile)) |
|
423 | - echo ("<td><a href=\"".$_SERVER["PHP_SELF"]."?start=1&fn=".urlencode($dirfile)."&foffset=0&totalqueries=0&delimiter=".urlencode($delimiter)."\">Start Import</a> into $db_name at $db_server</td>\n <td><a href=\"".$_SERVER["PHP_SELF"]."?delete=".urlencode($dirfile)."\">Delete file</a></td></tr>\n"); |
|
422 | + if ((preg_match("/\.gz$/i", $dirfile) && function_exists("gzopen")) || preg_match("/\.sql$/i", $dirfile) || preg_match("/\.csv$/i", $dirfile)) |
|
423 | + echo ("<td><a href=\"" . $_SERVER["PHP_SELF"] . "?start=1&fn=" . urlencode($dirfile) . "&foffset=0&totalqueries=0&delimiter=" . urlencode($delimiter) . "\">Start Import</a> into $db_name at $db_server</td>\n <td><a href=\"" . $_SERVER["PHP_SELF"] . "?delete=" . urlencode($dirfile) . "\">Delete file</a></td></tr>\n"); |
|
424 | 424 | else |
425 | 425 | echo ("<td> </td>\n <td> </td></tr>\n"); |
426 | 426 | } |
@@ -434,35 +434,35 @@ discard block |
||
434 | 434 | } |
435 | 435 | else |
436 | 436 | { echo ("<p class=\"error\">Error listing directory $upload_dir</p>\n"); |
437 | - $error=true; |
|
437 | + $error = true; |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
441 | 441 | |
442 | 442 | // Single file mode |
443 | 443 | |
444 | -if (!$error && !isset ($_REQUEST["fn"]) && $filename!="") |
|
445 | -{ echo ("<p><a href=\"".$_SERVER["PHP_SELF"]."?start=1&fn=".urlencode($filename)."&foffset=0&totalqueries=0\">Start Import</a> from $filename into $db_name at $db_server</p>\n"); |
|
444 | +if (!$error && !isset ($_REQUEST["fn"]) && $filename != "") |
|
445 | +{ echo ("<p><a href=\"" . $_SERVER["PHP_SELF"] . "?start=1&fn=" . urlencode($filename) . "&foffset=0&totalqueries=0\">Start Import</a> from $filename into $db_name at $db_server</p>\n"); |
|
446 | 446 | } |
447 | 447 | |
448 | 448 | |
449 | 449 | // File Upload Form |
450 | 450 | |
451 | -if (!$error && !isset($_REQUEST["fn"]) && $filename=="") |
|
451 | +if (!$error && !isset($_REQUEST["fn"]) && $filename == "") |
|
452 | 452 | { |
453 | 453 | |
454 | 454 | // Test permissions on working directory |
455 | 455 | |
456 | - do { $tempfilename=time().".tmp"; } while (file_exists($tempfilename)); |
|
457 | - if (!($tempfile=@fopen($tempfilename,"w"))) |
|
456 | + do { $tempfilename = time() . ".tmp"; } while (file_exists($tempfilename)); |
|
457 | + if (!($tempfile = @fopen($tempfilename, "w"))) |
|
458 | 458 | { echo ("<p>Upload form disabled. Permissions for the working directory <i>$upload_dir</i> <b>must be set writable for the webserver</b> in order "); |
459 | 459 | echo ("to upload files here. Alternatively you can upload your dump files via FTP.</p>\n"); |
460 | 460 | } |
461 | 461 | else |
462 | 462 | { fclose($tempfile); |
463 | - unlink ($tempfilename); |
|
463 | + unlink($tempfilename); |
|
464 | 464 | |
465 | - echo ("<p>You can now upload your dump file up to $upload_max_filesize bytes (".round ($upload_max_filesize/1024/1024)." Mbytes) "); |
|
465 | + echo ("<p>You can now upload your dump file up to $upload_max_filesize bytes (" . round($upload_max_filesize / 1024 / 1024) . " Mbytes) "); |
|
466 | 466 | echo ("directly from your browser to the server. Alternatively you can upload your dump files of any size via FTP.</p>\n"); |
467 | 467 | ?> |
468 | 468 | <form method="POST" action="<?php echo ($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"> |
@@ -493,45 +493,45 @@ discard block |
||
493 | 493 | |
494 | 494 | // Set current filename ($filename overrides $_REQUEST["fn"] if set) |
495 | 495 | |
496 | - if ($filename!="") |
|
497 | - $curfilename=$filename; |
|
496 | + if ($filename != "") |
|
497 | + $curfilename = $filename; |
|
498 | 498 | else if (isset($_REQUEST["fn"])) |
499 | - $curfilename=urldecode($_REQUEST["fn"]); |
|
499 | + $curfilename = urldecode($_REQUEST["fn"]); |
|
500 | 500 | else |
501 | - $curfilename=""; |
|
501 | + $curfilename = ""; |
|
502 | 502 | |
503 | 503 | // Recognize GZip filename |
504 | 504 | |
505 | - if (preg_match("/\.gz$/i",$curfilename)) |
|
506 | - $gzipmode=true; |
|
505 | + if (preg_match("/\.gz$/i", $curfilename)) |
|
506 | + $gzipmode = true; |
|
507 | 507 | else |
508 | - $gzipmode=false; |
|
508 | + $gzipmode = false; |
|
509 | 509 | |
510 | - if ((!$gzipmode && !$file=@fopen($curfilename,"r")) || ($gzipmode && !$file=@gzopen($curfilename,"r"))) |
|
511 | - { echo ("<p class=\"error\">Can't open ".$curfilename." for import</p>\n"); |
|
512 | - echo ("<p>Please, check that your dump file name contains only alphanumerical characters, and rename it accordingly, for example: $curfilename.". |
|
513 | - "<br>Or, specify \$filename in bigdump.php with the full filename. ". |
|
510 | + if ((!$gzipmode && !$file = @fopen($curfilename, "r")) || ($gzipmode && !$file = @gzopen($curfilename, "r"))) |
|
511 | + { echo ("<p class=\"error\">Can't open " . $curfilename . " for import</p>\n"); |
|
512 | + echo ("<p>Please, check that your dump file name contains only alphanumerical characters, and rename it accordingly, for example: $curfilename." . |
|
513 | + "<br>Or, specify \$filename in bigdump.php with the full filename. " . |
|
514 | 514 | "<br>Or, you have to upload the $curfilename to the server first.</p>\n"); |
515 | - $error=true; |
|
515 | + $error = true; |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | // Get the file size (can't do it fast on gzipped files, no idea how) |
519 | 519 | |
520 | - else if ((!$gzipmode && @fseek($file, 0, SEEK_END)==0) || ($gzipmode && @gzseek($file, 0)==0)) |
|
520 | + else if ((!$gzipmode && @fseek($file, 0, SEEK_END) == 0) || ($gzipmode && @gzseek($file, 0) == 0)) |
|
521 | 521 | { if (!$gzipmode) $filesize = ftell($file); |
522 | - else $filesize = gztell($file); // Always zero, ignore |
|
522 | + else $filesize = gztell($file); // Always zero, ignore |
|
523 | 523 | } |
524 | 524 | else |
525 | 525 | { echo ("<p class=\"error\">I can't seek into $curfilename</p>\n"); |
526 | - $error=true; |
|
526 | + $error = true; |
|
527 | 527 | } |
528 | 528 | } |
529 | 529 | |
530 | 530 | // Stop if csv file is used, but $csv_insert_table is not set |
531 | 531 | |
532 | -if (($csv_insert_table == "") && (preg_match("/(\.csv)$/i",$curfilename))) |
|
532 | +if (($csv_insert_table == "") && (preg_match("/(\.csv)$/i", $curfilename))) |
|
533 | 533 | { echo ("<p class=\"error\">You have to specify \$csv_insert_table when using a CSV file. </p>\n"); |
534 | - $error=true; |
|
534 | + $error = true; |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | |
@@ -539,14 +539,14 @@ discard block |
||
539 | 539 | // START IMPORT SESSION HERE |
540 | 540 | // ******************************************************************************************* |
541 | 541 | |
542 | -if (!$error && isset($_REQUEST["start"]) && isset($_REQUEST["foffset"]) && preg_match("/(\.(sql|gz|csv))$/i",$curfilename)) |
|
542 | +if (!$error && isset($_REQUEST["start"]) && isset($_REQUEST["foffset"]) && preg_match("/(\.(sql|gz|csv))$/i", $curfilename)) |
|
543 | 543 | { |
544 | 544 | |
545 | 545 | // Check start and foffset are numeric values |
546 | 546 | |
547 | 547 | if (!is_numeric($_REQUEST["start"]) || !is_numeric($_REQUEST["foffset"])) |
548 | 548 | { echo ("<p class=\"error\">UNEXPECTED: Non-numeric values for start and foffset</p>\n"); |
549 | - $error=true; |
|
549 | + $error = true; |
|
550 | 550 | } |
551 | 551 | else |
552 | 552 | { $_REQUEST["start"] = floor($_REQUEST["start"]); |
@@ -560,14 +560,14 @@ discard block |
||
560 | 560 | |
561 | 561 | // Empty CSV table if requested |
562 | 562 | |
563 | - if (!$error && $_REQUEST["start"]==1 && $csv_insert_table != "" && $csv_preempty_table) |
|
563 | + if (!$error && $_REQUEST["start"] == 1 && $csv_insert_table != "" && $csv_preempty_table) |
|
564 | 564 | { |
565 | 565 | $query = "DELETE FROM $csv_insert_table"; |
566 | 566 | if (!TESTMODE && !mysql_query(trim($query), $dbconnection)) |
567 | 567 | { echo ("<p class=\"error\">Error when deleting entries from $csv_insert_table.</p>\n"); |
568 | - echo ("<p>Query: ".trim(nl2br(htmlentities($query)))."</p>\n"); |
|
569 | - echo ("<p>MySQL: ".mysql_error()."</p>\n"); |
|
570 | - $error=true; |
|
568 | + echo ("<p>Query: " . trim(nl2br(htmlentities($query))) . "</p>\n"); |
|
569 | + echo ("<p>MySQL: " . mysql_error() . "</p>\n"); |
|
570 | + $error = true; |
|
571 | 571 | } |
572 | 572 | } |
573 | 573 | |
@@ -577,95 +577,95 @@ discard block |
||
577 | 577 | { skin_open(); |
578 | 578 | if (TESTMODE) |
579 | 579 | echo ("<p class=\"centr\">TEST MODE ENABLED</p>\n"); |
580 | - echo ("<p class=\"centr\">Processing file: <b>".$curfilename."</b></p>\n"); |
|
581 | - echo ("<p class=\"smlcentr\">Starting from line: ".$_REQUEST["start"]."</p>\n"); |
|
580 | + echo ("<p class=\"centr\">Processing file: <b>" . $curfilename . "</b></p>\n"); |
|
581 | + echo ("<p class=\"smlcentr\">Starting from line: " . $_REQUEST["start"] . "</p>\n"); |
|
582 | 582 | skin_close(); |
583 | 583 | } |
584 | 584 | |
585 | 585 | // Check $_REQUEST["foffset"] upon $filesize (can't do it on gzipped files) |
586 | 586 | |
587 | - if (!$error && !$gzipmode && $_REQUEST["foffset"]>$filesize) |
|
587 | + if (!$error && !$gzipmode && $_REQUEST["foffset"] > $filesize) |
|
588 | 588 | { echo ("<p class=\"error\">UNEXPECTED: Can't set file pointer behind the end of file</p>\n"); |
589 | - $error=true; |
|
589 | + $error = true; |
|
590 | 590 | } |
591 | 591 | |
592 | 592 | // Set file pointer to $_REQUEST["foffset"] |
593 | 593 | |
594 | - if (!$error && ((!$gzipmode && fseek($file, $_REQUEST["foffset"])!=0) || ($gzipmode && gzseek($file, $_REQUEST["foffset"])!=0))) |
|
595 | - { echo ("<p class=\"error\">UNEXPECTED: Can't set file pointer to offset: ".$_REQUEST["foffset"]."</p>\n"); |
|
596 | - $error=true; |
|
594 | + if (!$error && ((!$gzipmode && fseek($file, $_REQUEST["foffset"]) != 0) || ($gzipmode && gzseek($file, $_REQUEST["foffset"]) != 0))) |
|
595 | + { echo ("<p class=\"error\">UNEXPECTED: Can't set file pointer to offset: " . $_REQUEST["foffset"] . "</p>\n"); |
|
596 | + $error = true; |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | // Start processing queries from $file |
600 | 600 | |
601 | 601 | if (!$error) |
602 | - { $query=""; |
|
603 | - $queries=0; |
|
604 | - $totalqueries=$_REQUEST["totalqueries"]; |
|
605 | - $linenumber=$_REQUEST["start"]; |
|
606 | - $querylines=0; |
|
607 | - $inparents=false; |
|
602 | + { $query = ""; |
|
603 | + $queries = 0; |
|
604 | + $totalqueries = $_REQUEST["totalqueries"]; |
|
605 | + $linenumber = $_REQUEST["start"]; |
|
606 | + $querylines = 0; |
|
607 | + $inparents = false; |
|
608 | 608 | |
609 | 609 | // Stay processing as long as the $linespersession is not reached or the query is still incomplete |
610 | 610 | |
611 | - while ($linenumber<$_REQUEST["start"]+$linespersession || $query!="") |
|
611 | + while ($linenumber < $_REQUEST["start"] + $linespersession || $query != "") |
|
612 | 612 | { |
613 | 613 | |
614 | 614 | // Read the whole next line |
615 | 615 | |
616 | 616 | $dumpline = ""; |
617 | - while (!feof($file) && substr ($dumpline, -1) != "\n" && substr ($dumpline, -1) != "\r") |
|
617 | + while (!feof($file) && substr($dumpline, -1) != "\n" && substr($dumpline, -1) != "\r") |
|
618 | 618 | { if (!$gzipmode) |
619 | 619 | $dumpline .= fgets($file, DATA_CHUNK_LENGTH); |
620 | 620 | else |
621 | 621 | $dumpline .= gzgets($file, DATA_CHUNK_LENGTH); |
622 | 622 | } |
623 | - if ($dumpline==="") break; |
|
623 | + if ($dumpline === "") break; |
|
624 | 624 | |
625 | 625 | // Remove UTF8 Byte Order Mark at the file beginning if any |
626 | 626 | |
627 | - if ($_REQUEST["foffset"]==0) |
|
628 | - $dumpline=preg_replace('|^\xEF\xBB\xBF|','',$dumpline); |
|
627 | + if ($_REQUEST["foffset"] == 0) |
|
628 | + $dumpline = preg_replace('|^\xEF\xBB\xBF|', '', $dumpline); |
|
629 | 629 | |
630 | 630 | // Create an SQL query from CSV line |
631 | 631 | |
632 | - if (($csv_insert_table != "") && (preg_match("/(\.csv)$/i",$curfilename))) |
|
632 | + if (($csv_insert_table != "") && (preg_match("/(\.csv)$/i", $curfilename))) |
|
633 | 633 | { |
634 | 634 | if ($csv_add_slashes) |
635 | 635 | $dumpline = addslashes($dumpline); |
636 | - $dumpline = explode($csv_delimiter,$dumpline); |
|
636 | + $dumpline = explode($csv_delimiter, $dumpline); |
|
637 | 637 | if ($csv_add_quotes) |
638 | - $dumpline = "'".implode("','",$dumpline)."'"; |
|
638 | + $dumpline = "'" . implode("','", $dumpline) . "'"; |
|
639 | 639 | else |
640 | - $dumpline = implode(",",$dumpline); |
|
641 | - $dumpline = 'INSERT INTO '.$csv_insert_table.' VALUES ('.$dumpline.');'; |
|
640 | + $dumpline = implode(",", $dumpline); |
|
641 | + $dumpline = 'INSERT INTO ' . $csv_insert_table . ' VALUES (' . $dumpline . ');'; |
|
642 | 642 | } |
643 | 643 | |
644 | 644 | // Handle DOS and Mac encoded linebreaks (I don't know if it really works on Win32 or Mac Servers) |
645 | 645 | |
646 | - $dumpline=str_replace("\r\n", "\n", $dumpline); |
|
647 | - $dumpline=str_replace("\r", "\n", $dumpline); |
|
646 | + $dumpline = str_replace("\r\n", "\n", $dumpline); |
|
647 | + $dumpline = str_replace("\r", "\n", $dumpline); |
|
648 | 648 | |
649 | 649 | // DIAGNOSTIC |
650 | 650 | // echo ("<p>Line $linenumber: $dumpline</p>\n"); |
651 | 651 | |
652 | 652 | // Recognize delimiter statement |
653 | 653 | |
654 | - if (!$inparents && strpos ($dumpline, "DELIMITER ") === 0) |
|
655 | - $delimiter = str_replace ("DELIMITER ","",trim($dumpline)); |
|
654 | + if (!$inparents && strpos($dumpline, "DELIMITER ") === 0) |
|
655 | + $delimiter = str_replace("DELIMITER ", "", trim($dumpline)); |
|
656 | 656 | |
657 | 657 | // Skip comments and blank lines only if NOT in parents |
658 | 658 | |
659 | 659 | if (!$inparents) |
660 | - { $skipline=false; |
|
660 | + { $skipline = false; |
|
661 | 661 | reset($comment); |
662 | 662 | foreach ($comment as $comment_value) |
663 | 663 | { |
664 | 664 | |
665 | 665 | // DIAGNOSTIC |
666 | 666 | // echo ($comment_value); |
667 | - if (trim($dumpline)=="" || strpos (trim($dumpline), $comment_value) === 0) |
|
668 | - { $skipline=true; |
|
667 | + if (trim($dumpline) == "" || strpos(trim($dumpline), $comment_value) === 0) |
|
668 | + { $skipline = true; |
|
669 | 669 | break; |
670 | 670 | } |
671 | 671 | } |
@@ -681,13 +681,13 @@ discard block |
||
681 | 681 | |
682 | 682 | // Remove double back-slashes from the dumpline prior to count the quotes ('\\' can only be within strings) |
683 | 683 | |
684 | - $dumpline_deslashed = str_replace ("\\\\","",$dumpline); |
|
684 | + $dumpline_deslashed = str_replace("\\\\", "", $dumpline); |
|
685 | 685 | |
686 | 686 | // Count ' and \' (or " and \") in the dumpline to avoid query break within a text field ending by $delimiter |
687 | 687 | |
688 | - $parents=substr_count ($dumpline_deslashed, $string_quotes)-substr_count ($dumpline_deslashed, "\\$string_quotes"); |
|
688 | + $parents = substr_count($dumpline_deslashed, $string_quotes) - substr_count($dumpline_deslashed, "\\$string_quotes"); |
|
689 | 689 | if ($parents % 2 != 0) |
690 | - $inparents=!$inparents; |
|
690 | + $inparents = !$inparents; |
|
691 | 691 | |
692 | 692 | // Add the line to query |
693 | 693 | |
@@ -700,15 +700,15 @@ discard block |
||
700 | 700 | |
701 | 701 | // Stop if query contains more lines as defined by MAX_QUERY_LINES |
702 | 702 | |
703 | - if ($querylines>MAX_QUERY_LINES) |
|
703 | + if ($querylines > MAX_QUERY_LINES) |
|
704 | 704 | { |
705 | 705 | echo ("<p class=\"error\">Stopped at the line $linenumber. </p>"); |
706 | - echo ("<p>At this place the current query includes more than ".MAX_QUERY_LINES." dump lines. That can happen if your dump file was "); |
|
706 | + echo ("<p>At this place the current query includes more than " . MAX_QUERY_LINES . " dump lines. That can happen if your dump file was "); |
|
707 | 707 | echo ("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 "); |
708 | 708 | echo ("extended inserts or very long procedure definitions. Please read the <a href=\"http://www.ozerov.de/bigdump/usage/\">BigDump usage notes</a> "); |
709 | 709 | echo ("for more infos. Ask for our support services "); |
710 | 710 | echo ("in order to handle dump files containing extended inserts.</p>\n"); |
711 | - $error=true; |
|
711 | + $error = true; |
|
712 | 712 | break; |
713 | 713 | } |
714 | 714 | |
@@ -719,27 +719,27 @@ discard block |
||
719 | 719 | // echo ("<p>In Parents: ".($inparents?"true":"false")."</p>\n"); |
720 | 720 | // echo ("<p>Line: $dumpline</p>\n"); |
721 | 721 | |
722 | - if (preg_match('/'.preg_quote($delimiter).'$/',trim($dumpline)) && !$inparents) |
|
722 | + if (preg_match('/' . preg_quote($delimiter) . '$/', trim($dumpline)) && !$inparents) |
|
723 | 723 | { |
724 | 724 | |
725 | 725 | // Cut off delimiter of the end of the query |
726 | 726 | |
727 | - $query = substr(trim($query),0,-1*strlen($delimiter)); |
|
727 | + $query = substr(trim($query), 0, -1 * strlen($delimiter)); |
|
728 | 728 | |
729 | 729 | // DIAGNOSTIC |
730 | 730 | // echo ("<p>Query: ".trim(nl2br(htmlentities($query)))."</p>\n"); |
731 | 731 | |
732 | 732 | if (!TESTMODE && !mysql_query($query, $dbconnection)) |
733 | - { echo ("<p class=\"error\">Error at the line $linenumber: ". trim($dumpline)."</p>\n"); |
|
734 | - echo ("<p>Query: ".trim(nl2br(htmlentities($query)))."</p>\n"); |
|
735 | - echo ("<p>MySQL: ".mysql_error()."</p>\n"); |
|
736 | - $error=true; |
|
733 | + { echo ("<p class=\"error\">Error at the line $linenumber: " . trim($dumpline) . "</p>\n"); |
|
734 | + echo ("<p>Query: " . trim(nl2br(htmlentities($query))) . "</p>\n"); |
|
735 | + echo ("<p>MySQL: " . mysql_error() . "</p>\n"); |
|
736 | + $error = true; |
|
737 | 737 | break; |
738 | 738 | } |
739 | 739 | $totalqueries++; |
740 | 740 | $queries++; |
741 | - $query=""; |
|
742 | - $querylines=0; |
|
741 | + $query = ""; |
|
742 | + $querylines = 0; |
|
743 | 743 | } |
744 | 744 | $linenumber++; |
745 | 745 | } |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | $foffset = gztell($file); |
755 | 755 | if (!$foffset) |
756 | 756 | { echo ("<p class=\"error\">UNEXPECTED: Can't read the file pointer offset</p>\n"); |
757 | - $error=true; |
|
757 | + $error = true; |
|
758 | 758 | } |
759 | 759 | } |
760 | 760 | |
@@ -766,8 +766,8 @@ discard block |
||
766 | 766 | |
767 | 767 | if (!$error) |
768 | 768 | { |
769 | - $lines_this = $linenumber-$_REQUEST["start"]; |
|
770 | - $lines_done = $linenumber-1; |
|
769 | + $lines_this = $linenumber - $_REQUEST["start"]; |
|
770 | + $lines_done = $linenumber - 1; |
|
771 | 771 | $lines_togo = ' ? '; |
772 | 772 | $lines_tota = ' ? '; |
773 | 773 | |
@@ -776,35 +776,35 @@ discard block |
||
776 | 776 | $queries_togo = ' ? '; |
777 | 777 | $queries_tota = ' ? '; |
778 | 778 | |
779 | - $bytes_this = $foffset-$_REQUEST["foffset"]; |
|
779 | + $bytes_this = $foffset - $_REQUEST["foffset"]; |
|
780 | 780 | $bytes_done = $foffset; |
781 | - $kbytes_this = round($bytes_this/1024,2); |
|
782 | - $kbytes_done = round($bytes_done/1024,2); |
|
783 | - $mbytes_this = round($kbytes_this/1024,2); |
|
784 | - $mbytes_done = round($kbytes_done/1024,2); |
|
781 | + $kbytes_this = round($bytes_this / 1024, 2); |
|
782 | + $kbytes_done = round($bytes_done / 1024, 2); |
|
783 | + $mbytes_this = round($kbytes_this / 1024, 2); |
|
784 | + $mbytes_done = round($kbytes_done / 1024, 2); |
|
785 | 785 | |
786 | 786 | if (!$gzipmode) |
787 | 787 | { |
788 | - $bytes_togo = $filesize-$foffset; |
|
788 | + $bytes_togo = $filesize - $foffset; |
|
789 | 789 | $bytes_tota = $filesize; |
790 | - $kbytes_togo = round($bytes_togo/1024,2); |
|
791 | - $kbytes_tota = round($bytes_tota/1024,2); |
|
792 | - $mbytes_togo = round($kbytes_togo/1024,2); |
|
793 | - $mbytes_tota = round($kbytes_tota/1024,2); |
|
790 | + $kbytes_togo = round($bytes_togo / 1024, 2); |
|
791 | + $kbytes_tota = round($bytes_tota / 1024, 2); |
|
792 | + $mbytes_togo = round($kbytes_togo / 1024, 2); |
|
793 | + $mbytes_tota = round($kbytes_tota / 1024, 2); |
|
794 | 794 | |
795 | - $pct_this = ceil($bytes_this/$filesize*100); |
|
796 | - $pct_done = ceil($foffset/$filesize*100); |
|
795 | + $pct_this = ceil($bytes_this / $filesize * 100); |
|
796 | + $pct_done = ceil($foffset / $filesize * 100); |
|
797 | 797 | $pct_togo = 100 - $pct_done; |
798 | 798 | $pct_tota = 100; |
799 | 799 | |
800 | - if ($bytes_togo==0) |
|
800 | + if ($bytes_togo == 0) |
|
801 | 801 | { $lines_togo = '0'; |
802 | - $lines_tota = $linenumber-1; |
|
802 | + $lines_tota = $linenumber - 1; |
|
803 | 803 | $queries_togo = '0'; |
804 | 804 | $queries_tota = $totalqueries; |
805 | 805 | } |
806 | 806 | |
807 | - $pct_bar = "<div style=\"height:15px;width:$pct_done%;background-color:#000080;margin:0px;\"></div>"; |
|
807 | + $pct_bar = "<div style=\"height:15px;width:$pct_done%;background-color:#000080;margin:0px;\"></div>"; |
|
808 | 808 | } |
809 | 809 | else |
810 | 810 | { |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $pct_done = ' ? '; |
820 | 820 | $pct_togo = ' ? '; |
821 | 821 | $pct_tota = 100; |
822 | - $pct_bar = str_replace(' ',' ','<tt>[ Not available for gzipped files ]</tt>'); |
|
822 | + $pct_bar = str_replace(' ', ' ', '<tt>[ Not available for gzipped files ]</tt>'); |
|
823 | 823 | } |
824 | 824 | |
825 | 825 | echo (" |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | |
840 | 840 | // Finish message and restart the script |
841 | 841 | |
842 | - if ($linenumber<$_REQUEST["start"]+$linespersession) |
|
842 | + if ($linenumber < $_REQUEST["start"] + $linespersession) |
|
843 | 843 | { echo ("<p class=\"successcentr\">Congratulations: End of file reached, assuming OK</p>\n"); |
844 | 844 | echo ("<p class=\"successcentr\">IMPORTANT: REMOVE YOUR DUMP FILE and BIGDUMP SCRIPT FROM SERVER NOW!</p>\n"); |
845 | 845 | echo ("<p class=\"centr\">Thank you for using this tool! Please rate <a href=\"http://www.hotscripts.com/listing/bigdump/?RID=403\" target=\"_blank\">Bigdump at Hotscripts.com</a></p>\n"); |
@@ -863,19 +863,19 @@ discard block |
||
863 | 863 | |
864 | 864 | <?php |
865 | 865 | |
866 | - $error=true; // This is a semi-error telling the script is finished |
|
866 | + $error = true; // This is a semi-error telling the script is finished |
|
867 | 867 | } |
868 | 868 | else |
869 | - { if ($delaypersession!=0) |
|
869 | + { if ($delaypersession != 0) |
|
870 | 870 | echo ("<p class=\"centr\">Now I'm <b>waiting $delaypersession milliseconds</b> before starting next session...</p>\n"); |
871 | 871 | if (!$ajax) |
872 | - echo ("<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"".$_SERVER["PHP_SELF"]."?start=$linenumber&fn=".urlencode($curfilename)."&foffset=$foffset&totalqueries=$totalqueries&delimiter=".urlencode($delimiter)."\";',500+$delaypersession);</script>\n"); |
|
872 | + echo ("<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"" . $_SERVER["PHP_SELF"] . "?start=$linenumber&fn=" . urlencode($curfilename) . "&foffset=$foffset&totalqueries=$totalqueries&delimiter=" . urlencode($delimiter) . "\";',500+$delaypersession);</script>\n"); |
|
873 | 873 | |
874 | 874 | echo ("<noscript>\n"); |
875 | - echo ("<p class=\"centr\"><a href=\"".$_SERVER["PHP_SELF"]."?start=$linenumber&fn=".urlencode($curfilename)."&foffset=$foffset&totalqueries=$totalqueries&delimiter=".urlencode($delimiter)."\">Continue from the line $linenumber</a> (Enable JavaScript to do it automatically)</p>\n"); |
|
875 | + echo ("<p class=\"centr\"><a href=\"" . $_SERVER["PHP_SELF"] . "?start=$linenumber&fn=" . urlencode($curfilename) . "&foffset=$foffset&totalqueries=$totalqueries&delimiter=" . urlencode($delimiter) . "\">Continue from the line $linenumber</a> (Enable JavaScript to do it automatically)</p>\n"); |
|
876 | 876 | echo ("</noscript>\n"); |
877 | 877 | |
878 | - echo ("<p class=\"centr\">Press <b><a href=\"".$_SERVER["PHP_SELF"]."\">STOP</a></b> to abort the import <b>OR WAIT!</b></p>\n"); |
|
878 | + echo ("<p class=\"centr\">Press <b><a href=\"" . $_SERVER["PHP_SELF"] . "\">STOP</a></b> to abort the import <b>OR WAIT!</b></p>\n"); |
|
879 | 879 | } |
880 | 880 | } |
881 | 881 | else |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | } |
887 | 887 | |
888 | 888 | if ($error) |
889 | - echo ("<p class=\"centr\"><a href=\"".$_SERVER["PHP_SELF"]."\">Start from the beginning</a> (DROP the old tables before restarting)</p>\n"); |
|
889 | + echo ("<p class=\"centr\"><a href=\"" . $_SERVER["PHP_SELF"] . "\">Start from the beginning</a> (DROP the old tables before restarting)</p>\n"); |
|
890 | 890 | |
891 | 891 | if ($dbconnection) mysql_close($dbconnection); |
892 | 892 | if ($file && !$gzipmode) fclose($file); |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | $bytes_this, $bytes_done, $bytes_togo, $bytes_tota, |
948 | 948 | $kbytes_this, $kbytes_done, $kbytes_togo, $kbytes_tota, |
949 | 949 | $mbytes_this, $mbytes_done, $mbytes_togo, $mbytes_tota, |
950 | - $pct_this, $pct_done, $pct_togo, $pct_tota,$pct_bar; |
|
950 | + $pct_this, $pct_done, $pct_togo, $pct_tota, $pct_bar; |
|
951 | 951 | |
952 | 952 | header('Content-Type: application/xml'); |
953 | 953 | header('Cache-Control: no-cache'); |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | echo "<elem22>$pct_done</elem22>"; |
995 | 995 | echo "<elem23>$pct_togo</elem23>"; |
996 | 996 | echo "<elem24>$pct_tota</elem24>"; |
997 | - echo "<elem_bar>".htmlentities($pct_bar)."</elem_bar>"; |
|
997 | + echo "<elem_bar>" . htmlentities($pct_bar) . "</elem_bar>"; |
|
998 | 998 | |
999 | 999 | echo "</root>"; |
1000 | 1000 | } |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | // First Ajax request from initial page |
1098 | 1098 | |
1099 | 1099 | var http_request = false; |
1100 | - var url_request = get_url(<?php echo ($linenumber.',"'.urlencode($curfilename).'",'.$foffset.','.$totalqueries.',"'.urlencode($delimiter).'"') ;?>); |
|
1100 | + var url_request = get_url(<?php echo ($linenumber . ',"' . urlencode($curfilename) . '",' . $foffset . ',' . $totalqueries . ',"' . urlencode($delimiter) . '"'); ?>); |
|
1101 | 1101 | window.setTimeout("makeRequest(url_request)",500+<?php echo $delaypersession; ?>); |
1102 | 1102 | </script> |
1103 | 1103 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | ?> |
36 | 36 | <table cellspacing="0"> |
37 | 37 | <tr><th><?php echo lang('Server'); ?><td><input type="hidden" name="driver" value="server"><select name="server"><?php echo optionlist($this->servers, SERVER); ?></select> |
38 | -<tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>"> |
|
38 | +<tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>"> |
|
39 | 39 | <tr><th><?php echo lang('Password'); ?><td><input type="password" name="password"> |
40 | 40 | </table> |
41 | 41 | <p><input type="submit" value="<?php echo lang('Login'); ?>"> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | -define("_MD_ADMINER_TITLE","Database MySQL Tools & Management"); |
|
3 | -define("_MD_ADMINER_DBMANAG","Manage database"); |
|
4 | -define("_MD_ADMINER_DBEDIT","Edit database"); |
|
5 | -define("_MD_ADMINER_DBDUMP","Restore database"); |
|
6 | -define("_MD_ADMINER_WEB","Adminer.org"); |
|
7 | -define("_MD_ADMINER_DOC","Documentation"); |
|
8 | -define("_MD_ADMINER_DOCDSC","Architecture of Adminer"); |
|
9 | -define("_MD_ADMINER_DOCVID","Usage"); |
|
10 | -define("_MD_ADMINER_DOCVIDDSC","See a video on the use of the module"); |
|
2 | +define("_MD_ADMINER_TITLE", "Database MySQL Tools & Management"); |
|
3 | +define("_MD_ADMINER_DBMANAG", "Manage database"); |
|
4 | +define("_MD_ADMINER_DBEDIT", "Edit database"); |
|
5 | +define("_MD_ADMINER_DBDUMP", "Restore database"); |
|
6 | +define("_MD_ADMINER_WEB", "Adminer.org"); |
|
7 | +define("_MD_ADMINER_DOC", "Documentation"); |
|
8 | +define("_MD_ADMINER_DOCDSC", "Architecture of Adminer"); |
|
9 | +define("_MD_ADMINER_DOCVID", "Usage"); |
|
10 | +define("_MD_ADMINER_DOCVIDDSC", "See a video on the use of the module"); |
|
11 | 11 | ?> |
12 | 12 | \ No newline at end of file |
@@ -2,9 +2,9 @@ |
||
2 | 2 | // Module Info |
3 | 3 | |
4 | 4 | // The name of this module |
5 | -define("_MI_ADMINER_NAME","MySQL Adminer"); |
|
5 | +define("_MI_ADMINER_NAME", "MySQL Adminer"); |
|
6 | 6 | |
7 | 7 | // A brief description of this module |
8 | -define("_MI_ADMINER_DESC","Database Management module for Xoops"); |
|
8 | +define("_MI_ADMINER_DESC", "Database Management module for Xoops"); |
|
9 | 9 | |
10 | 10 | ?> |
11 | 11 | \ No newline at end of file |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | -define("_MD_ADMINER_TITLE","Outils de base de données MySQL et sa gestion"); |
|
3 | -define("_MD_ADMINER_DBMANAG","Gérer les bases de données"); |
|
4 | -define("_MD_ADMINER_DBEDIT","Editer la base de données"); |
|
5 | -define("_MD_ADMINER_DBDUMP","Restaurer une sauvegarde"); |
|
6 | -define("_MD_ADMINER_WEB","Adminer.org"); |
|
7 | -define("_MD_ADMINER_DOC","Documentation"); |
|
8 | -define("_MD_ADMINER_DOCDSC","Architecture d'Adminer"); |
|
9 | -define("_MD_ADMINER_DOCVID","Utilisation"); |
|
10 | -define("_MD_ADMINER_DOCVIDDSC","Voir un tutoriel vidéo sur l'utilisation du module"); |
|
2 | +define("_MD_ADMINER_TITLE", "Outils de base de données MySQL et sa gestion"); |
|
3 | +define("_MD_ADMINER_DBMANAG", "Gérer les bases de données"); |
|
4 | +define("_MD_ADMINER_DBEDIT", "Editer la base de données"); |
|
5 | +define("_MD_ADMINER_DBDUMP", "Restaurer une sauvegarde"); |
|
6 | +define("_MD_ADMINER_WEB", "Adminer.org"); |
|
7 | +define("_MD_ADMINER_DOC", "Documentation"); |
|
8 | +define("_MD_ADMINER_DOCDSC", "Architecture d'Adminer"); |
|
9 | +define("_MD_ADMINER_DOCVID", "Utilisation"); |
|
10 | +define("_MD_ADMINER_DOCVIDDSC", "Voir un tutoriel vidéo sur l'utilisation du module"); |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @translation Communauté Francophone des Utilisateurs de Xoops |
@@ -2,10 +2,10 @@ |
||
2 | 2 | // Module Info |
3 | 3 | |
4 | 4 | // The name of this module |
5 | -define("_MI_ADMINER_NAME","MySQL Adminer"); |
|
5 | +define("_MI_ADMINER_NAME", "MySQL Adminer"); |
|
6 | 6 | |
7 | 7 | // A brief description of this module |
8 | -define("_MI_ADMINER_DESC","Outils de gestion de bases de données pour Xoops"); |
|
8 | +define("_MI_ADMINER_DESC", "Outils de gestion de bases de données pour Xoops"); |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * @translation Communauté Francophone des Utilisateurs de Xoops |