Completed
Push — master ( 453503...1ea5d2 )
by Ricardo Jesus Ruiz
03:24
created
Bootstrap.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
         // Make everything relative to the root
14 14
         chdir(dirname(__DIR__));
15 15
         // Setup autoloading
16
-        require_once( __DIR__ . '/vendor/autoload.php' );
16
+        require_once(__DIR__.'/vendor/autoload.php');
17 17
     }
18 18
     /**
19 19
      * Carga Archivo de Configuración
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     static public function getConfig()
23 23
     {
24
-        if(file_exists(__DIR__.'/config/local.php')){
24
+        if (file_exists(__DIR__.'/config/local.php')) {
25 25
             return include __DIR__.'/config/local.php';
26 26
         }
27 27
         return include __DIR__.'/config/production.php';
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@
 block discarded – undo
12 12
  */
13 13
 class Bootstrap
14 14
 {
15
-    /**
16
-     * <p>Comando para levantar el autoloader</p>
17
-     */
18
-    static public function go()
19
-    {
20
-        // Make everything relative to the root
21
-        chdir(dirname(__DIR__));
22
-        // Setup autoloading
23
-        require_once( __DIR__ . '/vendor/autoload.php' );
24
-    }
25
-    /**
26
-     * Carga Archivo de Configuración
27
-     * en la seccion de Pruebas.
28
-     */
29
-    static public function getConfig()
30
-    {
31
-        if(file_exists(__DIR__.'/config/local.php')){
32
-            return include __DIR__.'/config/local.php';
33
-        }
34
-        return include __DIR__.'/config/production.php';
35
-    }
15
+	/**
16
+	 * <p>Comando para levantar el autoloader</p>
17
+	 */
18
+	static public function go()
19
+	{
20
+		// Make everything relative to the root
21
+		chdir(dirname(__DIR__));
22
+		// Setup autoloading
23
+		require_once( __DIR__ . '/vendor/autoload.php' );
24
+	}
25
+	/**
26
+	 * Carga Archivo de Configuración
27
+	 * en la seccion de Pruebas.
28
+	 */
29
+	static public function getConfig()
30
+	{
31
+		if(file_exists(__DIR__.'/config/local.php')){
32
+			return include __DIR__.'/config/local.php';
33
+		}
34
+		return include __DIR__.'/config/production.php';
35
+	}
36 36
 }
37 37
 Bootstrap::go();
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
src/CI_DB_result.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,28 +69,28 @@
 block discarded – undo
69 69
 	 *
70 70
 	 * @var	array[]
71 71
 	 */
72
-	public $result_array			= array();
72
+	public $result_array = array();
73 73
 
74 74
 	/**
75 75
 	 * Result Object
76 76
 	 *
77 77
 	 * @var	object[]
78 78
 	 */
79
-	public $result_object			= array();
79
+	public $result_object = array();
80 80
 
81 81
 	/**
82 82
 	 * Custom Result Object
83 83
 	 *
84 84
 	 * @var	object[]
85 85
 	 */
86
-	public $custom_result_object		= array();
86
+	public $custom_result_object = array();
87 87
 
88 88
 	/**
89 89
 	 * Current Row index
90 90
 	 *
91 91
 	 * @var	int
92 92
 	 */
93
-	public $current_row			= 0;
93
+	public $current_row = 0;
94 94
 
95 95
 	/**
96 96
 	 * Number of rows
Please login to merge, or discard this patch.
Braces   +14 added lines, -17 removed lines patch added patch discarded remove patch
@@ -132,12 +132,10 @@  discard block
 block discarded – undo
132 132
 		if (is_int($this->num_rows))
133 133
 		{
134 134
 			return $this->num_rows;
135
-		}
136
-		elseif (count($this->result_array) > 0)
135
+		} elseif (count($this->result_array) > 0)
137 136
 		{
138 137
 			return $this->num_rows = count($this->result_array);
139
-		}
140
-		elseif (count($this->result_object) > 0)
138
+		} elseif (count($this->result_object) > 0)
141 139
 		{
142 140
 			return $this->num_rows = count($this->result_object);
143 141
 		}
@@ -158,12 +156,10 @@  discard block
 block discarded – undo
158 156
 		if ($type === 'array')
159 157
 		{
160 158
 			return $this->result_array();
161
-		}
162
-		elseif ($type === 'object')
159
+		} elseif ($type === 'object')
163 160
 		{
164 161
 			return $this->result_object();
165
-		}
166
-		else
162
+		} else
167 163
 		{
168 164
 			return $this->custom_result_object($type);
169 165
 		}
@@ -182,8 +178,7 @@  discard block
 block discarded – undo
182 178
 		if (isset($this->custom_result_object[$class_name]))
183 179
 		{
184 180
 			return $this->custom_result_object[$class_name];
185
-		}
186
-		elseif ( ! $this->result_id OR $this->num_rows === 0)
181
+		} elseif ( ! $this->result_id OR $this->num_rows === 0)
187 182
 		{
188 183
 			return array();
189 184
 		}
@@ -193,8 +188,7 @@  discard block
 block discarded – undo
193 188
 		if (($c = count($this->result_array)) > 0)
194 189
 		{
195 190
 			$_data = 'result_array';
196
-		}
197
-		elseif (($c = count($this->result_object)) > 0)
191
+		} elseif (($c = count($this->result_object)) > 0)
198 192
 		{
199 193
 			$_data = 'result_object';
200 194
 		}
@@ -334,9 +328,13 @@  discard block
 block discarded – undo
334 328
 			return $this->row_data[$n];
335 329
 		}
336 330
 
337
-		if ($type === 'object') return $this->row_object($n);
338
-		elseif ($type === 'array') return $this->row_array($n);
339
-		else return $this->custom_row_object($n, $type);
331
+		if ($type === 'object') {
332
+			return $this->row_object($n);
333
+		} elseif ($type === 'array') {
334
+			return $this->row_array($n);
335
+		} else {
336
+			return $this->custom_row_object($n, $type);
337
+		}
340 338
 	}
341 339
 
342 340
 	// --------------------------------------------------------------------
@@ -530,8 +528,7 @@  discard block
 block discarded – undo
530 528
 		if ($type === 'array')
531 529
 		{
532 530
 			return $this->_fetch_assoc();
533
-		}
534
-		elseif ($type === 'object')
531
+		} elseif ($type === 'object')
535 532
 		{
536 533
 			return $this->_fetch_object();
537 534
 		}
Please login to merge, or discard this patch.
src/CI_DB_forge.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -58,28 +58,28 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @var	array
60 60
 	 */
61
-	public $fields		= array();
61
+	public $fields = array();
62 62
 
63 63
 	/**
64 64
 	 * Keys data
65 65
 	 *
66 66
 	 * @var	array
67 67
 	 */
68
-	public $keys		= array();
68
+	public $keys = array();
69 69
 
70 70
 	/**
71 71
 	 * Primary Keys data
72 72
 	 *
73 73
 	 * @var	array
74 74
 	 */
75
-	public $primary_keys	= array();
75
+	public $primary_keys = array();
76 76
 
77 77
 	/**
78 78
 	 * Database character set
79 79
 	 *
80 80
 	 * @var	string
81 81
 	 */
82
-	public $db_char_set	= '';
82
+	public $db_char_set = '';
83 83
 
84 84
 	// --------------------------------------------------------------------
85 85
 
@@ -88,28 +88,28 @@  discard block
 block discarded – undo
88 88
 	 *
89 89
 	 * @var	string
90 90
 	 */
91
-	protected $_create_database	= 'CREATE DATABASE %s';
91
+	protected $_create_database = 'CREATE DATABASE %s';
92 92
 
93 93
 	/**
94 94
 	 * DROP DATABASE statement
95 95
 	 *
96 96
 	 * @var	string
97 97
 	 */
98
-	protected $_drop_database	= 'DROP DATABASE %s';
98
+	protected $_drop_database = 'DROP DATABASE %s';
99 99
 
100 100
 	/**
101 101
 	 * CREATE TABLE statement
102 102
 	 *
103 103
 	 * @var	string
104 104
 	 */
105
-	protected $_create_table	= "%s %s (%s\n)";
105
+	protected $_create_table = "%s %s (%s\n)";
106 106
 
107 107
 	/**
108 108
 	 * CREATE TABLE IF statement
109 109
 	 *
110 110
 	 * @var	string
111 111
 	 */
112
-	protected $_create_table_if	= 'CREATE TABLE IF NOT EXISTS';
112
+	protected $_create_table_if = 'CREATE TABLE IF NOT EXISTS';
113 113
 
114 114
 	/**
115 115
 	 * CREATE TABLE keys flag
@@ -119,42 +119,42 @@  discard block
 block discarded – undo
119 119
 	 *
120 120
 	 * @var	bool
121 121
 	 */
