@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * Select the database |
| 120 | 120 | * |
| 121 | 121 | * @access private called by the base class |
| 122 | - * @return resource |
|
| 122 | + * @return boolean |
|
| 123 | 123 | */ |
| 124 | 124 | function db_select() |
| 125 | 125 | { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @access public |
| 135 | 135 | * @param string |
| 136 | 136 | * @param string |
| 137 | - * @return resource |
|
| 137 | + * @return boolean |
|
| 138 | 138 | */ |
| 139 | 139 | function db_set_charset($charset, $collation) |
| 140 | 140 | { |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | * |
| 338 | 338 | * @access public |
| 339 | 339 | * @param string |
| 340 | - * @return string |
|
| 340 | + * @return integer |
|
| 341 | 341 | */ |
| 342 | 342 | function count_all($table = '') |
| 343 | 343 | { |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | * |
| 390 | 390 | * @access public |
| 391 | 391 | * @param string the table name |
| 392 | - * @return string |
|
| 392 | + * @return boolean |
|
| 393 | 393 | */ |
| 394 | 394 | function _list_columns($table = '') |
| 395 | 395 | { |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | * |
| 407 | 407 | * @access public |
| 408 | 408 | * @param string the table name |
| 409 | - * @return object |
|
| 409 | + * @return string |
|
| 410 | 410 | */ |
| 411 | 411 | function _field_data($table) |
| 412 | 412 | { |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | * |
| 492 | 492 | * @access public |
| 493 | 493 | * @param type |
| 494 | - * @return type |
|
| 494 | + * @return string |
|
| 495 | 495 | */ |
| 496 | 496 | function _from_tables($tables) |
| 497 | 497 | { |
@@ -293,7 +293,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * CodeIgniter |
| 4 | 6 | * |
@@ -471,8 +473,7 @@ discard block |
||
| 471 | 473 | if (strpos($item, '.') !== FALSE) |
| 472 | 474 | { |
| 473 | 475 | $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; |
| 474 | - } |
|
| 475 | - else |
|
| 476 | + } else |
|
| 476 | 477 | { |
| 477 | 478 | $str = $this->_escape_char.$item.$this->_escape_char; |
| 478 | 479 | } |
@@ -627,8 +628,7 @@ discard block |
||
| 627 | 628 | if ($offset == 0) |
| 628 | 629 | { |
| 629 | 630 | $offset = ''; |
| 630 | - } |
|
| 631 | - else |
|
| 631 | + } else |
|
| 632 | 632 | { |
| 633 | 633 | $offset .= ", "; |
| 634 | 634 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @param mixed primary key(s) |
| 71 | 71 | * @param mixed key(s) |
| 72 | 72 | * @param boolean should 'IF NOT EXISTS' be added to the SQL |
| 73 | - * @return bool |
|
| 73 | + * @return string |
|
| 74 | 74 | */ |
| 75 | 75 | function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) |
| 76 | 76 | { |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | * @param string the default value |
| 203 | 203 | * @param boolean should 'NOT NULL' be added |
| 204 | 204 | * @param string the field after which we should add the new field |
| 205 | - * @return object |
|
| 205 | + * @return false|string |
|
| 206 | 206 | */ |
| 207 | 207 | function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') |
| 208 | 208 | { |
@@ -100,7 +100,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * CodeIgniter |
| 4 | 6 | * |
@@ -96,8 +98,7 @@ discard block |
||
| 96 | 98 | if (is_numeric($field)) |
| 97 | 99 | { |
| 98 | 100 | $sql .= "\n\t$attributes"; |
| 99 | - } |
|
| 100 | - else |
|
| 101 | + } else |
|
| 101 | 102 | { |
| 102 | 103 | $attributes = array_change_key_case($attributes, CASE_UPPER); |
| 103 | 104 | |
@@ -123,8 +124,7 @@ discard block |
||
| 123 | 124 | if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) |
| 124 | 125 | { |
| 125 | 126 | $sql .= ' NULL'; |
| 126 | - } |
|
| 127 | - else |
|
| 127 | + } else |
|
| 128 | 128 | { |
| 129 | 129 | $sql .= ' NOT NULL'; |
| 130 | 130 | } |
@@ -155,8 +155,7 @@ discard block |
||
| 155 | 155 | if (is_array($key)) |
| 156 | 156 | { |
| 157 | 157 | $key = $this->db->_protect_identifiers($key); |
| 158 | - } |
|
| 159 | - else |
|
| 158 | + } else |
|
| 160 | 159 | { |
| 161 | 160 | $key = array($this->db->_protect_identifiers($key)); |
| 162 | 161 | } |
@@ -208,8 +207,7 @@ discard block |
||
| 208 | 207 | if ($null === NULL) |
| 209 | 208 | { |
| 210 | 209 | $sql .= ' NULL'; |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $sql .= ' NOT NULL'; |
| 215 | 213 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | * result set starts at zero |
| 122 | 122 | * |
| 123 | 123 | * @access private |
| 124 | - * @return array |
|
| 124 | + * @return boolean |
|
| 125 | 125 | */ |
| 126 | 126 | function _data_seek($n = 0) |
| 127 | 127 | { |
@@ -86,12 +86,12 @@ discard block |
||
| 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 |
||
| 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; |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | // ------------------------------------------------------------------------ |
| 4 | 6 | |
@@ -59,8 +61,7 @@ discard block |
||
| 59 | 61 | if ($download == "") |
| 60 | 62 | { |
| 61 | 63 | return $str; |
| 62 | - } |
|
| 63 | - else |
|
| 64 | + } else |
|
| 64 | 65 | { |
| 65 | 66 | echo $str; |
| 66 | 67 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @access private |
| 55 | 55 | * @param string the table name |
| 56 | - * @return object |
|
| 56 | + * @return boolean |
|
| 57 | 57 | */ |
| 58 | 58 | function _optimize_table($table) |
| 59 | 59 | { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @access private |
| 71 | 71 | * @param string the table name |
| 72 | - * @return object |
|
| 72 | + * @return boolean |
|
| 73 | 73 | */ |
| 74 | 74 | function _repair_table($table) |
| 75 | 75 | { |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /* |
| 3 | 5 | | ------------------------------------------------------------------- |
| 4 | 6 | | AUTO-LOADER |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @access public |
| 127 | 127 | * @param string |
| 128 | 128 | * @param string |
| 129 | - * @return resource |
|
| 129 | + * @return boolean |
|
| 130 | 130 | */ |
| 131 | 131 | function db_set_charset($charset, $collation) |
| 132 | 132 | { |
@@ -141,6 +141,7 @@ discard block |
||
| 141 | 141 | * |
| 142 | 142 | * @access private called by the base class |
| 143 | 143 | * @param string an SQL query |
| 144 | + * @param string $sql |
|
| 144 | 145 | * @return resource |
| 145 | 146 | */ |
| 146 | 147 | function _execute($sql) |
@@ -299,7 +300,7 @@ discard block |
||
| 299 | 300 | * |
| 300 | 301 | * @access private |
| 301 | 302 | * @param string $version |
| 302 | - * @return int16 major version number |
|
| 303 | + * @return string major version number |
|
| 303 | 304 | */ |
| 304 | 305 | function _parse_major_version($version) |
| 305 | 306 | { |
@@ -389,7 +390,7 @@ discard block |
||
| 389 | 390 | * |
| 390 | 391 | * @access public |
| 391 | 392 | * @param string the table name |
| 392 | - * @return object |
|
| 393 | + * @return string |
|
| 393 | 394 | */ |
| 394 | 395 | function _field_data($table) |
| 395 | 396 | { |
@@ -466,7 +467,7 @@ discard block |
||
| 466 | 467 | * |
| 467 | 468 | * @access public |
| 468 | 469 | * @param type |
| 469 | - * @return type |
|
| 470 | + * @return string |
|
| 470 | 471 | */ |
| 471 | 472 | function _from_tables($tables) |
| 472 | 473 | { |
@@ -277,13 +277,13 @@ discard block |
||
| 277 | 277 | // -------------------------------------------------------------------- |
| 278 | 278 | |
| 279 | 279 | /** |
| 280 | - * Insert ID |
|
| 281 | - * |
|
| 282 | - * Returns the last id created in the Identity column. |
|
| 283 | - * |
|
| 284 | - * @access public |
|
| 285 | - * @return integer |
|
| 286 | - */ |
|
| 280 | + * Insert ID |
|
| 281 | + * |
|
| 282 | + * Returns the last id created in the Identity column. |
|
| 283 | + * |
|
| 284 | + * @access public |
|
| 285 | + * @return integer |
|
| 286 | + */ |
|
| 287 | 287 | function insert_id() |
| 288 | 288 | { |
| 289 | 289 | return $this->query('select @@IDENTITY as insert_id')->row('insert_id'); |
@@ -292,15 +292,15 @@ discard block |
||
| 292 | 292 | // -------------------------------------------------------------------- |
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | - * Parse major version |
|
| 296 | - * |
|
| 297 | - * Grabs the major version number from the |
|
| 298 | - * database server version string passed in. |
|
| 299 | - * |
|
| 300 | - * @access private |
|
| 301 | - * @param string $version |
|
| 302 | - * @return int16 major version number |
|
| 303 | - */ |
|
| 295 | + * Parse major version |
|
| 296 | + * |
|
| 297 | + * Grabs the major version number from the |
|
| 298 | + * database server version string passed in. |
|
| 299 | + * |
|
| 300 | + * @access private |
|
| 301 | + * @param string $version |
|
| 302 | + * @return int16 major version number |
|
| 303 | + */ |
|
| 304 | 304 | function _parse_major_version($version) |
| 305 | 305 | { |
| 306 | 306 | preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); |
@@ -310,11 +310,11 @@ discard block |
||
| 310 | 310 | // -------------------------------------------------------------------- |
| 311 | 311 | |
| 312 | 312 | /** |
| 313 | - * Version number query string |
|
| 314 | - * |
|
| 315 | - * @access public |
|
| 316 | - * @return string |
|
| 317 | - */ |
|
| 313 | + * Version number query string |
|
| 314 | + * |
|
| 315 | + * @access public |
|
| 316 | + * @return string |
|
| 317 | + */ |
|
| 318 | 318 | function _version() |
| 319 | 319 | { |
| 320 | 320 | $info = sqlsrv_server_info($this->conn_id); |
@@ -69,7 +69,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | // -------------------------------------------------------------------- |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * CodeIgniter |
| 4 | 6 | * |
@@ -335,13 +337,15 @@ discard block |
||
| 335 | 337 | */ |
| 336 | 338 | function count_all($table = '') |
| 337 | 339 | { |
| 338 | - if ($table == '') |
|
| 339 | - return '0'; |
|
| 340 | + if ($table == '') { |
|
| 341 | + return '0'; |
|
| 342 | + } |
|
| 340 | 343 | |
| 341 | 344 | $query = $this->query("SELECT COUNT(*) AS numrows FROM " . $this->dbprefix . $table); |
| 342 | 345 | |
| 343 | - if ($query->num_rows() == 0) |
|
| 344 | - return '0'; |
|
| 346 | + if ($query->num_rows() == 0) { |
|
| 347 | + return '0'; |
|
| 348 | + } |
|
| 345 | 349 | |
| 346 | 350 | $row = $query->row(); |
| 347 | 351 | $this->_reset_select(); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @access private |
| 31 | 31 | * @param string the database name |
| 32 | - * @return bool |
|
| 32 | + * @return string |
|
| 33 | 33 | */ |
| 34 | 34 | function _create_database($name) |
| 35 | 35 | { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @access private |
| 45 | 45 | * @param string the database name |
| 46 | - * @return bool |
|
| 46 | + * @return string |
|
| 47 | 47 | */ |
| 48 | 48 | function _drop_database($name) |
| 49 | 49 | { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * Drop Table |
| 57 | 57 | * |
| 58 | 58 | * @access private |
| 59 | - * @return bool |
|
| 59 | + * @return string |
|
| 60 | 60 | */ |
| 61 | 61 | function _drop_table($table) |
| 62 | 62 | { |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param mixed primary key(s) |
| 75 | 75 | * @param mixed key(s) |
| 76 | 76 | * @param boolean should 'IF NOT EXISTS' be added to the SQL |
| 77 | - * @return bool |
|
| 77 | + * @return string |
|
| 78 | 78 | */ |
| 79 | 79 | function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) |
| 80 | 80 | { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * @param string the default value |
| 187 | 187 | * @param boolean should 'NOT NULL' be added |
| 188 | 188 | * @param string the field after which we should add the new field |
| 189 | - * @return object |
|
| 189 | + * @return string |
|
| 190 | 190 | */ |
| 191 | 191 | function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') |
| 192 | 192 | { |
@@ -103,7 +103,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * CodeIgniter |
| 4 | 6 | * |
@@ -96,8 +98,7 @@ discard block |
||
| 96 | 98 | if (is_numeric($field)) |
| 97 | 99 | { |
| 98 | 100 | $sql .= "\n\t$attributes"; |
| 99 | - } |
|
| 100 | - else |
|
| 101 | + } else |
|
| 101 | 102 | { |
| 102 | 103 | $attributes = array_change_key_case($attributes, CASE_UPPER); |
| 103 | 104 | |
@@ -123,8 +124,7 @@ discard block |
||
| 123 | 124 | if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) |
| 124 | 125 | { |
| 125 | 126 | $sql .= ' NULL'; |
| 126 | - } |
|
| 127 | - else |
|
| 127 | + } else |
|
| 128 | 128 | { |
| 129 | 129 | $sql .= ' NOT NULL'; |
| 130 | 130 | } |
@@ -155,8 +155,7 @@ discard block |
||
| 155 | 155 | if (is_array($key)) |
| 156 | 156 | { |
| 157 | 157 | $key = $this->db->_protect_identifiers($key); |
| 158 | - } |
|
| 159 | - else |
|
| 158 | + } else |
|
| 160 | 159 | { |
| 161 | 160 | $key = array($this->db->_protect_identifiers($key)); |
| 162 | 161 | } |
@@ -208,8 +207,7 @@ discard block |
||
| 208 | 207 | if ($null === NULL) |
| 209 | 208 | { |
| 210 | 209 | $sql .= ' NULL'; |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $sql .= ' NOT NULL'; |
| 215 | 213 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * List databases |
| 29 | 29 | * |
| 30 | 30 | * @access private |
| 31 | - * @return bool |
|
| 31 | + * @return string |
|
| 32 | 32 | */ |
| 33 | 33 | function _list_databases() |
| 34 | 34 | { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @access private |
| 46 | 46 | * @param string the table name |
| 47 | - * @return object |
|
| 47 | + * @return boolean |
|
| 48 | 48 | */ |
| 49 | 49 | function _optimize_table($table) |
| 50 | 50 | { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @access private |
| 62 | 62 | * @param string the table name |
| 63 | - * @return object |
|
| 63 | + * @return boolean |
|
| 64 | 64 | */ |
| 65 | 65 | function _repair_table($table) |
| 66 | 66 | { |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /* |
| 3 | 5 | | ------------------------------------------------------------------- |
| 4 | 6 | | AUTO-LOADER |
@@ -38,6 +38,9 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | if ( ! function_exists('read_file')) |
| 40 | 40 | { |
| 41 | + /** |
|
| 42 | + * @param string $file |
|
| 43 | + */ |
|
| 41 | 44 | function read_file($file) |
| 42 | 45 | { |
| 43 | 46 | if ( ! file_exists($file)) |
@@ -85,6 +88,10 @@ discard block |
||
| 85 | 88 | */ |
| 86 | 89 | if ( ! function_exists('write_file')) |
| 87 | 90 | { |
| 91 | + /** |
|
| 92 | + * @param string $path |
|
| 93 | + * @param string $data |
|
| 94 | + */ |
|
| 88 | 95 | function write_file($path, $data, $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE) |
| 89 | 96 | { |
| 90 | 97 | if ( ! $fp = @fopen($path, $mode)) |
@@ -278,6 +285,9 @@ discard block |
||
| 278 | 285 | */ |
| 279 | 286 | if ( ! function_exists('get_file_info')) |
| 280 | 287 | { |
| 288 | + /** |
|
| 289 | + * @param string $file |
|
| 290 | + */ |
|
| 281 | 291 | function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) |
| 282 | 292 | { |
| 283 | 293 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $data = ''; |
| 61 | 61 | if (filesize($file) > 0) |
| 62 | 62 | { |
| 63 | - $data =& fread($fp, filesize($file)); |
|
| 63 | + $data = & fread($fp, filesize($file)); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | flock($fp, LOCK_UN); |
@@ -438,17 +438,17 @@ discard block |
||
| 438 | 438 | // Owner |
| 439 | 439 | $symbolic .= (($perms & 0x0100) ? 'r' : '-'); |
| 440 | 440 | $symbolic .= (($perms & 0x0080) ? 'w' : '-'); |
| 441 | - $symbolic .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); |
|
| 441 | + $symbolic .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-')); |
|
| 442 | 442 | |
| 443 | 443 | // Group |
| 444 | 444 | $symbolic .= (($perms & 0x0020) ? 'r' : '-'); |
| 445 | 445 | $symbolic .= (($perms & 0x0010) ? 'w' : '-'); |
| 446 | - $symbolic .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); |
|
| 446 | + $symbolic .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-')); |
|
| 447 | 447 | |
| 448 | 448 | // World |
| 449 | 449 | $symbolic .= (($perms & 0x0004) ? 'r' : '-'); |
| 450 | 450 | $symbolic .= (($perms & 0x0002) ? 'w' : '-'); |
| 451 | - $symbolic .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); |
|
| 451 | + $symbolic .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-')); |
|
| 452 | 452 | |
| 453 | 453 | return $symbolic; |
| 454 | 454 | } |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * CodeIgniter |
| 4 | 6 | * |
@@ -139,8 +141,7 @@ discard block |
||
| 139 | 141 | { |
| 140 | 142 | delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $level + 1); |
| 141 | 143 | } |
| 142 | - } |
|
| 143 | - else |
|
| 144 | + } else |
|
| 144 | 145 | { |
| 145 | 146 | unlink($path.DIRECTORY_SEPARATOR.$filename); |
| 146 | 147 | } |
@@ -191,15 +192,13 @@ discard block |
||
| 191 | 192 | if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0) |
| 192 | 193 | { |
| 193 | 194 | get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE); |
| 194 | - } |
|
| 195 | - elseif (strncmp($file, '.', 1) !== 0) |
|
| 195 | + } elseif (strncmp($file, '.', 1) !== 0) |
|
| 196 | 196 | { |
| 197 | 197 | $_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file; |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | return $_filedata; |
| 201 | - } |
|
| 202 | - else |
|
| 201 | + } else |
|
| 203 | 202 | { |
| 204 | 203 | return FALSE; |
| 205 | 204 | } |
@@ -244,8 +243,7 @@ discard block |
||
| 244 | 243 | if (@is_dir($source_dir.$file) AND strncmp($file, '.', 1) !== 0 AND $top_level_only === FALSE) |
| 245 | 244 | { |
| 246 | 245 | get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, TRUE); |
| 247 | - } |
|
| 248 | - elseif (strncmp($file, '.', 1) !== 0) |
|
| 246 | + } elseif (strncmp($file, '.', 1) !== 0) |
|
| 249 | 247 | { |
| 250 | 248 | $_filedata[$file] = get_file_info($source_dir.$file); |
| 251 | 249 | $_filedata[$file]['relative_path'] = $relative_path; |
@@ -253,8 +251,7 @@ discard block |
||
| 253 | 251 | } |
| 254 | 252 | |
| 255 | 253 | return $_filedata; |
| 256 | - } |
|
| 257 | - else |
|
| 254 | + } else |
|
| 258 | 255 | { |
| 259 | 256 | return FALSE; |
| 260 | 257 | } |
@@ -355,8 +352,7 @@ discard block |
||
| 355 | 352 | if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) |
| 356 | 353 | { |
| 357 | 354 | include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); |
| 358 | - } |
|
| 359 | - elseif (is_file(APPPATH.'config/mimes.php')) |
|
| 355 | + } elseif (is_file(APPPATH.'config/mimes.php')) |
|
| 360 | 356 | { |
| 361 | 357 | include(APPPATH.'config/mimes.php'); |
| 362 | 358 | } |
@@ -373,13 +369,11 @@ discard block |
||
| 373 | 369 | { |
| 374 | 370 | // Multiple mime types, just give the first one |
| 375 | 371 | return current($mimes[$extension]); |
| 376 | - } |
|
| 377 | - else |
|
| 372 | + } else |
|
| 378 | 373 | { |
| 379 | 374 | return $mimes[$extension]; |
| 380 | 375 | } |
| 381 | - } |
|
| 382 | - else |
|
| 376 | + } else |
|
| 383 | 377 | { |
| 384 | 378 | return FALSE; |
| 385 | 379 | } |
@@ -405,32 +399,25 @@ discard block |
||
| 405 | 399 | if (($perms & 0xC000) == 0xC000) |
| 406 | 400 | { |
| 407 | 401 | $symbolic = 's'; // Socket |
| 408 | - } |
|
| 409 | - elseif (($perms & 0xA000) == 0xA000) |
|
| 402 | + } elseif (($perms & 0xA000) == 0xA000) |
|
| 410 | 403 | { |
| 411 | 404 | $symbolic = 'l'; // Symbolic Link |
| 412 | - } |
|
| 413 | - elseif (($perms & 0x8000) == 0x8000) |
|
| 405 | + } elseif (($perms & 0x8000) == 0x8000) |
|
| 414 | 406 | { |
| 415 | 407 | $symbolic = '-'; // Regular |
| 416 | - } |
|
| 417 | - elseif (($perms & 0x6000) == 0x6000) |
|
| 408 | + } elseif (($perms & 0x6000) == 0x6000) |
|
| 418 | 409 | { |
| 419 | 410 | $symbolic = 'b'; // Block special |
| 420 | - } |
|
| 421 | - elseif (($perms & 0x4000) == 0x4000) |
|
| 411 | + } elseif (($perms & 0x4000) == 0x4000) |
|
| 422 | 412 | { |
| 423 | 413 | $symbolic = 'd'; // Directory |
| 424 | - } |
|
| 425 | - elseif (($perms & 0x2000) == 0x2000) |
|
| 414 | + } elseif (($perms & 0x2000) == 0x2000) |
|
| 426 | 415 | { |
| 427 | 416 | $symbolic = 'c'; // Character special |
| 428 | - } |
|
| 429 | - elseif (($perms & 0x1000) == 0x1000) |
|
| 417 | + } elseif (($perms & 0x1000) == 0x1000) |
|
| 430 | 418 | { |
| 431 | 419 | $symbolic = 'p'; // FIFO pipe |
| 432 | - } |
|
| 433 | - else |
|
| 420 | + } else |
|
| 434 | 421 | { |
| 435 | 422 | $symbolic = 'u'; // Unknown |
| 436 | 423 | } |
@@ -73,6 +73,9 @@ |
||
| 73 | 73 | */ |
| 74 | 74 | if ( ! function_exists('do_hash')) |
| 75 | 75 | { |
| 76 | + /** |
|
| 77 | + * @param string $str |
|
| 78 | + */ |
|
| 76 | 79 | function do_hash($str, $type = 'sha1') |
| 77 | 80 | { |
| 78 | 81 | if ($type == 'sha1') |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | function xss_clean($str, $is_image = FALSE) |
| 41 | 41 | { |
| 42 | - $CI =& get_instance(); |
|
| 42 | + $CI = & get_instance(); |
|
| 43 | 43 | return $CI->security->xss_clean($str, $is_image); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | function sanitize_filename($filename) |
| 59 | 59 | { |
| 60 | - $CI =& get_instance(); |
|
| 60 | + $CI = & get_instance(); |
|
| 61 | 61 | return $CI->security->sanitize_filename($filename); |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | { |
| 120 | 120 | function encode_php_tags($str) |
| 121 | 121 | { |
| 122 | - return str_replace(array('<?php', '<?PHP', '<?', '?>'), array('<?php', '<?PHP', '<?', '?>'), $str); |
|
| 122 | + return str_replace(array('<?php', '<?PHP', '<?', '?>'), array('<?php', '<?PHP', '<?', '?>'), $str); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | // ------------------------------------------------------------------------ |
| 4 | 6 | |
@@ -59,8 +61,7 @@ discard block |
||
| 59 | 61 | if ($download == "") |
| 60 | 62 | { |
| 61 | 63 | return $str; |
| 62 | - } |
|
| 63 | - else |
|
| 64 | + } else |
|
| 64 | 65 | { |
| 65 | 66 | echo $str; |
| 66 | 67 | } |