@@ -206,8 +206,7 @@ |
||
206 | 206 | if (stripos($field['type'], 'int') !== FALSE) |
207 | 207 | { |
208 | 208 | $field['auto_increment'] = ' AUTO_INCREMENT'; |
209 | - } |
|
210 | - elseif (strcasecmp($field['type'], 'UUID') === 0) |
|
209 | + } elseif (strcasecmp($field['type'], 'UUID') === 0) |
|
211 | 210 | { |
212 | 211 | $field['auto_increment'] = ' AUTO_GENERATE'; |
213 | 212 | } |
@@ -116,8 +116,7 @@ discard block |
||
116 | 116 | if ($field[$i]['_literal'] !== FALSE) |
117 | 117 | { |
118 | 118 | $sqls[] = $sql.' CHANGE '.$field[$i]['_literal']; |
119 | - } |
|
120 | - else |
|
119 | + } else |
|
121 | 120 | { |
122 | 121 | $alter_type = empty($field[$i]['new_name']) ? ' MODIFY ' : ' CHANGE '; |
123 | 122 | $sqls[] = $sql.$alter_type.$this->_process_column($field[$i]); |
@@ -206,8 +205,7 @@ discard block |
||
206 | 205 | continue; |
207 | 206 | } |
208 | 207 | } |
209 | - } |
|
210 | - elseif ( ! isset($this->fields[$this->keys[$i]])) |
|
208 | + } elseif ( ! isset($this->fields[$this->keys[$i]])) |
|
211 | 209 | { |
212 | 210 | unset($this->keys[$i]); |
213 | 211 | continue; |
@@ -104,8 +104,7 @@ discard block |
||
104 | 104 | empty($this->database) OR $this->dsn .= ';dbname='.$this->database; |
105 | 105 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
106 | 106 | empty($this->appname) OR $this->dsn .= ';appname='.$this->appname; |
107 | - } |
|
108 | - else |
|
107 | + } else |
|
109 | 108 | { |
110 | 109 | if ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE) |
111 | 110 | { |
@@ -282,8 +281,7 @@ discard block |
||
282 | 281 | if (count($this->qb_select) === 0) |
283 | 282 | { |
284 | 283 | $select = '*'; // Inevitable |
285 | - } |
|
286 | - else |
|
284 | + } else |
|
287 | 285 | { |
288 | 286 | // Use only field names and their aliases, everything else is out of our scope. |
289 | 287 | $select = array(); |
@@ -89,16 +89,14 @@ discard block |
||
89 | 89 | if ( ! empty($this->database)) |
90 | 90 | { |
91 | 91 | $this->dsn .= 'dbname='.$this->database; |
92 | - } |
|
93 | - elseif ( ! empty($this->hostname)) |
|
92 | + } elseif ( ! empty($this->hostname)) |
|
94 | 93 | { |
95 | 94 | $this->dsn .= 'dbname='.$this->hostname; |
96 | 95 | } |
97 | 96 | |
98 | 97 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
99 | 98 | empty($this->role) OR $this->dsn .= ';role='.$this->role; |
100 | - } |
|
101 | - elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 9) === FALSE) |
|
99 | + } elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 9) === FALSE) |
|
102 | 100 | { |
103 | 101 | $this->dsn .= ';charset='.$this->char_set; |
104 | 102 | } |
@@ -250,8 +248,7 @@ discard block |
||
250 | 248 | { |
251 | 249 | $select = 'FIRST '.$this->qb_limit |
252 | 250 | .($this->qb_offset > 0 ? ' SKIP '.$this->qb_offset : ''); |
253 | - } |
|
254 | - else |
|
251 | + } else |
|
255 | 252 | { |
256 | 253 | $select = 'ROWS ' |
257 | 254 | .($this->qb_offset > 0 ? $this->qb_offset.' TO '.($this->qb_limit + $this->qb_offset) : $this->qb_limit); |
@@ -92,8 +92,7 @@ discard block |
||
92 | 92 | if (isset($this->DSN)) |
93 | 93 | { |
94 | 94 | $this->dsn .= 'DSN='.$this->DSN; |
95 | - } |
|
96 | - elseif ( ! empty($this->database)) |
|
95 | + } elseif ( ! empty($this->database)) |
|
97 | 96 | { |
98 | 97 | $this->dsn .= 'DSN='.$this->database; |
99 | 98 | } |
@@ -104,8 +103,7 @@ discard block |
||
104 | 103 | if (isset($this->host)) |
105 | 104 | { |
106 | 105 | $this->dsn .= 'host='.$this->host; |
107 | - } |
|
108 | - else |
|
106 | + } else |
|
109 | 107 | { |
110 | 108 | $this->dsn .= 'host='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); |
111 | 109 | } |
@@ -113,8 +111,7 @@ discard block |
||
113 | 111 | if (isset($this->service)) |
114 | 112 | { |
115 | 113 | $this->dsn .= '; service='.$this->service; |
116 | - } |
|
117 | - elseif ( ! empty($this->port)) |
|
114 | + } elseif ( ! empty($this->port)) |
|
118 | 115 | { |
119 | 116 | $this->dsn .= '; service='.$this->port; |
120 | 117 | } |
@@ -166,8 +163,7 @@ discard block |
||
166 | 163 | if (strpos($table, '.') !== FALSE) |
167 | 164 | { |
168 | 165 | sscanf($table, '%[^.].%s', $owner, $table); |
169 | - } |
|
170 | - else |
|
166 | + } else |
|
171 | 167 | { |
172 | 168 | $owner = $this->username; |
173 | 169 | } |
@@ -105,8 +105,7 @@ discard block |
||
105 | 105 | empty($this->port) OR $this->dsn .= ';port='.$this->port; |
106 | 106 | empty($this->database) OR $this->dsn .= ';dbname='.$this->database; |
107 | 107 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
108 | - } |
|
109 | - elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE && is_php('5.3.6')) |
|
108 | + } elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE && is_php('5.3.6')) |
|
110 | 109 | { |
111 | 110 | $this->dsn .= ';charset='.$this->char_set; |
112 | 111 | } |
@@ -138,8 +137,7 @@ discard block |
||
138 | 137 | if (empty($this->options[PDO::MYSQL_ATTR_INIT_COMMAND])) |
139 | 138 | { |
140 | 139 | $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET SESSION sql_mode="STRICT_ALL_TABLES"'; |
141 | - } |
|
142 | - else |
|
140 | + } else |
|
143 | 141 | { |
144 | 142 | $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] .= ', @@session.sql_mode = "STRICT_ALL_TABLES"'; |
145 | 143 | } |
@@ -162,14 +162,12 @@ discard block |
||
162 | 162 | $field[$i] = ($alter_type === 'ADD') |
163 | 163 | ? "\n\tADD ".$field[$i]['_literal'] |
164 | 164 | : "\n\tMODIFY ".$field[$i]['_literal']; |
165 | - } |
|
166 | - else |
|
165 | + } else |
|
167 | 166 | { |
168 | 167 | if ($alter_type === 'ADD') |
169 | 168 | { |
170 | 169 | $field[$i]['_literal'] = "\n\tADD "; |
171 | - } |
|
172 | - else |
|
170 | + } else |
|
173 | 171 | { |
174 | 172 | $field[$i]['_literal'] = empty($field[$i]['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE "; |
175 | 173 | } |
@@ -235,8 +233,7 @@ discard block |
||
235 | 233 | continue; |
236 | 234 | } |
237 | 235 | } |
238 | - } |
|
239 | - elseif ( ! isset($this->fields[$this->keys[$i]])) |
|
236 | + } elseif ( ! isset($this->fields[$this->keys[$i]])) |
|
240 | 237 | { |
241 | 238 | unset($this->keys[$i]); |
242 | 239 | continue; |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | if (empty($this->hostname) && empty($this->port)) |
111 | 111 | { |
112 | 112 | $this->dsn .= $this->database; |
113 | - } |
|
114 | - else |
|
113 | + } else |
|
115 | 114 | { |
116 | 115 | $this->dsn .= '//'.(empty($this->hostname) ? '127.0.0.1' : $this->hostname) |
117 | 116 | .(empty($this->port) ? '' : ':'.$this->port).'/'; |
@@ -120,8 +119,7 @@ discard block |
||
120 | 119 | } |
121 | 120 | |
122 | 121 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
123 | - } |
|
124 | - elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 4) === FALSE) |
|
122 | + } elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 4) === FALSE) |
|
125 | 123 | { |
126 | 124 | $this->dsn .= ';charset='.$this->char_set; |
127 | 125 | } |
@@ -165,8 +163,7 @@ discard block |
||
165 | 163 | if (strpos($table, '.') !== FALSE) |
166 | 164 | { |
167 | 165 | sscanf($table, '%[^.].%s', $owner, $table); |
168 | - } |
|
169 | - else |
|
166 | + } else |
|
170 | 167 | { |
171 | 168 | $owner = $this->username; |
172 | 169 | } |
@@ -189,8 +186,7 @@ discard block |
||
189 | 186 | if (strpos($table, '.') !== FALSE) |
190 | 187 | { |
191 | 188 | sscanf($table, '%[^.].%s', $owner, $table); |
192 | - } |
|
193 | - else |
|
189 | + } else |
|
194 | 190 | { |
195 | 191 | $owner = $this->username; |
196 | 192 | } |
@@ -89,8 +89,7 @@ discard block |
||
89 | 89 | if ($alter_type === 'DROP') |
90 | 90 | { |
91 | 91 | return parent::_alter_table($alter_type, $table, $field); |
92 | - } |
|
93 | - elseif ($alter_type === 'CHANGE') |
|
92 | + } elseif ($alter_type === 'CHANGE') |
|
94 | 93 | { |
95 | 94 | $alter_type = 'MODIFY'; |
96 | 95 | } |
@@ -102,8 +101,7 @@ discard block |
||
102 | 101 | if ($field[$i]['_literal'] !== FALSE) |
103 | 102 | { |
104 | 103 | $field[$i] = "\n\t".$field[$i]['_literal']; |
105 | - } |
|
106 | - else |
|
104 | + } else |
|
107 | 105 | { |
108 | 106 | $field[$i]['_literal'] = "\n\t".$this->_process_column($field[$i]); |
109 | 107 |