122
-	protected $_create_table_keys	= FALSE;
122
+	protected $_create_table_keys = FALSE;
123 123
 
124 124
 	/**
125 125
 	 * DROP TABLE IF EXISTS statement
126 126
 	 *
127 127
 	 * @var	string
128 128
 	 */
129
-	protected $_drop_table_if	= 'DROP TABLE IF EXISTS';
129
+	protected $_drop_table_if = 'DROP TABLE IF EXISTS';
130 130
 
131 131
 	/**
132 132
 	 * RENAME TABLE statement
133 133
 	 *
134 134
 	 * @var	string
135 135
 	 */
136
-	protected $_rename_table	= 'ALTER TABLE %s RENAME TO %s;';
136
+	protected $_rename_table = 'ALTER TABLE %s RENAME TO %s;';
137 137
 
138 138
 	/**
139 139
 	 * UNSIGNED support
140 140
 	 *
141 141
 	 * @var	bool|array
142 142
 	 */
143
-	protected $_unsigned		= TRUE;
143
+	protected $_unsigned = TRUE;
144 144
 
145 145
 	/**
146 146
 	 * NULL value representation in CREATE/ALTER TABLE statements
147 147
 	 *
148 148
 	 * @var	string
149 149
 	 */
150
-	protected $_null		= '';
150
+	protected $_null = '';
151 151
 
152 152
 	/**
153 153
 	 * DEFAULT value representation in CREATE/ALTER TABLE statements
154 154
 	 *
155 155
 	 * @var	string
156 156
 	 */
157
-	protected $_default		= ' DEFAULT ';
157
+	protected $_default = ' DEFAULT ';
158 158
 
159 159
 	// --------------------------------------------------------------------
160 160
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	public function __construct(&$db)
168 168
 	{
169
-		$this->db =& $db;
169
+		$this->db = & $db;
170 170
 		log_message('info', 'Database Forge Class Initialized');
171 171
 	}
172 172
 
Please login to merge, or discard this patch.
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -183,8 +183,7 @@  discard block
 block discarded – undo
183 183
 		if ($this->_create_database === FALSE)
184 184
 		{
185 185
 			return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE;
186
-		}
187
-		elseif ( ! $this->db->query(sprintf($this->_create_database, $this->db->escape_identifiers($db_name), $this->db->char_set, $this->db->dbcollat)))
186
+		} elseif ( ! $this->db->query(sprintf($this->_create_database, $this->db->escape_identifiers($db_name), $this->db->char_set, $this->db->dbcollat)))
188 187
 		{
189 188
 			return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE;
190 189
 		}
@@ -210,8 +209,7 @@  discard block
 block discarded – undo
210 209
 		if ($this->_drop_database === FALSE)
211 210
 		{
212 211
 			return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE;
213
-		}
214
-		elseif ( ! $this->db->query(sprintf($this->_drop_database, $this->db->escape_identifiers($db_name))))
212
+		} elseif ( ! $this->db->query(sprintf($this->_drop_database, $this->db->escape_identifiers($db_name))))
215 213
 		{
216 214
 			return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE;
217 215
 		}
@@ -258,8 +256,7 @@  discard block
 block discarded – undo
258 256
 		if ($primary === TRUE)
259 257
 		{
260 258
 			$this->primary_keys[] = $key;
261
-		}
262
-		else
259
+		} else
263 260
 		{
264 261
 			$this->keys[] = $key;
265 262
 		}
@@ -289,8 +286,7 @@  discard block
 block discarded – undo
289 286
 					)
290 287
 				));
291 288
 				$this->add_key('id', TRUE);
292
-			}
293
-			else
289
+			} else
294 290
 			{
295 291
 				if (strpos($field, ' ') === FALSE)
296 292
 				{
@@ -324,8 +320,7 @@  discard block
 block discarded – undo
324 320
 		if ($table === '')
325 321
 		{
326 322
 			show_error('A table name is required for that operation.');
327
-		}
328
-		else
323
+		} else
329 324
 		{
330 325
 			$table = $this->db->dbprefix.$table;
331 326
 		}
@@ -381,8 +376,7 @@  discard block
 block discarded – undo
381 376
 			if ($this->db->table_exists($table))
382 377
 			{
383 378
 				return TRUE;
384
-			}
385
-			else
379
+			} else
386 380
 			{
387 381
 				$if_not_exists = FALSE;
388 382
 			}
@@ -502,8 +496,7 @@  discard block
 block discarded – undo
502 496
 				{
503 497
 					return TRUE;
504 498
 				}
505
-			}
506
-			else
499
+			} else
507 500
 			{
508 501
 				$sql = sprintf($this->_drop_table_if, $this->db->escape_identifiers($table));
509 502
 			}
@@ -527,8 +520,7 @@  discard block
 block discarded – undo
527 520
 		{
528 521
 			show_error('A table name is required for that operation.');
529 522
 			return FALSE;
530
-		}
531
-		elseif ($this->_rename_table === FALSE)
523
+		} elseif ($this->_rename_table === FALSE)
532 524
 		{
533 525
 			return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE;
534 526
 		}
@@ -740,8 +732,7 @@  discard block
 block discarded – undo
740 732
 				if (isset($attributes['AFTER']))
741 733
 				{
742 734
 					$field['after'] = $attributes['AFTER'];
743
-				}
744
-				elseif (isset($attributes['FIRST']))
735
+				} elseif (isset($attributes['FIRST']))
745 736
 				{
746 737
 					$field['first'] = (bool) $attributes['FIRST'];
747 738
 				}
@@ -754,13 +745,11 @@  discard block
 block discarded – undo
754 745
 				if ($attributes['NULL'] === TRUE)
755 746
 				{
756 747
 					$field['null'] = empty($this->_null) ? '' : ' '.$this->_null;
757
-				}
758
-				else
748
+				} else
759 749
 				{
760 750
 					$field['null'] = ' NOT NULL';
761 751
 				}
762
-			}
763
-			elseif ($create_table === TRUE)
752
+			} elseif ($create_table === TRUE)
764 753
 			{
765 754
 				$field['null'] = ' NOT NULL';
766 755
 			}
@@ -864,8 +853,7 @@  discard block
 block discarded – undo
864 853
 				{
865 854
 					$field['unsigned'] = ' UNSIGNED';
866 855
 					return;
867
-				}
868
-				elseif (is_string($key) && strcasecmp($attributes['TYPE'], $key) === 0)
856
+				} elseif (is_string($key) && strcasecmp($attributes['TYPE'], $key) === 0)
869 857
 				{
870 858
 					$field['type'] = $key;
871 859
 					return;
@@ -903,8 +891,7 @@  discard block
 block discarded – undo
903 891
 				// Override the NULL attribute if that's our default
904 892
 				$attributes['NULL'] = TRUE;
905 893
 				$field['null'] = empty($this->_null) ? '' : ' '.$this->_null;
906
-			}
907
-			else
894
+			} else
908 895
 			{
909 896
 				$field['default'] = $this->_default.$this->db->escape($attributes['DEFAULT']);
910 897
 			}
@@ -998,8 +985,7 @@  discard block
 block discarded – undo
998 985
 						continue;
999 986
 					}
1000 987
 				}
