@@ -431,7 +431,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -613,8 +613,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |