Completed
Branch develop (b5f2d2)
by
unknown
20:52
created
htdocs/mrp/mo_agenda.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 $langs->loadLangs(array("mrp", "other"));
39 39
 
40 40
 // Get parameters
41
-$id 		= GETPOST('id', 'int');
41
+$id = GETPOST('id', 'int');
42 42
 $ref        = GETPOST('ref', 'alpha');
43
-$action 	= GETPOST('action', 'aZ09');
43
+$action = GETPOST('action', 'aZ09');
44 44
 $cancel     = GETPOST('cancel', 'aZ09');
45 45
 $backtopage = GETPOST('backtopage', 'alpha');
46 46
 
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 $search_rowid = GETPOST('search_rowid');
56 56
 $search_agenda_label = GETPOST('search_agenda_label');
57 57
 
58
-$limit 		= GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
58
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
59 59
 $sortfield	= GETPOST('sortfield', 'aZ09comma');
60 60
 $sortorder	= GETPOST('sortorder', 'aZ09comma');
61
-$page 		= GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
61
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
62 62
 if (empty($page) || $page == -1) {
63 63
 	$page = 0;
64 64
 }     // If $page is not defined, or '' or -1
Please login to merge, or discard this patch.
htdocs/bookmarks/bookmarks.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
 	$langs->load("bookmarks");
38 38
 
39
-	$authorized_var=array('limit','optioncss','contextpage');
39
+	$authorized_var = array('limit', 'optioncss', 'contextpage');
40 40
 	$url = $_SERVER["PHP_SELF"];
41 41
 	$url_param = array();