1001
-			}
1002
-			elseif ( ! isset($this->fields[$this->keys[$i]]))
988
+			} elseif ( ! isset($this->fields[$this->keys[$i]]))
1003 989
 			{
1004 990
 				unset($this->keys[$i]);
1005 991
 				continue;
Please login to merge, or discard this patch.
src/Mysql/CI_DB_mysqli_result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,12 +112,12 @@
 block discarded – undo
112 112
 		$field_data = $this->result_id->fetch_fields();
113 113
 		for ($i = 0, $c = count($field_data); $i < $c; $i++)
114 114
 		{
115
-			$retval[$i]			= new stdClass();
115
+			$retval[$i] = new stdClass();
116 116
 			$retval[$i]->name		= $field_data[$i]->name;
117 117
 			$retval[$i]->type		= static::_get_field_type($field_data[$i]->type);
118 118
 			$retval[$i]->max_length		= $field_data[$i]->max_length;
119 119
 			$retval[$i]->primary_key	= (int) ($field_data[$i]->flags & MYSQLI_PRI_KEY_FLAG);
120
-			$retval[$i]->default		= $field_data[$i]->def;
120
+			$retval[$i]->default = $field_data[$i]->def;
121 121
 		}
122 122
 
123 123
 		return $retval;
Please login to merge, or discard this patch.
src/Mysql/CI_DB_mysqli_forge.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @var	string
57 57
 	 */
58
-	protected $_create_database	= 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s';
58
+	protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s';
59 59
 
60 60
 	/**
61 61
 	 * CREATE TABLE keys flag
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 	 *
66 66
 	 * @var	bool
67 67
 	 */
68
-	protected $_create_table_keys	= TRUE;
68
+	protected $_create_table_keys = TRUE;
69 69
 
70 70
 	/**
71 71
 	 * UNSIGNED support
72 72
 	 *
73 73
 	 * @var	array
74 74
 	 */
75
-	protected $_unsigned		= array(
75
+	protected $_unsigned = array(
76 76
 		'TINYINT',
77 77
 		'SMALLINT',
78 78
 		'MEDIUMINT',
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -152,14 +152,12 @@  discard block
 block discarded – undo
152 152
 				$field[$i] = ($alter_type === 'ADD')
153 153
 						? "\n\tADD ".$field[$i]['_literal']
154 154
 						: "\n\tMODIFY ".$field[$i]['_literal'];
155
-			}
156
-			else
155
+			} else
157 156
 			{
158 157
 				if ($alter_type === 'ADD')
159 158
 				{
160 159
 					$field[$i]['_literal'] = "\n\tADD ";
161
-				}
162
-				else
160
+				} else
163 161
 				{
164 162
 					$field[$i]['_literal'] = empty($field[$i]['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE ";
165 163
 				}
@@ -225,8 +223,7 @@  discard block
 block discarded – undo
225 223
 						continue;
226 224
 					}
227 225
 				}
228
-			}
229
-			elseif ( ! isset($this->fields[$this->keys[$i]]))
226
+			} elseif ( ! isset($this->fields[$this->keys[$i]]))
230 227
 			{
231 228
 				unset($this->keys[$i]);
232 229
 				continue;
Please login to merge, or discard this patch.
src/Mysql/CI_DB_mysqli_utility.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,21 +55,21 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @var	string
57 57
 	 */
58
-	protected $_list_databases	= 'SHOW DATABASES';
58
+	protected $_list_databases = 'SHOW DATABASES';
59 59
 
60 60
 	/**
61 61
 	 * OPTIMIZE TABLE statement
62 62
 	 *
63 63
 	 * @var	string
64 64
 	 */
65
-	protected $_optimize_table	= 'OPTIMIZE TABLE %s';
65
+	protected $_optimize_table = 'OPTIMIZE TABLE %s';
66 66
 
67 67
 	/**
68 68
 	 * REPAIR TABLE statement
69 69
 	 *
70 70
 	 * @var	string
71 71
 	 */
72
-	protected $_repair_table	= 'REPAIR TABLE %s';
72
+	protected $_repair_table = 'REPAIR TABLE %s';
73 73
 
74 74
 	// --------------------------------------------------------------------
75 75
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 			$output .= 'SET foreign_key_checks = 0;'.$newline;
99 99
 		}
100 100
 
101
-		foreach ( (array) $tables as $table)
101
+		foreach ((array) $tables as $table)
102 102
 		{
103 103
 			// Is the table in the "ignore" list?
104 104
 			if (in_array($table, (array) $ignore, TRUE))
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 			}
170 170
 
171 171
 			// Trim off the end comma
172
-			$field_str = preg_replace('/, $/' , '', $field_str);
172
+			$field_str = preg_replace('/, $/', '', $field_str);
173 173
 
174 174
 			// Build the insert string
175 175
 			foreach ($query->result_array() as $row)
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 				}
197 197
 
198 198
 				// Remove the comma at the end of the string
199
-				$val_str = preg_replace('/, $/' , '', $val_str);
199
+				$val_str = preg_replace('/, $/', '', $val_str);
200 200
 
201 201
 				// Build the INSERT string
202 202
 				$output .= 'INSERT INTO '.$this->db->protect_identifiers($table).' ('.$field_str.') VALUES ('.$val_str.');'.$newline;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -183,8 +183,7 @@
 block discarded – undo
183 183
 					if ($v === NULL)
