Completed
Push — v3.0 ( 23635d...e28df5 )
by Samir
23s
created
web_interface/astpp/system/database/drivers/oci8/oci8_result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,10 +112,10 @@
 block discarded – undo
112 112
 		$retval = array();
113 113
 		for ($c = 1, $fieldCount = $this->num_fields(); $c <= $fieldCount; $c++)
114 114
 		{
115
-			$F			= new stdClass();
115
+			$F = new stdClass();
116 116
 			$F->name		= oci_field_name($this->stmt_id, $c);
117 117
 			$F->type		= oci_field_type($this->stmt_id, $c);
118
-			$F->max_length		= oci_field_size($this->stmt_id, $c);
118
+			$F->max_length = oci_field_size($this->stmt_id, $c);
119 119
 
120 120
 			$retval[] = $F;
121 121
 		}
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/mysqli/mysqli_result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,9 +94,9 @@
 block discarded – undo
94 94
 			$F				= new stdClass();
95 95
 			$F->name		= $field->Field;
96 96
 			$F->type		= $type;
97
-			$F->default		= $field->Default;
98
-			$F->max_length	= $length;
99
-			$F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 );
97
+			$F->default = $field->Default;
98
+			$F->max_length = $length;
99
+			$F->primary_key = ($field->Key == 'PRI' ? 1 : 0);
100 100
 
101 101
 			$retval[] = $F;
102 102
 		}
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/mysqli/mysqli_driver.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 			return 0;
379 379
 		}
380 380
 
381
-		$query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));
381
+		$query = $this->query($this->_count_string.$this->_protect_identifiers('numrows')." FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE));
382 382
 
383 383
 		if ($query->num_rows() == 0)
384 384
 		{
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
 		$row = $query->row();
389 389
 		$this->_reset_select();
390
-		return (int) $row->numrows;
390
+		return (int)$row->numrows;
391 391
 	}
392 392
 
393 393
 	// --------------------------------------------------------------------
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 		{
494 494
 			if (strpos($item, '.'.$id) !== FALSE)
495 495
 			{
496
-				$str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item);
496
+				$str = $this->_escape_char.str_replace('.', $this->_escape_char.'.', $item);
497 497
 
498 498
 				// remove duplicates if the user already included the escape
499 499
 				return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str);
@@ -614,11 +614,11 @@  discard block
 block discarded – undo
614 614
 
615 615
 		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
616 616
 
617
-		$orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):'';
617
+		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
618 618
 
619 619
 		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
620 620
 
621
-		$sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : '';
621
+		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
622 622
 
623 623
 		$sql .= $orderby.$limit;
624 624
 
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 	function _update_batch($table, $values, $index, $where = NULL)
642 642
 	{
643 643
 		$ids = array();
644
-		$where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : '';
644
+		$where = ($where != '' AND count($where) >= 1) ? implode(" ", $where).' AND ' : '';
645 645
 
646 646
 		foreach ($values as $key => $val)
647 647
 		{
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 			{
652 652
 				if ($field != $index)
653 653
 				{
654
-					$final[$field][] =  'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field];
654
+					$final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field];
655 655
 				}
656 656
 			}
657 657
 		}
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/mysqli/mysqli_forge.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 				if (array_key_exists('TYPE', $attributes))
88 88
 				{
89
-					$sql .=  ' '.$attributes['TYPE'];
89
+					$sql .= ' '.$attributes['TYPE'];
90 90
 				}
91 91
 
92 92
 				if (array_key_exists('CONSTRAINT', $attributes))
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		{
160 160
 			$key_name = $this->db->_protect_identifiers(implode('_', $primary_keys));
161 161
 			$primary_keys = $this->db->_protect_identifiers($primary_keys);
162
-			$sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")";
162
+			$sql .= ",\n\tPRIMARY KEY ".$key_name." (".implode(', ', $primary_keys).")";
163 163
 		}
164 164
 
165 165
 		if (is_array($keys) && count($keys) > 0)
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 					$key = array($key_name);
178 178
 				}
179 179
 
180
-				$sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")";
180
+				$sql .= ",\n\tKEY {$key_name} (".implode(', ', $key).")";
181 181
 			}
182 182
 		}
183 183
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 		if ($after_field != '')
230 230
 		{
231
-			$sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field);
231
+			$sql .= ' AFTER '.$this->db->_protect_identifiers($after_field);
232 232
 		}
233 233
 
234 234
 		return $sql;
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/sqlite/sqlite_driver.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 		// escape LIKE condition wildcards
294 294
 		if ($like === TRUE)
295 295
 		{
296
-			$str = str_replace(	array('%', '_', $this->_like_escape_chr),
296
+			$str = str_replace(array('%', '_', $this->_like_escape_chr),
297 297
 								array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr),
298 298
 								$str);
299 299
 		}
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 			return 0;
347 347
 		}
348 348
 
349
-		$query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));
349
+		$query = $this->query($this->_count_string.$this->_protect_identifiers('numrows')." FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE));
350 350
 
351 351
 		if ($query->num_rows() == 0)
352 352
 		{
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 
356 356
 		$row = $query->row();
357 357
 		$this->_reset_select();
358
-		return (int) $row->numrows;
358
+		return (int)$row->numrows;
359 359
 	}
360 360
 
361 361
 	// --------------------------------------------------------------------
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 		{
462 462
 			if (strpos($item, '.'.$id) !== FALSE)
463 463
 			{
464
-				$str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item);
464
+				$str = $this->_escape_char.str_replace('.', $this->_escape_char.'.', $item);
465 465
 
466 466
 				// remove duplicates if the user already included the escape
467 467
 				return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str);
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
 
546 546
 		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
547 547
 
548
-		$orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):'';
548
+		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
549 549
 
550 550
 		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