42 42
 	if (!empty($_SERVER["QUERY_STRING"])) {
Please login to merge, or discard this patch.
htdocs/comm/card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -916,7 +916,7 @@
 block discarded – undo
916 916
 	 * Latest orders
917 917
 	 */
918 918
 	if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
919
-		$param ="";
919
+		$param = "";
920 920
 
921 921
 		$sql = "SELECT s.nom, s.rowid";
922 922
 		$sql .= ", c.rowid as cid, c.entity, c.total_ht";
Please login to merge, or discard this patch.
dev/examples/code/create_order.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 $sapi_type = php_sapi_name();
27 27
 $script_file = basename(__FILE__);
28
-$path=dirname(__FILE__).'/';
28
+$path = dirname(__FILE__).'/';
29 29
 
30 30
 // Test if batch mode
31 31
 if (substr($sapi_type, 0, 3) == 'cgi') {
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Global variables
37
-$version='1.11';
38
-$error=0;
37
+$version = '1.11';
38
+$error = 0;
39 39
 
40 40
 
41 41
 // -------------------- START OF YOUR CODE HERE --------------------
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
45 45
 
46 46
 //$langs->setDefaultLang('en_US'); 	// To change default language of $langs
47
-$langs->load("main");				// To load language file for default language
47
+$langs->load("main"); // To load language file for default language
48 48
 @set_time_limit(0);
49 49
 
50 50
 // Load user and its permissions
51
-$result=$user->fetch('', 'admin');	// Load user for login 'admin'. Comment line to run as anonymous user.
52
-if (! $result > 0) {
51
+$result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
52
+if (!$result > 0) {
53 53
 	dol_print_error('', $user->error);
54 54
 	exit;
55 55
 }
@@ -68,24 +68,24 @@  discard block
 block discarded – undo
68 68
 $com = new Commande($db);
69 69
 
70 70
 $com->ref            = 'ABCDE';
71
-$com->socid          = 4;	// Put id of third party (rowid in llx_societe table)
71
+$com->socid          = 4; // Put id of third party (rowid in llx_societe table)
72 72
 $com->date           = dol_now();
73 73
 $com->note_public    = 'A public comment';
74 74
 $com->note_private   = 'A private comment';
75 75
 $com->source         = 1;
76 76
 $com->remise_percent = 0;
77 77
 
78
-$orderline1=new OrderLine($db);
79
-$orderline1->tva_tx=10.0;
80
-$orderline1->remise_percent=0;
81
-$orderline1->qty=1;
82
-$com->lines[]=$orderline1;
78
+$orderline1 = new OrderLine($db);
79
+$orderline1->tva_tx = 10.0;
80
+$orderline1->remise_percent = 0;
81
+$orderline1->qty = 1;
82
+$com->lines[] = $orderline1;
83 83
 
84 84
 // Create order
85
-$idobject=$com->create($user);
85
+$idobject = $com->create($user);
86 86
 if ($idobject > 0) {
87 87
 	// Change status to validated
88
-	$result=$com->valid($user);
88
+	$result = $com->valid($user);
89 89
 	if ($result > 0) {
90 90
 		print "OK Object created with id ".$idobject."\n";
91 91
 	} else {
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 // -------------------- END OF YOUR CODE --------------------
102 102
 
103
-if (! $error) {
103
+if (!$error) {
104 104
 	$db->commit();
105 105
 	print '--- end ok'."\n";
106 106
 } else {
Please login to merge, or discard this patch.
dev/examples/code/create_invoice.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 $sapi_type = php_sapi_name();
27 27
 $script_file = basename(__FILE__);
28
-$path=dirname(__FILE__).'/';
28
+$path = dirname(__FILE__).'/';
29 29
 
30 30
 // Test if batch mode
31 31
 if (substr($sapi_type, 0, 3) == 'cgi') {
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Global variables
37
-$version='1.7';
38
-$error=0;
37
+$version = '1.7';
38
+$error = 0;
39 39
 
40 40
 
41 41
 // -------------------- START OF YOUR CODE HERE --------------------
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
45 45
 
46 46
 //$langs->setDefaultLang('en_US'); 	// To change default language of $langs
47
-$langs->load("main");				// To load language file for default language
47
+$langs->load("main"); // To load language file for default language
48 48
 @set_time_limit(0);
49 49
 
50 50
 // Load user and its permissions
51
-$result=$user->fetch('', 'admin');	// Load user for login 'admin'. Comment line to run as anonymous user.
52
-if (! $result > 0) {
51
+$result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
52
+if (!$result > 0) {
53 53
 	dol_print_error('', $user->error);
54 54
 	exit;
55 55
 }
@@ -68,26 +68,26 @@  discard block
 block discarded – undo
68 68
 //$obj->initAsSpecimen();
69 69
 
70 70
 $obj->ref            = 'ABCDE';
71
-$obj->socid          = 4;	// Put id of third party (rowid in llx_societe table)
71
+$obj->socid          = 4; // Put id of third party (rowid in llx_societe table)
72 72
 $obj->date           = dol_now();
73 73
 $obj->note_public    = 'A public comment';
74 74
 $obj->note_private   = 'A private comment';
75 75
 $obj->cond_reglement_id = 1;
76 76
 
77
-$line1=new FactureLigne($db);
78
-$line1->tva_tx=10.0;
79
-$line1->remise_percent=0;
80
-$line1->qty=1;
81
-$line1->total_ht=100;
82
-$line1->total_tva=10;
83
-$line1->total_ttc=110;
84
-$obj->lines[]=$line1;
77
+$line1 = new FactureLigne($db);
78
+$line1->tva_tx = 10.0;
79
+$line1->remise_percent = 0;
80
+$line1->qty = 1;
81
+$line1->total_ht = 100;
82
+$line1->total_tva = 10;
83
+$line1->total_ttc = 110;
84
+$obj->lines[] = $line1;
85 85
 
86 86
 // Create invoice
87
-$idobject=$obj->create($user);
87
+$idobject = $obj->create($user);
88 88
 if ($idobject > 0) {
89 89
 	// Change status to validated
90
-	$result=$obj->validate($user);
90
+	$result = $obj->validate($user);
91 91
 	if ($result > 0) {
92 92
 		print "OK Object created with id ".$idobject."\n";
93 93
 	} else {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 // -------------------- END OF YOUR CODE --------------------
104 104
 
105
-if (! $error) {
105
+if (!$error) {
106 106
 	$db->commit();
107 107
 	print '--- end ok'."\n";
108 108
 } else {
Please login to merge, or discard this patch.
dev/examples/code/get_contracts.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 $sapi_type = php_sapi_name();
27 27
 $script_file = basename(__FILE__);
28
-$path=dirname(__FILE__).'/';
28
+$path = dirname(__FILE__).'/';
29 29
 
30 30
 // Test if batch mode
31 31
 if (substr($sapi_type, 0, 3) == 'cgi') {
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Global variables
37
-$version='1.7';
38
-$error=0;
37
+$version = '1.7';
38
+$error = 0;
39 39
 
40 40
 
41 41
 // -------------------- START OF YOUR CODE HERE --------------------
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
45 45
 
46 46
 //$langs->setDefaultLang('en_US'); 	// To change default language of $langs
47
-$langs->load("main");				// To load language file for default language
47
+$langs->load("main"); // To load language file for default language
48 48
 @set_time_limit(0);
49 49
 
50 50
 // Load user and its permissions
51
-$result=$user->fetch('', 'admin');	// Load user for login 'admin'. Comment line to run as anonymous user.
52
-if (! $result > 0) {
51
+$result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
52
+if (!$result > 0) {
53 53
 	dol_print_error('', $user->error);
54 54
 	exit;
55 55
 }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 
59 59
 print "***** ".$script_file." (".$version.") *****\n";
60
-if (! isset($argv[1])) {	// Check parameters
60
+if (!isset($argv[1])) {	// Check parameters
61 61
 	print "Usage: ".$script_file." id_thirdparty ...\n";
62 62
 	exit;
63 63
 }
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 
73 73
 // Create contract object
74 74
 $obj = new Contrat($db);
75
-$obj->socid=$argv[1];
75
+$obj->socid = $argv[1];
76 76
 
77
-$listofcontractsforcompany=$obj->getListOfContracts('all');
77
+$listofcontractsforcompany = $obj->getListOfContracts('all');
78 78
 
79 79
 print $listofcontractsforcompany;
80 80
 
Please login to merge, or discard this patch.
dev/examples/code/create_user.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 $sapi_type = php_sapi_name();
27 27
 $script_file = basename(__FILE__);
28
-$path=dirname(__FILE__).'/';
28
+$path = dirname(__FILE__).'/';
29 29
 
30 30
 // Test if batch mode
31 31
 if (substr($sapi_type, 0, 3) == 'cgi') {
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Global variables
37
-$version='1.7';
38
-$error=0;
37
+$version = '1.7';
38
+$error = 0;
39 39
 
40 40
 
41 41
 // -------------------- START OF YOUR CODE HERE --------------------
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
45 45
 
46 46
 //$langs->setDefaultLang('en_US'); 	// To change default language of $langs
47
-$langs->load("main");				// To load language file for default language
47
+$langs->load("main"); // To load language file for default language
48 48
 @set_time_limit(0);
49 49
 
50 50
 // Load user and its permissions
51
-$result=$user->fetch('', 'admin');	// Load user for login 'admin'. Comment line to run as anonymous user.
52
-if (! $result > 0) {
51
+$result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
52
+if (!$result > 0) {
53 53
 	dol_print_error('', $user->error);
54 54
 	exit;
55 55
 }
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 $obj->nom   = 'ABCDEF';
72 72
 
73 73
 // Create user
74
-$idobject=$obj->create($user);
74
+$idobject = $obj->create($user);
75 75
 if ($idobject > 0) {
76 76
 	// Change status to validated
77
-	$result=$obj->setStatut(1);
77
+	$result = $obj->setStatut(1);
78 78
 	if ($result > 0) {
79 79
 		print "OK Object created with id ".$idobject."\n";
80 80
 	} else {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 // -------------------- END OF YOUR CODE --------------------
93 93
 
94
-if (! $error) {
94
+if (!$error) {
95 95
 	$db->commit();
96 96
 	print '--- end ok'."\n";
97 97
 } else {
Please login to merge, or discard this patch.
dev/examples/code/create_product.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 $sapi_type = php_sapi_name();
27 27
 $script_file = basename(__FILE__);
28
-$path=dirname(__FILE__).'/';
28
+$path = dirname(__FILE__).'/';
29 29
 
30 30
 // Test if batch mode
31 31
 if (substr($sapi_type, 0, 3) == 'cgi') {
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Global variables
37
-$version='1.10';
38
-$error=0;
37
+$version = '1.10';
38
+$error = 0;
39 39
 
40 40
 
41 41
 // -------------------- START OF YOUR CODE HERE --------------------
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
45 45
 
46 46
 //$langs->setDefaultLang('en_US'); 	// To change default language of $langs
47
-$langs->load("main");				// To load language file for default language
47
+$langs->load("main"); // To load language file for default language
48 48
 @set_time_limit(0);
49 49
 
50 50
 // Load user and its permissions
51
-$result=$user->fetch('', 'admin');	// Load user for login 'admin'. Comment line to run as anonymous user.
52
-if (! $result > 0) {
51
+$result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
52
+if (!$result > 0) {
53 53
 	dol_print_error('', $user->error);
54 54
 	exit;
55 55
 }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
66 66
 
67 67
 // Create instance of object
68
-$myproduct=new Product($db);
68
+$myproduct = new Product($db);
69 69
 
70 70
 // Definition of product instance properties
71 71
 $myproduct->ref                = '1234';
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 // -------------------- END OF YOUR CODE --------------------
93 93
 
94
-if (! $error) {
94
+if (!$error) {
95 95
 	$db->commit();
96 96
 	print '--- end ok'."\n";
97 97
 } else {
Please login to merge, or discard this patch.
dev/tools/dolibarr-postgres2mysql.php 2 patches
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 
29 29
 $sapi_type = php_sapi_name();
30 30
 $script_file = basename(__FILE__);
31
-$path = dirname(__FILE__) . '/';
31
+$path = dirname(__FILE__).'/';
32 32
 
33 33
 // Test si mode batch
34 34
 $sapi_type = php_sapi_name();
35 35
 if (substr($sapi_type, 0, 3) == 'cgi') {
36
-	echo "Error: You are using PHP for CGI. To execute " . $script_file . " from command line, you must use PHP for CLI mode.\n";
36
+	echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
37 37
 	exit();
38 38
 }
39 39
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 // this is the default, it can be overridden here, or specified as the third parameter on the command line
45 45
 $config['engine'] = "InnoDB";
46 46
 
47
-if (! ($argv[1] && $argv[2])) {
47
+if (!($argv[1] && $argv[2])) {
48 48
 	echo "Usage: php pg2mysql_cli.php <inputfilename> <outputfilename> [engine]\n";
49 49
 	exit();
50 50
 } else {
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
 	if ($s < pow(2, 14)) {
103 103
 		return "{$s}B";
104 104
 	} elseif ($s < pow(2, 20)) {
105
-		return sprintf("%.1f", round($s / 1024, 1)) . "K";
105
+		return sprintf("%.1f", round($s / 1024, 1))."K";
106 106
 	} elseif ($s < pow(2, 30)) {
107
-		return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M";
107
+		return sprintf("%.1f", round($s / 1024 / 1024, 1))."M";
108 108
 	} else {
109
-		return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G";
109
+		return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1))."G";
110 110
 	}
111 111
 }
112 112
 
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
 	}
139 139
 
140 140
 	$fs = filesize($infilename);
141
-	echo "Filesize: " . formatsize($fs) . "\n";
141
+	echo "Filesize: ".formatsize($fs)."\n";
142 142
 
143 143
 	while ($instr = fgets($infp)) {
144
-		$linenum ++;
144
+		$linenum++;
145 145
 		$memusage = round(memory_get_usage(true) / 1024 / 1024);
146 146
 		$len = strlen($instr);
147 147
 		$pgsqlchunk[] = $instr;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		}
164 164
 
165 165
 		if (strlen($instr) > 3 && ($instr[$len - 3] == ")" && $instr[$len - 2] == ";" && $instr[$len - 1] == "\n") && $inquotes == false) {
166
-			$chunkcount ++;
166
+			$chunkcount++;
167 167
 
168 168
 			if ($linenum % 10000 == 0) {
169 169
 				$currentpos = ftell($infp);
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 
216 216
 	fputs($outfp, "\n");
217 217
 
218
-	fputs($outfp, '/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;' . "\n");
219
-	fputs($outfp, '/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;' . "\n");
220
-	fputs($outfp, '/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;' . "\n");
221
-	fputs($outfp, '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;' . "\n");
222
-	fputs($outfp, '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;' . "\n");
223
-	fputs($outfp, '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;' . "\n");
224
-	fputs($outfp, '/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;' . "\n");
218
+	fputs($outfp, '/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;'."\n");
219
+	fputs($outfp, '/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;'."\n");
220
+	fputs($outfp, '/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;'."\n");
221
+	fputs($outfp, '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;'."\n");
222
+	fputs($outfp, '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;'."\n");
223
+	fputs($outfp, '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;'."\n");
224
+	fputs($outfp, '/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;'."\n");
225 225
 
226 226
 	printf("Completed! %9d lines   %9d sql chunks\n\n", $linenum, $chunkcount);
227 227
 
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
 	}
251 251
 
252 252
 	if ($header) {
253
-		$output = "-- Converted with " . PRODUCT . "-" . VERSION . "\n";
254
-		$output .= "-- Converted on " . date("r") . "\n";
253
+		$output = "-- Converted with ".PRODUCT."-".VERSION."\n";
254
+		$output .= "-- Converted on ".date("r")."\n";
255 255
 		$output .= "\n";
256 256
 
257 257
 		$output .= "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n";
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
 
283 283
 		$reg = array();
284 284
 		if (preg_match('/CREATE SEQUENCE (?:public\.)(.*)_(id|rowid|id_comment)_seq/', $line, $reg)) {
285
-			$outputatend .= '-- Make field ' . $reg[2] . ' auto_increment for table ' . $reg[1] . "\n";
286
-			$outputatend .= 'ALTER TABLE ' . $reg[1] . ' CHANGE COLUMN ' . $reg[2] . ' ' . $reg[2] . ' INTEGER NOT NULL AUTO_INCREMENT;' . "\n\n";
285
+			$outputatend .= '-- Make field '.$reg[2].' auto_increment for table '.$reg[1]."\n";
286
+			$outputatend .= 'ALTER TABLE '.$reg[1].' CHANGE COLUMN '.$reg[2].' '.$reg[2].' INTEGER NOT NULL AUTO_INCREMENT;'."\n\n";
287 287
 			// var_dump($outputatend);
288 288
 		}
289 289
 
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
 
300 300
 			$reg2 = array();
301 301
 			if (preg_match('/CREATE TABLE ([^\s]+)/', $line, $reg2)) {
302
-				$output .= 'DROP TABLE IF EXISTS `' . $reg2[1] . '`;' . "\n";
302
+				$output .= 'DROP TABLE IF EXISTS `'.$reg2[1].'`;'."\n";
303 303
 			}
304 304
 			$output .= $line;
305
-			$linenumber ++;
305
+			$linenumber++;
306 306
 			continue;
307 307
 		}
308 308
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 			$output .= $tbl_extra;
314 314
 			$output .= $line;
315 315
 
316
-			$linenumber ++;
316
+			$linenumber++;
317 317
 			$tbl_extra = "";
318 318
 			continue;
319 319
 		}
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				$arrayofprimaryalreadyintabledef[$in_create_table] = $in_create_table;
380 380
 			}
381 381
 
382
-			$specialfields = array("repeat","status","type","call");
382
+			$specialfields = array("repeat", "status", "type", "call");
383 383
 
384 384
 			$field = getfieldname($line);
385 385
 			if (in_array($field, $specialfields)) {
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 				$lastchr = substr($output, - 2, 1);
399 399
 				// echo "lastchr=$lastchr";
400 400
 				if ($lastchr == ",") {
401
-					$output = substr($output, 0, - 2) . "\n";
401
+					$output = substr($output, 0, - 2)."\n";
402 402
 				}
403 403
 			}
404 404
 
@@ -423,8 +423,8 @@  discard block
 block discarded – undo
423 423
 				$after = str_replace(" (E'", " ('", $after);
424 424
 				$after = str_replace(", E'", ", '", $after);
425 425
 
426
-				$output .= $before . " VALUES " . $after;
427
-				$linenumber ++;
426
+				$output .= $before." VALUES ".$after;
427
+				$linenumber++;
428 428
 				continue;
429 429
 			} else {
430 430
 				// this insert spans multiple lines, so keep dumping the lines until we reach a line
@@ -451,9 +451,9 @@  discard block
 block discarded – undo
451 451
 					$inquotes = false;
452 452
 				}
453 453
 
454
-				$output .= $before . " VALUES " . $after;
454
+				$output .= $before." VALUES ".$after;
455 455
 				do {
456
-					$linenumber ++;
456
+					$linenumber++;
457 457
 
458 458
 					// in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string')
459 459
 					// ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 			$line = str_replace("public.", "", $line);
487 487
 			$pkey = $line;
488 488
 
489
-			$linenumber ++;
489
+			$linenumber++;
490 490
 			if (!empty($lines[$linenumber])) {
491 491
 				$line = $lines[$linenumber];
492 492
 			} else {
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
 						$output .= str_replace("\n", "", $pkey);
502 502
 						// the postgres and mysql syntax for this is (at least, in the example im looking at)
503 503
 						// identical, so we can just add it as is.
504
-						$output .= $line . "\n";
504
+						$output .= $line."\n";
505 505
 					} else {
506
-						$output .= '-- ' . str_replace("\n", "", $pkey);
507
-						$output .= '-- ' . $line . "\n";
506
+						$output .= '-- '.str_replace("\n", "", $pkey);
507
+						$output .= '-- '.$line."\n";
508 508
 					}
509 509
 				} else {
510
-					$output .= '-- ' . str_replace("\n", "", $pkey);
511
-					$output .= '-- ' . $line . "\n";
510
+					$output .= '-- '.str_replace("\n", "", $pkey);
511
+					$output .= '-- '.$line."\n";
512 512
 				}
513 513
 			}
514 514
 		}
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 				$tablename = str_replace('public.', '', $matches[2]);
523 523
 				$columns = $matches[3];
524 524
 				if ($tablename && $columns) {
525
-					$output .= "ALTER TABLE `" . $tablename . "` ADD INDEX " . $indexname . "( {$columns} ) ;\n";
525
+					$output .= "ALTER TABLE `".$tablename."` ADD INDEX ".$indexname."( {$columns} ) ;\n";
526 526
 				}
527 527
 			}
528 528
 		}
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 				$tablename = str_replace('public.', '', $matches[2]);
535 535
 				$columns = str_replace('"', '', $matches[3]);
536 536
 				if ($tablename && $columns) {
537
-					$output .= "ALTER TABLE `" . $tablename . "` ADD UNIQUE INDEX " . $indexname . " ( {$columns} ) ;\n";
537
+					$output .= "ALTER TABLE `".$tablename."` ADD UNIQUE INDEX ".$indexname." ( {$columns} ) ;\n";
538 538
 				}
539 539
 			}
540 540
 		}
@@ -565,23 +565,23 @@  discard block
 block discarded – undo
565 565
 			if ($line == "\\.\n") {
566 566
 				$in_insert = false;
567 567
 				if ($values) {
568
-					$output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n\n";
568
+					$output .= "INSERT INTO $heads VALUES\n".implode(",\n", $values).";\n\n";
569 569
 				}
570 570
 			} else {
571 571
 				$vals = explode('	', $line);
572 572
 				foreach ($vals as $i => $val) {
573
-					$vals[$i] = ($val == '\\N') ? 'NULL' : "'" . str_replace("'", "\\'", trim($val)) . "'";
573
+					$vals[$i] = ($val == '\\N') ? 'NULL' : "'".str_replace("'", "\\'", trim($val))."'";
574 574
 				}
575
-				$values[] = '(' . implode(',', $vals) . ')';
575
+				$values[] = '('.implode(',', $vals).')';
576 576
 				if (count($values) >= 1000) {
577
-					$output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n";
577
+					$output .= "INSERT INTO $heads VALUES\n".implode(",\n", $values).";\n";
578 578
 					$values = array();
579 579
 				}
580 580
 			}
581 581
 		}
582 582
 
583
-		$linenumber ++;
583
+		$linenumber++;
584 584
 	}
585 585
 
586
-	return array('output' => $output,'outputatend' => $outputatend);
586
+	return array('output' => $output, 'outputatend' => $outputatend);
587 587
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  - If you're having problems creating your postgres dump, make sure you use "--format p --inserts"
62 62
  - Default output engine if not specified is InnoDB
63 63
 
64
-XHTML;
64
+xhtml;
65 65
 }
66 66
 
67 67
 /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 function formatsize($s)
101 101
 {
102 102
 	if ($s < pow(2, 14)) {
103
-		return "{$s}B";
103
+		return "{$s}b";
104 104
 	} elseif ($s < pow(2, 20)) {
105 105
 		return sprintf("%.1f", round($s / 1024, 1)) . "K";
106 106
 	} elseif ($s < pow(2, 30)) {
Please login to merge, or discard this patch.