184 184
 					{
185 185
 						$val_str .= 'NULL';
186
-					}
187
-					else
186
+					} else
188 187
 					{
189 188
 						// Escape the data if it's not an integer
190 189
 						$val_str .= ($is_int[$i] === FALSE) ? $this->db->escape($v) : $v;
Please login to merge, or discard this patch.
src/Mysql/CI_DB_mysqli_driver.php 3 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
 		if (is_array($this->encrypt))
167 167
 		{
168 168
 			$ssl = array();
169
-			empty($this->encrypt['ssl_key'])    OR $ssl['key']    = $this->encrypt['ssl_key'];
170
-			empty($this->encrypt['ssl_cert'])   OR $ssl['cert']   = $this->encrypt['ssl_cert'];
171
-			empty($this->encrypt['ssl_ca'])     OR $ssl['ca']     = $this->encrypt['ssl_ca'];
169
+			empty($this->encrypt['ssl_key']) OR $ssl['key']    = $this->encrypt['ssl_key'];
170
+			empty($this->encrypt['ssl_cert']) OR $ssl['cert']   = $this->encrypt['ssl_cert'];
171
+			empty($this->encrypt['ssl_ca']) OR $ssl['ca']     = $this->encrypt['ssl_ca'];
172 172
 			empty($this->encrypt['ssl_capath']) OR $ssl['capath'] = $this->encrypt['ssl_capath'];
173 173
 			empty($this->encrypt['ssl_cipher']) OR $ssl['cipher'] = $this->encrypt['ssl_cipher'];
174 174
 
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 
195 195
 				$client_flags |= MYSQLI_CLIENT_SSL;
196 196
 				$this->_mysqli->ssl_set(
197
-					isset($ssl['key'])    ? $ssl['key']    : NULL,
198
-					isset($ssl['cert'])   ? $ssl['cert']   : NULL,
199
-					isset($ssl['ca'])     ? $ssl['ca']     : NULL,
197
+					isset($ssl['key']) ? $ssl['key'] : NULL,
198
+					isset($ssl['cert']) ? $ssl['cert'] : NULL,
199
+					isset($ssl['ca']) ? $ssl['ca'] : NULL,
200 200
 					isset($ssl['capath']) ? $ssl['capath'] : NULL,
201 201
 					isset($ssl['cipher']) ? $ssl['cipher'] : NULL
202 202
 				);
@@ -475,16 +475,16 @@  discard block
 block discarded – undo
475 475
 		$retval = array();
476 476
 		for ($i = 0, $c = count($query); $i < $c; $i++)
477 477
 		{
478
-			$retval[$i]			= new stdClass();
479
-			$retval[$i]->name		= $query[$i]->Field;
478
+			$retval[$i] = new stdClass();
479
+			$retval[$i]->name = $query[$i]->Field;
480 480
 
481 481
 			sscanf($query[$i]->Type, '%[a-z](%d)',
482 482
 				$retval[$i]->type,
483 483
 				$retval[$i]->max_length
484 484
 			);
485 485
 
486
-			$retval[$i]->default		= $query[$i]->Default;
487
-			$retval[$i]->primary_key	= (int) ($query[$i]->Key === 'PRI');
486
+			$retval[$i]->default = $query[$i]->Default;
487
+			$retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI');
488 488
 		}
489 489
 
490 490
 		return $retval;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,8 +127,7 @@  discard block
 block discarded – undo
127 127
 			$hostname = NULL;
128 128
 			$port = NULL;
129 129
 			$socket = $this->hostname;
130
-		}
131
-		else
130
+		} else
132 131
 		{
133 132
 			$hostname = ($persistent === TRUE)
134 133
 				? 'p:'.$this->hostname : $this->hostname;
@@ -146,8 +145,7 @@  discard block
 block discarded – undo
146 145
 			if ($this->stricton)
147 146
 			{
148 147
 				$this->_mysqli->options(MYSQLI_INIT_COMMAND, 'SET SESSION sql_mode = CONCAT(@@sql_mode, ",", "STRICT_ALL_TABLES")');
149
-			}
150
-			else
148
+			} else
151 149
 			{
152 150
 				$this->_mysqli->options(MYSQLI_INIT_COMMAND,
153 151
 					'SET SESSION sql_mode =
Please login to merge, or discard this patch.
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -54,67 +54,67 @@  discard block
 block discarded – undo
54 54
  * @link		https://codeigniter.com/user_guide/database/
55 55
  */
56 56
 class CI_DB_mysqli_driver extends CI_DB_driver {
57
-    /**
58
-     * Database driver
59
-     *
60
-     * @var string
61
-     */
62
-    public $dbdriver = 'mysqli';
63
-    /**
64
-     * Compression flag
65
-     *
66
-     * @var bool
67
-     */
68
-    public $compress = FALSE;
69
-    /**
70
-     * DELETE hack flag
71
-     *
72
-     * Whether to use the MySQL "delete hack" which allows the number
73
-     * of affected rows to be shown. Uses a preg_replace when enabled,
74
-     * adding a bit more processing to all queries.
75
-     *
76
-     * @var bool
77
-     */
78
-    public $delete_hack = TRUE;
79
-    /**
80
-     * Strict ON flag
81
-     *
82
-     * Whether we're running in strict SQL mode.
83
-     *
84
-     * @var bool
85
-     */
86
-    public $stricton;
87
-    /**
88
-     * Identifier escape character
89
-     *
90
-     * @var string
91
-     */
92
-    protected $_escape_char = '`';
93
-    /**
94
-     * MySQLi object
95
-     *
96
-     * Has to be preserved without being assigned to $conn_id.
97
-     *
98
-     * @var MySQLi
99
-     */
100
-    protected $_mysqli;
101
-    /**
102
-     * 
103
-     * @param array $params
104
-     */
105
-    public function __construct(array $params)
106
-    {
107
-        parent::__construct($params);
108
-    }
109
-
110
-    /**
111
-     * Database connection
112
-     *
113
-     * @param	bool	$persistent
114
-     * @return	object
115
-     **/
116
-    public function db_connect($persistent = FALSE)
117
-    {
57
+	/**
58
+	 * Database driver
59
+	 *
60
+	 * @var string
61
+	 */
62
+	public $dbdriver = 'mysqli';
63
+	/**
64
+	 * Compression flag
65
+	 *
66
+	 * @var bool
67
+	 */
68
+	public $compress = FALSE;
69
+	/**
70
+	 * DELETE hack flag
71
+	 *
72
+	 * Whether to use the MySQL "delete hack" which allows the number
73
+	 * of affected rows to be shown. Uses a preg_replace when enabled,
74
+	 * adding a bit more processing to all queries.
75
+	 *
76
+	 * @var bool
77
+	 */
78
+	public $delete_hack = TRUE;
79
+	/**
80
+	 * Strict ON flag
81
+	 *
82
+	 * Whether we're running in strict SQL mode.
83
+	 *
84
+	 * @var bool
85
+	 */
86
+	public $stricton;
87
+	/**
88
+	 * Identifier escape character
89
+	 *
90
+	 * @var string
91
+	 */
92
+	protected $_escape_char = '`';
93
+	/**
94
+	 * MySQLi object
95
+	 *
96
+	 * Has to be preserved without being assigned to $conn_id.
97
+	 *
98
+	 * @var MySQLi
99
+	 */
100
+	protected $_mysqli;
101
+	/**
102
+	 * 
103
+	 * @param array $params
104
+	 */
105
+	public function __construct(array $params)
106
+	{
107
+		parent::__construct($params);
108
+	}
109
+
110
+	/**
111
+	 * Database connection
112
+	 *
113
+	 * @param	bool	$persistent
114
+	 * @return	object
115
+	 **/
116
+	public function db_connect($persistent = FALSE)
117
+	{
118 118
 		// Do we have a socket path?
119 119
 		if ($this->hostname[0] === '/')
120 120
 		{
@@ -215,22 +215,22 @@  discard block
 block discarded – undo
215 215
 		}
216 216
 
217 217
 		return FALSE;
218
-    }
218
+	}
219 219
 
220 220
 	// --------------------------------------------------------------------
221 221
 
222
-    /**
223
-     * Reconnect
224
-     * Keep / reestablish the db connection if no queries have been
225
-     * sent for a length of time exceeding the server's idle timeout
226
-     * @return void
227
-     */
228
-    public function reconnect()
229
-    {
230
-        if ($this->conn_id !== FALSE && $this->conn_id->ping() === FALSE) {
231
-            $this->conn_id = FALSE;
232
-        }
233
-    }
222
+	/**
223
+	 * Reconnect
224
+	 * Keep / reestablish the db connection if no queries have been
225
+	 * sent for a length of time exceeding the server's idle timeout
226
+	 * @return void
227
+	 */
228
+	public function reconnect()
229
+	{
230
+		if ($this->conn_id !== FALSE && $this->conn_id->ping() === FALSE) {
231
+			$this->conn_id = FALSE;
232
+		}
233
+	}
234 234
 	/**
235 235
 	 * Select the database
236 236
 	 *
@@ -299,33 +299,33 @@  discard block
 block discarded – undo
299 299
 
300 300
 	// --------------------------------------------------------------------
301 301
 
302
-    /**
303
-     * Prep the query
304
-     *
305
-     * If needed, each database adapter can prep the query string
306
-     *
307
-     * @param   string $sql an SQL query
308
-     * @return  string
309
-     */
310
-    protected function _prep_query($sql)
311
-    {
312
-        // mysqli_affected_rows() returns 0 for "DELETE FROM TABLE" queries. This hack
313
-        // modifies the query so that it a proper number of affected rows is returned.
314
-        if ($this->delete_hack === TRUE && preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) {
315
-                return trim($sql).' WHERE 1=1';
316
-        }
317
-        return $sql;
318
-    }
319
-    /**
320
-     * Begin Transaction
321
-     *
322
-     * @return bool
323
-     */
324
-    protected function _trans_begin()
325
-    {
326
-        $this->conn_id->autocommit(FALSE);
327
-        return  $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK
328
-    }
302
+	/**
303
+	 * Prep the query
304
+	 *
305
+	 * If needed, each database adapter can prep the query string
306
+	 *
307
+	 * @param   string $sql an SQL query
308
+	 * @return  string
309
+	 */
310
+	protected function _prep_query($sql)
311
+	{
312
+		// mysqli_affected_rows() returns 0 for "DELETE FROM TABLE" queries. This hack
313
+		// modifies the query so that it a proper number of affected rows is returned.
314
+		if ($this->delete_hack === TRUE && preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) {
315
+				return trim($sql).' WHERE 1=1';
316
+		}
317
+		return $sql;
318
+	}
319
+	/**
320
+	 * Begin Transaction
321
+	 *
322
+	 * @return bool
323
+	 */
324
+	protected function _trans_begin()
325
+	{
326
+		$this->conn_id->autocommit(FALSE);
327
+		return  $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK
328
+	}
329 329
 
330 330
 	// --------------------------------------------------------------------
331 331
 
Please login to merge, or discard this patch.
src/CI_DB_driver.php 3 patches
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 *
97 97
 	 * @var	string
98 98
 	 */
99
-	public $dbdriver		= 'mysqli';
99
+	public $dbdriver = 'mysqli';
100 100
 
101 101
 	/**
102 102
 	 * Sub-driver
@@ -111,63 +111,63 @@  discard block
 block discarded – undo
111 111
 	 *
112 112
 	 * @var	string
113 113
 	 */
114
-	public $dbprefix		= '';
114
+	public $dbprefix = '';
115 115
 
116 116
 	/**
117 117
 	 * Character set
118 118
 	 *
119 119
 	 * @var	string
120 120
 	 */
121
-	public $char_set		= 'utf8';
121
+	public $char_set = 'utf8';
122 122
 
123 123
 	/**
124 124
 	 * Collation
125 125
 	 *
126 126
 	 * @var	string
127 127
 	 */
128
-	public $dbcollat		= 'utf8_general_ci';
128
+	public $dbcollat = 'utf8_general_ci';
129 129
 
130 130
 	/**
131 131
 	 * Encryption flag/data
132 132
 	 *
133 133
 	 * @var	mixed
134 134
 	 */
135
-	public $encrypt			= FALSE;
135
+	public $encrypt = FALSE;
136 136
 
137 137
 	/**
138 138
 	 * Swap Prefix
139 139
 	 *
140 140
 	 * @var	string
141 141
 	 */
142
-	public $swap_pre		= '';
142
+	public $swap_pre = '';
143 143
 
144 144
 	/**
145 145
 	 * Database port
146 146
 	 *
147 147
 	 * @var	int
148 148
 	 */
149
-	public $port			= '';
149
+	public $port = '';
150 150
 
151 151
 	/**
152 152
 	 * Persistent connection flag
153 153
 	 *
154 154
 	 * @var	bool
155 155
 	 */
156
-	public $pconnect		= FALSE;
156
+	public $pconnect = FALSE;
157 157
 
158 158
 	/**
159 159
 	 * Connection ID
160 160
 	 *
161 161
 	 * @var	object|resource
162 162
 	 */
163
-	public $conn_id			= FALSE;
163
+	public $conn_id = FALSE;
164 164
 
165 165
 	/**
166 166
 	 * Result ID
167 167
 	 *
168 168
 	 * @var	object|resource
169 169
 	 */
170
-	public $result_id		= FALSE;
170
+	public $result_id = FALSE;
171 171
 
172 172
 	/**
173 173
 	 * Debug flag
@@ -176,21 +176,21 @@  discard block
 block discarded – undo
176 176
 	 *
177 177
 	 * @var	bool
178 178
 	 */
179
-	public $db_debug		= FALSE;
179
+	public $db_debug = FALSE;
180 180
 
181 181
 	/**
182 182
 	 * Benchmark time
183 183
 	 *
184 184
 	 * @var	int
185 185
 	 */
186
-	public $benchmark		= 0;
186
+	public $benchmark = 0;
187 187
 
188 188
 	/**
189 189
 	 * Executed queries count
190 190
 	 *
191 191
 	 * @var	int
192 192
 	 */
193
-	public $query_count		= 0;
193
+	public $query_count = 0;
194 194
 
195 195
 	/**
196 196
 	 * Bind marker
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 *
200 200
 	 * @var	string
201 201
 	 */
202
-	public $bind_marker		= '?';
202
+	public $bind_marker = '?';
203 203
 
204 204
 	/**
205 205
 	 * Save queries flag
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 *
209 209
 	 * @var	bool
210 210
 	 */
211
-	public $save_queries		= TRUE;
211
+	public $save_queries = TRUE;
212 212
 
213 213
 	/**
214 214
 	 * Queries list
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * @see	CI_DB_driver::$save_queries
217 217
 	 * @var	string[]
218 218
 	 */
219
-	public $queries			= array();
219
+	public $queries = array();
220 220
 
221 221
 	/**
222 222
 	 * Query times
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 *
226 226
 	 * @var	array
227 227
 	 */
228
-	public $query_times		= array();
228
+	public $query_times = array();
229 229
 
230 230
 	/**
231 231
 	 * Data cache
@@ -234,28 +234,28 @@  discard block
 block discarded – undo
234 234
 	 *
235 235
 	 * @var	array
236 236
 	 */
237
-	public $data_cache		= array();
237
+	public $data_cache = array();
238 238
 
239 239
 	/**
240 240
 	 * Transaction enabled flag
241 241
 	 *
242 242
 	 * @var	bool
243 243
 	 */
244
-	public $trans_enabled		= TRUE;
244
+	public $trans_enabled = TRUE;
245 245
 
246 246
 	/**
247 247
 	 * Strict transaction mode flag
248 248
 	 *
249 249
 	 * @var	bool
250 250
 	 */
251
-	public $trans_strict		= TRUE;
251
+	public $trans_strict = TRUE;
252 252
 
253 253
 	/**
254 254
 	 * Transaction depth level
255 255
 	 *
256 256
 	 * @var	int
257 257
 	 */
258
-	protected $_trans_depth		= 0;
258
+	protected $_trans_depth = 0;
259 259
 
260 260
 	/**
261 261
 	 * Transaction status flag
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 *
265 265
 	 * @var	bool
266 266
 	 */
267
-	protected $_trans_status	= TRUE;
267
+	protected $_trans_status = TRUE;
268 268
 
269 269
 	/**
270 270
 	 * Transaction failure flag
@@ -273,28 +273,28 @@  discard block
 block discarded – undo
273 273
 	 *
274 274
 	 * @var	bool
275 275
 	 */
276
-	protected $_trans_failure	= FALSE;
276
+	protected $_trans_failure = FALSE;
277 277
 
278 278
 	/**
279 279
 	 * Cache On flag
280 280
 	 *
281 281
 	 * @var	bool
282 282
 	 */
283
-	public $cache_on		= FALSE;
283
+	public $cache_on = FALSE;
284 284
 
285 285
 	/**
286 286
 	 * Cache directory path
287 287
 	 *
288 288
 	 * @var	bool
289 289
 	 */
290
-	public $cachedir		= '';
290
+	public $cachedir = '';
291 291
 
292 292
 	/**
293 293
 	 * Cache auto-delete flag
294 294
 	 *
295 295
 	 * @var	bool
296 296
 	 */
297
-	public $cache_autodel		= FALSE;
297
+	public $cache_autodel = FALSE;
298 298
 
299 299
 	/**
300 300
 	 * DB Cache object
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 *
310 310
 	 * @var	bool
311 311
 	 */
312
-	protected $_protect_identifiers		= TRUE;
312
+	protected $_protect_identifiers = TRUE;
313 313
 
314 314
 	/**
315 315
 	 * List of reserved identifiers
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 *
319 319
 	 * @var	string[]
320 320
 	 */
321
-	protected $_reserved_identifiers	= array('*');
321
+	protected $_reserved_identifiers = array('*');
322 322
 
323 323
 	/**
324 324
 	 * Identifier escape character
@@ -721,8 +721,8 @@  discard block
 block discarded – undo
721 721
 		}
722 722
 
723 723
 		// Load and instantiate the result driver
724
-		$driver		= $this->load_rdriver();
725
-		$RES		= new $driver($this);
724
+		$driver = $this->load_rdriver();
725
+		$RES = new $driver($this);
726 726
 
727 727
 		// Is query caching enabled? If so, we'll serialize the
728 728
 		// result object and save it to a cache file.
@@ -735,13 +735,13 @@  discard block
 block discarded – undo
735 735
 			// result object, so we'll have to compile the data
736 736
 			// and save it)
737 737
 			$CR = new CI_DB_result($this);
738
-			$CR->result_object	= $RES->result_object();
739
-			$CR->result_array	= $RES->result_array();
740
-			$CR->num_rows		= $RES->num_rows();
738
+			$CR->result_object = $RES->result_object();
739
+			$CR->result_array = $RES->result_array();
740
+			$CR->num_rows = $RES->num_rows();
741 741
 
742 742
 			// Reset these since cached objects can not utilize resource IDs.
743
-			$CR->conn_id		= NULL;
744
-			$CR->result_id		= NULL;
743
+			$CR->conn_id = NULL;
744
+			$CR->result_id = NULL;
745 745
 
746 746
 			$this->CACHE->write($sql, $CR);
747 747
 		}
@@ -1557,17 +1557,17 @@  discard block
 block discarded – undo
1557 1557
 				? '\s+'.preg_quote(trim(sprintf($this->_like_escape_str, $this->_like_escape_chr)), '/')
1558 1558
 				: '';
1559 1559
 			$_operators = array(
1560
-				'\s*(?:<|>|!)?=\s*',             // =, <=, >=, !=
1561
-				'\s*<>?\s*',                     // <, <>
1562
-				'\s*>\s*',                       // >
1563
-				'\s+IS NULL',                    // IS NULL
1564
-				'\s+IS NOT NULL',                // IS NOT NULL
1565
-				'\s+EXISTS\s*\(.*\)',        // EXISTS(sql)
1566
-				'\s+NOT EXISTS\s*\(.*\)',    // NOT EXISTS(sql)
1567
-				'\s+BETWEEN\s+',                 // BETWEEN value AND value
1568
-				'\s+IN\s*\(.*\)',            // IN(list)
1569
-				'\s+NOT IN\s*\(.*\)',        // NOT IN (list)
1570
-				'\s+LIKE\s+\S.*('.$_les.')?',    // LIKE 'expr'[ ESCAPE '%s']
1560
+				'\s*(?:<|>|!)?=\s*', // =, <=, >=, !=
1561
+				'\s*<>?\s*', // <, <>
1562
+				'\s*>\s*', // >
1563
+				'\s+IS NULL', // IS NULL
1564
+				'\s+IS NOT NULL', // IS NOT NULL
1565
+				'\s+EXISTS\s*\(.*\)', // EXISTS(sql)
1566
+				'\s+NOT EXISTS\s*\(.*\)', // NOT EXISTS(sql)
1567
+				'\s+BETWEEN\s+', // BETWEEN value AND value
1568
+				'\s+IN\s*\(.*\)', // IN(list)
1569
+				'\s+NOT IN\s*\(.*\)', // NOT IN (list)
1570
+				'\s+LIKE\s+\S.*('.$_les.')?', // LIKE 'expr'[ ESCAPE '%s']
1571 1571
 				'\s+NOT LIKE\s+\S.*('.$_les.')?' // NOT LIKE 'expr'[ ESCAPE '%s']
1572 1572
 			);
1573 1573
 
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
 	 */
1736 1736
 	public function display_error($error = '', $swap = '', $native = FALSE)
1737 1737
 	{
1738
-		$LANG =& load_class('Lang', 'core');
1738
+		$LANG = & load_class('Lang', 'core');
1739 1739
 		$LANG->load('db');
1740 1740
 
1741 1741
 		$heading = $LANG->line('db_error_heading');
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
 			}
1774 1774
 		}
1775 1775
 
1776
-		$error =& load_class('Exceptions', 'core');
1776
+		$error = & load_class('Exceptions', 'core');
1777 1777
 		echo $error->show_error($heading, $message, 'error_db');
1778 1778
 		exit(8); // EXIT_DATABASE
1779 1779
 	}
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 			// We still don't have a connection?
432 432
 			if ( ! $this->conn_id)
433 433
 			{
434
-                            error_log('error', 'Unable to connect to the database');
434
+							error_log('error', 'Unable to connect to the database');
435 435
 
436 436
 				if ($this->db_debug)
437 437
 				{
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 	{
529 529
 		if (method_exists($this, '_db_set_charset') && ! $this->_db_set_charset($charset))
530 530
 		{
531
-                    error_log('error', 'Unable to set database connection charset: '.$charset);
531
+					error_log('error', 'Unable to set database connection charset: '.$charset);
532 532
 
533 533
 			if ($this->db_debug)
534 534
 			{
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 	{
612 612
 		if ($sql === '')
613 613
 		{
614
-                    error_log('error', 'Invalid query: '.$sql);
614
+					error_log('error', 'Invalid query: '.$sql);
615 615
 			return ($this->db_debug) ? $this->display_error('db_invalid_query') : FALSE;
616 616
 		}
617 617
 		elseif ( ! is_bool($return_object))
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 					$this->trans_complete();
685 685
 					if ($trans_depth === $this->_trans_depth)
686 686
 					{
687
-                                            error_log('error', 'Database: Failure during an automated transaction commit/rollback!');
687
+											error_log('error', 'Database: Failure during an automated transaction commit/rollback!');
688 688
 						break;
689 689
 					}
690 690
 				}
Please login to merge, or discard this patch.
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -613,8 +613,7 @@  discard block
 block discarded – undo
613 613
 		{
614 614
                     error_log('error', 'Invalid query: '.$sql);
615 615
 			return ($this->db_debug) ? $this->display_error('db_invalid_query') : FALSE;
616
-		}
617
-		elseif ( ! is_bool($return_object))
616
+		} elseif ( ! is_bool($return_object))
618 617
 		{
619 618
 			$return_object = ! $this->is_write_type($sql);
620 619
 		}
@@ -979,13 +978,11 @@  discard block
 block discarded – undo
979 978
 		if (empty($this->bind_marker) OR strpos($sql, $this->bind_marker) === FALSE)
980 979
 		{
981 980
 			return $sql;
982
-		}
983
-		elseif ( ! is_array($binds))
981
+		} elseif ( ! is_array($binds))
984 982
 		{
985 983
 			$binds = array($binds);
986 984
 			$bind_count = 1;
987
-		}
988
-		else
985
+		} else
989 986
 		{
990 987
 			// Make sure we're using numeric keys
991 988
 			$binds = array_values($binds);
@@ -1009,8 +1006,7 @@  discard block
 block discarded – undo
1009 1006
 			{
1010 1007
 				return $sql;
1011 1008
 			}
1012
-		}
1013
-		elseif (($c = preg_match_all('/'.preg_quote($this->bind_marker, '/').'/i', $sql, $matches, PREG_OFFSET_CAPTURE)) !== $bind_count)
1009
+		} elseif (($c = preg_match_all('/'.preg_quote($this->bind_marker, '/').'/i', $sql, $matches, PREG_OFFSET_CAPTURE)) !== $bind_count)
1014 1010
 		{
1015 1011
 			return $sql;
1016 1012
 		}
@@ -1097,16 +1093,13 @@  discard block
 block discarded – undo
1097 1093
 		{
1098 1094
 			$str = array_map(array(&$this, 'escape'), $str);
1099 1095
 			return $str;
1100
-		}
1101
-		elseif (is_string($str) OR (is_object($str) && method_exists($str, '__toString')))
1096
+		} elseif (is_string($str) OR (is_object($str) && method_exists($str, '__toString')))
1102 1097
 		{
1103 1098
 			return "'".$this->escape_str($str)."'";
1104
-		}
1105
-		elseif (is_bool($str))
1099
+		} elseif (is_bool($str))
1106 1100
 		{
1107 1101
 			return ($str === FALSE) ? 0 : 1;
1108
-		}
1109
-		elseif ($str === NULL)
1102
+		} elseif ($str === NULL)
1110 1103
 		{
1111 1104
 			return 'NULL';
1112 1105
 		}