551 551
 
552
-		$sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : '';
552
+		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
553 553
 
554 554
 		$sql .= $orderby.$limit;
555 555
 
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/sqlite/sqlite_result.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 		$retval = array();
87 87
 		for ($i = 0; $i < $this->num_fields(); $i++)
88 88
 		{
89
-			$F				= new stdClass();
89
+			$F = new stdClass();
90 90
 			$F->name		= sqlite_field_name($this->result_id, $i);
91 91
 			$F->type		= 'varchar';
92
-			$F->max_length	= 0;
92
+			$F->max_length = 0;
93 93
 			$F->primary_key = 0;
94
-			$F->default		= '';
94
+			$F->default = '';
95 95
 
96 96
 			$retval[] = $F;
97 97
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 			$arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC);
165 165
 			if (is_array($arr))
166 166
 			{
167
-				$obj = (object) $arr;
167
+				$obj = (object)$arr;
168 168
 				return $obj;
169 169
 			} else {
170 170
 				return NULL;
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/sqlite/sqlite_forge.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 				$sql .= "\n\t".$this->db->_protect_identifiers($field);
102 102
 
103
-				$sql .=  ' '.$attributes['TYPE'];
103
+				$sql .= ' '.$attributes['TYPE'];
104 104
 
105 105
 				if (array_key_exists('CONSTRAINT', $attributes))
106 106
 				{
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		if (count($primary_keys) > 0)
143 143
 		{
144 144
 			$primary_keys = $this->db->_protect_identifiers($primary_keys);
145
-			$sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")";
145
+			$sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).")";
146 146
 		}
147 147
 
148 148
 		if (is_array($keys) && count($keys) > 0)
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 					$key = array($this->db->_protect_identifiers($key));
159 159
 				}
160 160
 
161
-				$sql .= ",\n\tUNIQUE (" . implode(', ', $key) . ")";
161
+				$sql .= ",\n\tUNIQUE (".implode(', ', $key).")";
162 162
 			}
163 163
 		}
164 164
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
 		if ($after_field != '')
237 237
 		{
238
-			$sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field);
238
+			$sql .= ' AFTER '.$this->db->_protect_identifiers($after_field);
239 239
 		}
240 240
 
241 241
 		return $sql;
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/sqlsrv/sqlsrv_driver.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		
70 70
 		// If the username and password are both empty, assume this is a 
71 71
 		// 'Windows Authentication Mode' connection.
72
-		if(empty($connection['UID']) && empty($connection['PWD'])) {
72
+		if (empty($connection['UID']) && empty($connection['PWD'])) {
73 73
 			unset($connection['UID'], $connection['PWD']);
74 74
 		}
75 75
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	function db_select()
117 117
 	{
118
-		return $this->_execute('USE ' . $this->database);
118
+		return $this->_execute('USE '.$this->database);
119 119
 	}
120 120
 
121 121
 	// --------------------------------------------------------------------
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 		if ($table == '')
339 339
 			return '0';
340 340
 	
341
-		$query = $this->query("SELECT COUNT(*) AS numrows FROM " . $this->dbprefix . $table);
341
+		$query = $this->query("SELECT COUNT(*) AS numrows FROM ".$this->dbprefix.$table);
342 342
 		
343 343
 		if ($query->num_rows() == 0)
344 344
 			return '0';
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 	 */
394 394
 	function _field_data($table)
395 395
 	{
396
-		return "SELECT TOP 1 * FROM " . $this->_escape_table($table);	
396
+		return "SELECT TOP 1 * FROM ".$this->_escape_table($table);	
397 397
 	}
398 398
 
399 399
 	// --------------------------------------------------------------------
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 	function _error_message()
408 408
 	{
409 409
 		$error = array_shift(sqlsrv_errors());
410
-		return !empty($error['message']) ? $error['message'] : null;
410
+		return ! empty($error['message']) ? $error['message'] : null;
411 411
 	}
412 412
 
413 413
 	// --------------------------------------------------------------------
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	 */
514 514
 	function _update($table, $values, $where)
515 515
 	{
516
-		foreach($values as $key => $val)
516
+		foreach ($values as $key => $val)
517 517
 		{
518 518
 			$valstr[] = $key." = ".$val;
519 519
 		}
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	{
575 575
 		$i = $limit + $offset;
576 576
 	
577
-		return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql);		
577
+		return preg_replace('/(^\SELECT (DISTINCT)?)/i', '\\1 TOP '.$i.' ', $sql);		
578 578
 	}
579 579
 
580 580
 	// --------------------------------------------------------------------
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/sqlsrv/sqlsrv_forge.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 				$sql .= "\n\t".$this->db->_protect_identifiers($field);
105 105
 
106
-				$sql .=  ' '.$attributes['TYPE'];
106
+				$sql .= ' '.$attributes['TYPE'];
107 107
 
108 108
 				if (array_key_exists('CONSTRAINT', $attributes))
109 109
 				{
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		if (count($primary_keys) > 0)
146 146
 		{
147 147
 			$primary_keys = $this->db->_protect_identifiers($primary_keys);
148
-			$sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")";
148
+			$sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).")";
149 149
 		}
150 150
 
151 151
 		if (is_array($keys) && count($keys) > 0)
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 					$key = array($this->db->_protect_identifiers($key));
162 162
 				}
163 163
 
164
-				$sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")";
164
+				$sql .= ",\n\tFOREIGN KEY (".implode(', ', $key).")";
165 165
 			}
166 166
 		}
167 167
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
 		if ($after_field != '')
218 218
 		{
219
-			$sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field);
219
+			$sql .= ' AFTER '.$this->db->_protect_identifiers($after_field);
220 220
 		}
221 221
 
222 222
 		return $sql;
Please login to merge, or discard this patch.