@@ -132,12 +132,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -103,8 +103,7 @@ discard block |
||
| 103 | 103 | if (isset($this->db->data_cache['db_names'])) |
| 104 | 104 | { |
| 105 | 105 | return $this->db->data_cache['db_names']; |
| 106 | - } |
|
| 107 | - elseif ($this->_list_databases === FALSE) |
|
| 106 | + } elseif ($this->_list_databases === FALSE) |
|
| 108 | 107 | { |
| 109 | 108 | return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; |
| 110 | 109 | } |
@@ -387,8 +386,7 @@ discard block |
||
| 387 | 386 | { |
| 388 | 387 | $prefs['filename'] = (count($prefs['tables']) === 1 ? $prefs['tables'] : $this->db->database) |
| 389 | 388 | .date('Y-m-d_H-i', time()).'.sql'; |
| 390 | - } |
|
| 391 | - else |
|
| 389 | + } else |
|
| 392 | 390 | { |
| 393 | 391 | // If they included the .zip file extension we'll remove it |
| 394 | 392 | if (preg_match('|.+?\.zip$|', $prefs['filename'])) |
@@ -408,15 +406,17 @@ discard block |
||
| 408 | 406 | $CI->load->library('zip'); |
| 409 | 407 | $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); |
| 410 | 408 | return $CI->zip->get_zip(); |
| 411 | - } |
|
| 412 | - elseif ($prefs['format'] === 'txt') // Was a text file requested? |
|
| 409 | + } elseif ($prefs['format'] === 'txt') { |
|
| 410 | + // Was a text file requested? |
|
| 413 | 411 | { |
| 414 | 412 | return $this->_backup($prefs); |
| 415 | 413 | } |
| 416 | - elseif ($prefs['format'] === 'gzip') // Was a Gzip file requested? |
|
| 414 | + } elseif ($prefs['format'] === 'gzip') { |
|
| 415 | + // Was a Gzip file requested? |
|
| 417 | 416 | { |
| 418 | 417 | return gzencode($this->_backup($prefs)); |
| 419 | 418 | } |
| 419 | + } |
|
| 420 | 420 | |
| 421 | 421 | return; |
| 422 | 422 | } |
@@ -100,8 +100,7 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $this->auto_commit = FALSE; |
| 102 | 102 | } |
| 103 | - } |
|
| 104 | - else |
|
| 103 | + } else |
|
| 105 | 104 | { |
| 106 | 105 | // If no port is defined by the user, use the default value |
| 107 | 106 | empty($this->port) OR $this->port = 33000; |
@@ -194,8 +193,7 @@ discard block |
||
| 194 | 193 | if (($autocommit = cubrid_get_autocommit($this->conn_id)) === NULL) |
| 195 | 194 | { |
| 196 | 195 | return FALSE; |
| 197 | - } |
|
| 198 | - elseif ($autocommit === TRUE) |
|
| 196 | + } elseif ($autocommit === TRUE) |
|
| 199 | 197 | { |
| 200 | 198 | return cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_FALSE); |
| 201 | 199 | } |
@@ -179,8 +179,7 @@ |
||
| 179 | 179 | if ($v === NULL) |
| 180 | 180 | { |
| 181 | 181 | $val_str .= 'NULL'; |
| 182 | - } |
|
| 183 | - else |
|
| 182 | + } else |
|
| 184 | 183 | { |
| 185 | 184 | // Escape the data if it's not an integer |
| 186 | 185 | $val_str .= ($is_int[$i] === FALSE) ? $this->db->escape($v) : $v; |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | if (is_int($this->num_rows)) |
| 61 | 61 | { |
| 62 | 62 | return $this->num_rows; |
| 63 | - } |
|
| 64 | - elseif (($this->num_rows = odbc_num_rows($this->result_id)) !== -1) |
|
| 63 | + } elseif (($this->num_rows = odbc_num_rows($this->result_id)) !== -1) |
|
| 65 | 64 | { |
| 66 | 65 | return $this->num_rows; |
| 67 | 66 | } |
@@ -70,8 +69,7 @@ discard block |
||
| 70 | 69 | if (count($this->result_array) > 0) |
| 71 | 70 | { |
| 72 | 71 | return $this->num_rows = count($this->result_array); |
| 73 | - } |
|
| 74 | - elseif (count($this->result_object) > 0) |
|
| 72 | + } elseif (count($this->result_object) > 0) |
|
| 75 | 73 | { |
| 76 | 74 | return $this->num_rows = count($this->result_object); |
| 77 | 75 | } |
@@ -94,16 +94,13 @@ discard block |
||
| 94 | 94 | $this->hostname = NULL; |
| 95 | 95 | $this->subdriver = $match[1]; |
| 96 | 96 | return; |
| 97 | - } |
|
| 98 | - elseif (in_array($this->subdriver, array('mssql', 'sybase'), TRUE)) |
|
| 97 | + } elseif (in_array($this->subdriver, array('mssql', 'sybase'), TRUE)) |
|
| 99 | 98 | { |
| 100 | 99 | $this->subdriver = 'dblib'; |
| 101 | - } |
|
| 102 | - elseif ($this->subdriver === '4D') |
|
| 100 | + } elseif ($this->subdriver === '4D') |
|
| 103 | 101 | { |
| 104 | 102 | $this->subdriver = '4d'; |
| 105 | - } |
|
| 106 | - elseif ( ! in_array($this->subdriver, array('4d', 'cubrid', 'dblib', 'firebird', 'ibm', 'informix', 'mysql', 'oci', 'odbc', 'pgsql', 'sqlite', 'sqlsrv'), TRUE)) |
|
| 103 | + } elseif ( ! in_array($this->subdriver, array('4d', 'cubrid', 'dblib', 'firebird', 'ibm', 'informix', 'mysql', 'oci', 'odbc', 'pgsql', 'sqlite', 'sqlsrv'), TRUE)) |
|
| 107 | 104 | { |
| 108 | 105 | log_message('error', 'PDO: Invalid or non-existent subdriver'); |
| 109 | 106 | |
@@ -131,8 +128,7 @@ discard block |
||
| 131 | 128 | try |
| 132 | 129 | { |
| 133 | 130 | return new PDO($this->dsn, $this->username, $this->password, $this->options); |
| 134 | - } |
|
| 135 | - catch (PDOException $e) |
|
| 131 | + } catch (PDOException $e) |
|
| 136 | 132 | { |
| 137 | 133 | if ($this->db_debug && empty($this->failover)) |
| 138 | 134 | { |
@@ -161,8 +157,7 @@ discard block |
||
| 161 | 157 | try |
| 162 | 158 | { |
| 163 | 159 | return $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION); |
| 164 | - } |
|
| 165 | - catch (PDOException $e) |
|
| 160 | + } catch (PDOException $e) |
|
| 166 | 161 | { |
| 167 | 162 | return parent::version(); |
| 168 | 163 | } |
@@ -60,16 +60,13 @@ discard block |
||
| 60 | 60 | if (is_int($this->num_rows)) |
| 61 | 61 | { |
| 62 | 62 | return $this->num_rows; |
| 63 | - } |
|
| 64 | - elseif (count($this->result_array) > 0) |
|
| 63 | + } elseif (count($this->result_array) > 0) |
|
| 65 | 64 | { |
| 66 | 65 | return $this->num_rows = count($this->result_array); |
| 67 | - } |
|
| 68 | - elseif (count($this->result_object) > 0) |
|
| 66 | + } elseif (count($this->result_object) > 0) |
|
| 69 | 67 | { |
| 70 | 68 | return $this->num_rows = count($this->result_object); |
| 71 | - } |
|
| 72 | - elseif (($num_rows = $this->result_id->rowCount()) > 0) |
|
| 69 | + } elseif (($num_rows = $this->result_id->rowCount()) > 0) |
|
| 73 | 70 | { |
| 74 | 71 | return $this->num_rows = $num_rows; |
| 75 | 72 | } |
@@ -139,8 +136,7 @@ discard block |
||
| 139 | 136 | } |
| 140 | 137 | |
| 141 | 138 | return $retval; |
| 142 | - } |
|
| 143 | - catch (Exception $e) |
|
| 139 | + } catch (Exception $e) |
|
| 144 | 140 | { |
| 145 | 141 | if ($this->db->db_debug) |
| 146 | 142 | { |
@@ -87,8 +87,7 @@ |
||
| 87 | 87 | empty($this->port) OR $this->dsn .= ';port='.$this->port; |
| 88 | 88 | empty($this->database) OR $this->dsn .= ';dbname='.$this->database; |
| 89 | 89 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
| 90 | - } |
|
| 91 | - elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 3) === FALSE) |
|
| 90 | + } elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 3) === FALSE) |
|
| 92 | 91 | { |
| 93 | 92 | $this->dsn .= ';charset='.$this->char_set; |
| 94 | 93 | } |
@@ -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 | } |