@@ -1257,12 +1250,10 @@  discard block
 block discarded – undo
1257 1250
 				if (isset($row['table_name']))
1258 1251
 				{
1259 1252
 					$key = 'table_name';
1260
-				}
1261
-				elseif (isset($row['TABLE_NAME']))
1253
+				} elseif (isset($row['TABLE_NAME']))
1262 1254
 				{
1263 1255
 					$key = 'TABLE_NAME';
1264
-				}
1265
-				else
1256
+				} else
1266 1257
 				{
1267 1258
 					/* We have no other choice but to just get the first element's key.
1268 1259
 					 * Due to array_shift() accepting its argument by reference, if
@@ -1325,12 +1316,10 @@  discard block
 block discarded – undo
1325 1316
 				if (isset($row['column_name']))
1326 1317
 				{
1327 1318
 					$key = 'column_name';
1328
-				}
1329
-				elseif (isset($row['COLUMN_NAME']))
1319
+				} elseif (isset($row['COLUMN_NAME']))
1330 1320
 				{
1331 1321
 					$key = 'COLUMN_NAME';
1332
-				}
1333
-				else
1322
+				} else
1334 1323
 				{
1335 1324
 					// We have no other choice but to just get the first element's key.
1336 1325
 					$key = key($row);
@@ -1386,8 +1375,7 @@  discard block
 block discarded – undo
1386 1375
 		if ($this->_escape_char === '' OR empty($item) OR in_array($item, $this->_reserved_identifiers))
1387 1376
 		{
1388 1377
 			return $item;
1389
-		}
1390
-		elseif (is_array($item))
1378
+		} elseif (is_array($item))
1391 1379
 		{
1392 1380
 			foreach ($item as $key => $value)
1393 1381
 			{
@@ -1414,8 +1402,7 @@  discard block
 block discarded – undo
1414 1402
 					$this->_escape_char[0],
1415 1403
 					$this->_escape_char[1]
1416 1404
 				);
1417
-			}
1418
-			else
1405
+			} else
1419 1406
 			{
1420 1407
 				$preg_ec[0] = $preg_ec[1] = preg_quote($this->_escape_char, '/');
1421 1408
 				$preg_ec[2] = $preg_ec[3] = $this->_escape_char;
@@ -1683,8 +1670,7 @@  discard block
 block discarded – undo
1683 1670
 		if ( ! class_exists('CI_DB_Cache', FALSE))
1684 1671
 		{
1685 1672
 			require_once(BASEPATH.'database/DB_cache.php');
1686
-		}
1687
-		elseif (is_object($this->CACHE))
1673
+		} elseif (is_object($this->CACHE))
1688 1674
 		{
1689 1675
 			return TRUE;
1690 1676
 		}
@@ -1743,8 +1729,7 @@  discard block
 block discarded – undo
1743 1729
 		if ($native === TRUE)
1744 1730
 		{
1745 1731
 			$message = (array) $error;
1746
-		}
1747
-		else
1732
+		} else
1748 1733
 		{
1749 1734
 			$message = is_array($error) ? $error : array(str_replace('%s', $swap, $LANG->line($error)));
1750 1735
 		}
@@ -1847,15 +1832,13 @@  discard block
 block discarded – undo
1847 1832
 				? substr($item, $offset, 4).$this->escape_identifiers(substr($item, $offset + 4))
1848 1833
 				: substr($item, $offset);
1849 1834
 			$item = substr($item, 0, $offset);
1850
-		}
1851
-		elseif ($offset = strrpos($item, ' '))
1835
+		} elseif ($offset = strrpos($item, ' '))
1852 1836
 		{
1853 1837
 			$alias = ($protect_identifiers)
1854 1838
 				? ' '.$this->escape_identifiers(substr($item, $offset + 1))
1855 1839
 				: substr($item, $offset);
1856 1840
 			$item = substr($item, 0, $offset);
1857
-		}
1858
-		else
1841
+		} else
1859 1842
 		{
1860 1843
 			$alias = '';
1861 1844
 		}
Please login to merge, or discard this patch.
src/CI_DB_query_builder.php 2 patches
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -56,126 +56,126 @@  discard block
 block discarded – undo
56 56
 	 *
57 57
 	 * @var	bool
58 58
 	 */
59
-	protected $return_delete_sql		= FALSE;
59
+	protected $return_delete_sql = FALSE;
60 60
 
61 61
 	/**
62 62
 	 * Reset DELETE data flag
63 63
 	 *
64 64
 	 * @var	bool
65 65
 	 */
66
-	protected $reset_delete_data		= FALSE;
66
+	protected $reset_delete_data = FALSE;
67 67
 
68 68
 	/**
69 69
 	 * QB SELECT data
70 70
 	 *
71 71
 	 * @var	array
72 72
 	 */
73
-	protected $qb_select			= array();
73
+	protected $qb_select = array();
74 74
 
75 75
 	/**
76 76
 	 * QB DISTINCT flag
77 77
 	 *
78 78
 	 * @var	bool
79 79
 	 */
80
-	protected $qb_distinct			= FALSE;
80
+	protected $qb_distinct = FALSE;
81 81
 
82 82
 	/**
83 83
 	 * QB FROM data
84 84
 	 *
85 85
 	 * @var	array
86 86
 	 */
87
-	protected $qb_from			= array();
87
+	protected $qb_from = array();
88 88
 
89 89
 	/**
90 90
 	 * QB JOIN data
91 91
 	 *
92 92
 	 * @var	array
93 93
 	 */
94
-	protected $qb_join			= array();
94
+	protected $qb_join = array();
95 95
 
96 96
 	/**
97 97
 	 * QB WHERE data
98 98
 	 *
99 99
 	 * @var	array
100 100
 	 */
101
-	protected $qb_where			= array();
101
+	protected $qb_where = array();
102 102
 
103 103
 	/**
104 104
 	 * QB GROUP BY data
105 105
 	 *
106 106
 	 * @var	array
107 107
 	 */
108
-	protected $qb_groupby			= array();
108
+	protected $qb_groupby = array();
109 109
 
110 110
 	/**
111 111
 	 * QB HAVING data
112 112
 	 *
113 113
 	 * @var	array
114 114
 	 */
115
-	protected $qb_having			= array();
115
+	protected $qb_having = array();
116 116
 
117 117
 	/**
118 118
 	 * QB keys
119 119
 	 *
120 120
 	 * @var	array
121 121
 	 */
122
-	protected $qb_keys			= array();
122
+	protected $qb_keys = array();
123 123
 
124 124
 	/**
125 125
 	 * QB LIMIT data
126 126
 	 *
127 127
 	 * @var	int
128 128
 	 */
129
-	protected $qb_limit			= FALSE;
129
+	protected $qb_limit = FALSE;
130 130
 
131 131
 	/**
132 132
 	 * QB OFFSET data
133 133
 	 *
134 134
 	 * @var	int
135 135
 	 */
136
-	protected $qb_offset			= FALSE;
136
+	protected $qb_offset = FALSE;
137 137
 
138 138
 	/**
139 139
 	 * QB ORDER BY data
140 140
 	 *
141 141
 	 * @var	array
142 142
 	 */
143
-	protected $qb_orderby			= array();
143
+	protected $qb_orderby = array();
144 144
 
145 145
 	/**
146 146
 	 * QB data sets
147 147
 	 *
148 148
 	 * @var	array
149 149
 	 */
150
-	protected $qb_set			= array();
150
+	protected $qb_set = array();
151 151
 
152 152
 	/**
153 153
 	 * QB data set for update_batch()
154 154
 	 *
155 155
 	 * @var	array
156 156
 	 */
157
-	protected $qb_set_ub			= array();
157
+	protected $qb_set_ub = array();
158 158
 
159 159
 	/**
160 160
 	 * QB aliased tables list
161 161
 	 *
162 162
 	 * @var	array
163 163
 	 */
164
-	protected $qb_aliased_tables		= array();
164
+	protected $qb_aliased_tables = array();
165 165
 
166 166
 	/**
167 167
 	 * QB WHERE group started flag
168 168
 	 *
169 169
 	 * @var	bool
170 170
 	 */
171
-	protected $qb_where_group_started	= FALSE;
171
+	protected $qb_where_group_started = FALSE;
172 172
 
173 173
 	/**
174 174
 	 * QB WHERE group count
175 175
 	 *
176 176
 	 * @var	int
177 177
 	 */
178
-	protected $qb_where_group_count		= 0;
178
+	protected $qb_where_group_count = 0;
179 179
 
180 180
 	// Query Builder Caching variables
181 181
 
@@ -184,91 +184,91 @@  discard block
 block discarded – undo
184 184
 	 *
185 185
 	 * @var	bool
186 186
 	 */
187
-	protected $qb_caching				= FALSE;
187
+	protected $qb_caching = FALSE;
188 188
 
189 189
 	/**
190 190
 	 * QB Cache exists list
191 191
 	 *
192 192
 	 * @var	array
193 193
 	 */
194
-	protected $qb_cache_exists			= array();
194
+	protected $qb_cache_exists = array();
195 195
 
196 196
 	/**
197 197
 	 * QB Cache SELECT data
198 198
 	 *
199 199
 	 * @var	array
200 200
 	 */
201
-	protected $qb_cache_select			= array();
201
+	protected $qb_cache_select = array();
202 202
 
203 203
 	/**
204 204
 	 * QB Cache FROM data
205 205
 	 *
206 206
 	 * @var	array
207 207
 	 */
208
-	protected $qb_cache_from			= array();
208
+	protected $qb_cache_from = array();
209 209
 
210 210
 	/**
211 211
 	 * QB Cache JOIN data
212 212
 	 *
213 213
 	 * @var	array
214 214
 	 */
215
-	protected $qb_cache_join			= array();
215
+	protected $qb_cache_join = array();
216 216
 
217 217
 	/**
218 218
 	 * QB Cache aliased tables list
219 219
 	 *
220 220
 	 * @var	array
221 221
 	 */
222
-	protected $qb_cache_aliased_tables			= array();
222
+	protected $qb_cache_aliased_tables = array();
223 223
 
224 224
 	/**
225 225
 	 * QB Cache WHERE data
226 226
 	 *
227 227
 	 * @var	array
228 228
 	 */
229
-	protected $qb_cache_where			= array();
229
+	protected $qb_cache_where = array();
230 230
 
231 231
 	/**
232 232
 	 * QB Cache GROUP BY data
233 233
 	 *
234 234
 	 * @var	array
235 235
 	 */
236
-	protected $qb_cache_groupby			= array();
236
+	protected $qb_cache_groupby = array();
237 237
 
238 238
 	/**
239 239
 	 * QB Cache HAVING data
240 240
 	 *
241 241
 	 * @var	array
242 242
 	 */
243
-	protected $qb_cache_having			= array();
243
+	protected $qb_cache_having = array();
244 244
 
245 245
 	/**
246 246
 	 * QB Cache ORDER BY data
247 247
 	 *
248 248
 	 * @var	array
249 249
 	 */
250
-	protected $qb_cache_orderby			= array();
250
+	protected $qb_cache_orderby = array();
251 251
 
252 252
 	/**
253 253
 	 * QB Cache data sets
254 254
 	 *
255 255
 	 * @var	array
256 256
 	 */
257
-	protected $qb_cache_set				= array();
257
+	protected $qb_cache_set = array();
258 258
 
259 259
 	/**
260 260
 	 * QB No Escape data
261 261
 	 *
262 262
 	 * @var	array
263 263
 	 */
264
-	protected $qb_no_escape 			= array();
264
+	protected $qb_no_escape = array();
265 265
 
266 266
 	/**
267 267
 	 * QB Cache No Escape data
268 268
 	 *
269 269
 	 * @var	array
270 270
 	 */
271
-	protected $qb_cache_no_escape			= array();
271
+	protected $qb_cache_no_escape = array();
272 272
 
273 273
 	// --------------------------------------------------------------------
274 274
 
@@ -2666,9 +2666,9 @@  discard block
 block discarded – undo
2666 2666
 
2667 2667
 		foreach (array_unique($this->qb_cache_exists) as $val) // select, from, etc.
2668 2668
 		{
2669
-			$qb_variable	= 'qb_'.$val;
2670
-			$qb_cache_var	= 'qb_cache_'.$val;
2671
-			$qb_new 	= $this->$qb_cache_var;
2669
+			$qb_variable = 'qb_'.$val;
2670
+			$qb_cache_var = 'qb_cache_'.$val;
2671
+			$qb_new = $this->$qb_cache_var;
2672 2672
 
2673 2673
 			for ($i = 0, $c = count($this->$qb_variable); $i < $c; $i++)
2674 2674
 			{
Please login to merge, or discard this patch.
Braces   +30 added lines, -55 removed lines patch added patch discarded remove patch
@@ -488,8 +488,7 @@  discard block
 block discarded – undo
488 488
 						$this->qb_cache_exists[] = 'from';
489 489
 					}
490 490
 				}
491
-			}
492
-			else
491
+			} else
493 492
 			{
494 493
 				$val = trim($val);
495 494
 
@@ -532,8 +531,7 @@  discard block
 block discarded – undo
532 531
 			if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))
533 532
 			{
534 533
 				$type = '';
535
-			}
536
-			else
534
+			} else
537 535
 			{
538 536
 				$type .= ' ';
539 537
 			}
@@ -548,12 +546,10 @@  discard block
 block discarded – undo
548 546
 		if ( ! $this->_has_operator($cond))
549 547
 		{
550 548
 			$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';
551
-		}
552
-		elseif ($escape === FALSE)
549
+		} elseif ($escape === FALSE)
553 550
 		{
554 551
 			$cond = ' ON '.$cond;
555
-		}
556
-		else
552
+		} else
557 553
 		{
558 554
 			// Split multiple conditions
559 555
 			if (preg_match_all('/\sAND\s|\sOR\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))
@@ -569,8 +565,7 @@  discard block
 block discarded – undo
569 565
 					$pos = $joints[$i][1] - strlen($joints[$i][0]);
570 566
 					$joints[$i] = $joints[$i][0];
571 567
 				}
572
-			}
573
-			else
568
+			} else
574 569
 			{
575 570
 				$conditions = array($cond);
576 571
 				$joints = array('');
@@ -687,13 +682,11 @@  discard block
 block discarded – undo
687 682
 				{
688 683
 					$k .= ' = ';
689 684
 				}
690
-			}
691
-			elseif ( ! $this->_has_operator($k))
685
+			} elseif ( ! $this->_has_operator($k))
692 686
 			{
693 687
 				// value appears not to have been set, assign the test to IS NULL
694 688
 				$k .= ' IS NULL';
695
-			}
696
-			elseif (preg_match('/\s*(!?=|<>|\sIS(?:\s+NOT)?\s)\s*$/i', $k, $match, PREG_OFFSET_CAPTURE))
689
+			} elseif (preg_match('/\s*(!?=|<>|\sIS(?:\s+NOT)?\s)\s*$/i', $k, $match, PREG_OFFSET_CAPTURE))
697 690
 			{
698 691
 				$k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL');
699 692
 			}
@@ -822,8 +815,7 @@  discard block
 block discarded – undo
822 815
 			{
823 816
 				$where_in[] = $this->escape($value);
824 817
 			}
825
-		}
826
-		else
818
+		} else
827 819
 		{
828 820
 			$where_in = array_values($values);
829 821
 		}
@@ -965,16 +957,13 @@  discard block
 block discarded – undo
965 957
 			if ($side === 'none')
966 958
 			{
967 959
 				$like_statement = "{$prefix} {$k} {$not} LIKE '{$v}'";
968
-			}
969
-			elseif ($side === 'before')
960
+			} elseif ($side === 'before')
970 961
 			{
971 962
 				$like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}'";
972
-			}
973
-			elseif ($side === 'after')
963
+			} elseif ($side === 'after')
974 964
 			{
975 965
 				$like_statement = "{$prefix} {$k} {$not} LIKE '{$v}%'";
976
-			}
977
-			else
966
+			} else
978 967
 			{
979 968
 				$like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}%'";
980 969
 			}
@@ -1205,12 +1194,10 @@  discard block
 block discarded – undo
1205 1194
 			$orderby = ctype_digit((string) $orderby)
1206 1195
 				? sprintf($this->_random_keyword[1], $orderby)
1207 1196
 				: $this->_random_keyword[0];
1208
-		}
1209
-		elseif (empty($orderby))
1197
+		} elseif (empty($orderby))
1210 1198
 		{
1211 1199
 			return $this;
1212
-		}
1213
-		elseif ($direction !== '')
1200
+		} elseif ($direction !== '')
1214 1201
 		{
1215 1202
 			$direction = in_array($direction, array('ASC', 'DESC'), TRUE) ? ' '.$direction : '';
1216 1203
 		}
@@ -1220,8 +1207,7 @@  discard block
 block discarded – undo
1220 1207
 		if ($escape === FALSE)
1221 1208
 		{
1222 1209
 			$qb_orderby[] = array('field' => $orderby, 'direction' => $direction, 'escape' => FALSE);
1223
-		}
1224
-		else
1210
+		} else
1225 1211
 		{
1226 1212
 			$qb_orderby = array();
1227 1213
 			foreach (explode(',', $orderby) as $field)
@@ -1414,8 +1400,7 @@  discard block
 block discarded – undo
1414 1400
 		if ($reset === TRUE)
1415 1401
 		{
1416 1402
 			$this->_reset_select();
1417
-		}
1418
-		else
1403
+		} else
1419 1404
 		{
1420 1405
 			$this->qb_orderby       = $qb_orderby;
1421 1406
 			$this->qb_cache_orderby = $qb_cache_orderby;
@@ -1485,8 +1470,7 @@  discard block
 block discarded – undo
1485 1470
 			{
1486 1471
 				return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;
1487 1472
 			}
1488
-		}
1489
-		else
1473
+		} else
1490 1474
 		{
1491 1475
 			if (empty($set))
1492 1476
 			{
@@ -1687,8 +1671,7 @@  discard block
 block discarded – undo
1687 1671
 		if ($table !== '')
1688 1672
 		{
1689 1673
 			$this->qb_from[0] = $table;
1690
-		}
1691
-		elseif ( ! isset($this->qb_from[0]))
1674
+		} elseif ( ! isset($this->qb_from[0]))
1692 1675
 		{
1693 1676
 			return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
1694 1677
 		}
@@ -1865,8 +1848,7 @@  discard block
 block discarded – undo
1865 1848
 		if ($table !== '')
1866 1849
 		{
1867 1850
 			$this->qb_from = array($this->protect_identifiers($table, TRUE, NULL, FALSE));
1868
-		}
1869
-		elseif ( ! isset($this->qb_from[0]))
1851
+		} elseif ( ! isset($this->qb_from[0]))
1870 1852
 		{
1871 1853
 			return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
1872 1854
 		}
@@ -1902,8 +1884,7 @@  discard block
 block discarded – undo
1902 1884
 			{
1903 1885
 				return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;
1904 1886
 			}
1905
-		}
1906
-		else
1887
+		} else
1907 1888
 		{
1908 1889
 			if (empty($set))
1909 1890
 			{
@@ -2049,8 +2030,7 @@  discard block
 block discarded – undo
2049 2030
 			}
2050 2031
 
2051 2032
 			$table = $this->qb_from[0];
2052
-		}
2053
-		else
2033
+		} else
2054 2034
 		{
2055 2035
 			$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);
2056 2036
 		}
@@ -2082,8 +2062,7 @@  discard block
 block discarded – undo
2082 2062
 			}
2083 2063
 
2084 2064
 			$table = $this->qb_from[0];
2085
-		}
2086
-		else
2065
+		} else
2087 2066
 		{
2088 2067
 			$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);
2089 2068
 		}
@@ -2156,8 +2135,7 @@  discard block
 block discarded – undo
2156 2135
 			}
2157 2136
 
2158 2137
 			$table = $this->qb_from[0];
2159
-		}
2160
-		elseif (is_array($table))
2138
+		} elseif (is_array($table))
2161 2139
 		{
2162 2140
 			empty($where) && $reset_data = FALSE;
2163 2141
 
@@ -2167,8 +2145,7 @@  discard block
 block discarded – undo
2167 2145
 			}
2168 2146
 
2169 2147
 			return;
2170
-		}
2171
-		else
2148
+		} else
2172 2149
 		{
2173 2150
 			$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);
2174 2151
 		}
@@ -2318,16 +2295,14 @@  discard block
 block discarded – undo
2318 2295
 		if ($select_override !== FALSE)
2319 2296
 		{
2320 2297
 			$sql = $select_override;
2321
-		}
2322
-		else
2298
+		} else
2323 2299
 		{
2324 2300
 			$sql = ( ! $this->qb_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';
2325 2301
 
2326 2302
 			if (count($this->qb_select) === 0)
2327 2303
 			{
2328 2304
 				$sql .= '*';
2329
-			}
2330
-			else
2305
+			} else
2331 2306
 			{
2332 2307
 				// Cycle through the "select" portion of the query and prep each column name.
2333 2308
 				// The reason we protect identifiers here rather than in the select() function
@@ -2392,8 +2367,7 @@  discard block
 block discarded – undo
2392 2367
 				if (is_string($this->{$qb_key}[$i]))
2393 2368
 				{
2394 2369
 					continue;
2395
-				}
2396
-				elseif ($this->{$qb_key}[$i]['escape'] === FALSE)
2370
+				} elseif ($this->{$qb_key}[$i]['escape'] === FALSE)
2397 2371
 				{
2398 2372
 					$this->{$qb_key}[$i] = $this->{$qb_key}[$i]['condition'];
2399 2373
 					continue;
@@ -2658,15 +2632,16 @@  discard block
 block discarded – undo
2658 2632
 		if (count($this->qb_cache_exists) === 0)
2659 2633
 		{
2660 2634
 			return;
2661
-		}
2662
-		elseif (in_array('select', $this->qb_cache_exists, TRUE))
2635
+		} elseif (in_array('select', $this->qb_cache_exists, TRUE))
2663 2636
 		{
2664 2637
 			$qb_no_escape = $this->qb_cache_no_escape;
2665 2638
 		}
2666 2639
 
2667
-		foreach (array_unique($this->qb_cache_exists) as $val) // select, from, etc.
2640
+		foreach (array_unique($this->qb_cache_exists) as $val) {
2641
+			// select, from, etc.
2668 2642
 		{
2669 2643
 			$qb_variable	= 'qb_'.$val;
2644
+		}
2670 2645
 			$qb_cache_var	= 'qb_cache_'.$val;
2671 2646
 			$qb_new 	= $this->$qb_cache_var;
2672 2647
 
Please login to merge, or discard this patch.