@@ -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 | { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @param mixed primary key(s) |
141 | 141 | * @param mixed key(s) |
142 | 142 | * @param boolean should 'IF NOT EXISTS' be added to the SQL |
143 | - * @return bool |
|
143 | + * @return string |
|
144 | 144 | */ |
145 | 145 | function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) |
146 | 146 | { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @param string the column name |
213 | 213 | * @param array fields |
214 | 214 | * @param string the field after which we should add the new field |
215 | - * @return object |
|
215 | + * @return string |
|
216 | 216 | */ |
217 | 217 | function _alter_table($alter_type, $table, $fields, $after_field = '') |
218 | 218 | { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | if (array_key_exists('TYPE', $attributes)) |
88 | 88 | { |
89 | - $sql .= ' '.$attributes['TYPE']; |
|
89 | + $sql .= ' '.$attributes['TYPE']; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if (array_key_exists('CONSTRAINT', $attributes)) |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); |
161 | 161 | $primary_keys = $this->db->_protect_identifiers($primary_keys); |
162 | - $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; |
|
162 | + $sql .= ",\n\tPRIMARY KEY ".$key_name." (".implode(', ', $primary_keys).")"; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | if (is_array($keys) && count($keys) > 0) |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $key = array($key_name); |
178 | 178 | } |
179 | 179 | |
180 | - $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; |
|
180 | + $sql .= ",\n\tKEY {$key_name} (".implode(', ', $key).")"; |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | if ($after_field != '') |
230 | 230 | { |
231 | - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); |
|
231 | + $sql .= ' AFTER '.$this->db->_protect_identifiers($after_field); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | 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 | * |
@@ -72,8 +74,7 @@ discard block |
||
72 | 74 | if (is_numeric($field)) |
73 | 75 | { |
74 | 76 | $sql .= "\n\t$attributes"; |
75 | - } |
|
76 | - else |
|
77 | + } else |
|
77 | 78 | { |
78 | 79 | $attributes = array_change_key_case($attributes, CASE_UPPER); |
79 | 80 | |
@@ -107,8 +108,7 @@ discard block |
||
107 | 108 | if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) |
108 | 109 | { |
109 | 110 | $sql .= ' NULL'; |
110 | - } |
|
111 | - else |
|
111 | + } else |
|
112 | 112 | { |
113 | 113 | $sql .= ' NOT NULL'; |
114 | 114 | } |
@@ -170,8 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | $key_name = $this->db->_protect_identifiers(implode('_', $key)); |
172 | 172 | $key = $this->db->_protect_identifiers($key); |
173 | - } |
|
174 | - else |
|
173 | + } else |
|
175 | 174 | { |
176 | 175 | $key_name = $this->db->_protect_identifiers($key); |
177 | 176 | $key = array($key_name); |
@@ -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 | { |
@@ -94,9 +94,9 @@ |
||
94 | 94 | $F = new stdClass(); |
95 | 95 | $F->name = $field->Field; |
96 | 96 | $F->type = $type; |
97 | - $F->default = $field->Default; |
|
98 | - $F->max_length = $length; |
|
99 | - $F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 ); |
|
97 | + $F->default = $field->Default; |
|
98 | + $F->max_length = $length; |
|
99 | + $F->primary_key = ($field->Key == 'PRI' ? 1 : 0); |
|
100 | 100 | |
101 | 101 | $retval[] = $F; |
102 | 102 | } |
@@ -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 |
@@ -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 |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * Select the database |
125 | 125 | * |
126 | 126 | * @access private called by the base class |
127 | - * @return resource |
|
127 | + * @return boolean |
|
128 | 128 | */ |
129 | 129 | function db_select() |
130 | 130 | { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @access public |
141 | 141 | * @param string |
142 | 142 | * @param string |
143 | - * @return resource |
|
143 | + * @return boolean |
|
144 | 144 | */ |
145 | 145 | function db_set_charset($charset, $collation) |
146 | 146 | { |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | * |
369 | 369 | * @access public |
370 | 370 | * @param string |
371 | - * @return string |
|
371 | + * @return integer |
|
372 | 372 | */ |
373 | 373 | function count_all($table = '') |
374 | 374 | { |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * |
438 | 438 | * @access public |
439 | 439 | * @param string the table name |
440 | - * @return object |
|
440 | + * @return string |
|
441 | 441 | */ |
442 | 442 | function _field_data($table) |
443 | 443 | { |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | * The error message number |
464 | 464 | * |
465 | 465 | * @access private |
466 | - * @return integer |
|
466 | + * @return string |
|
467 | 467 | */ |
468 | 468 | function _error_number() |
469 | 469 | { |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | * |
523 | 523 | * @access public |
524 | 524 | * @param type |
525 | - * @return type |
|
525 | + * @return string |
|
526 | 526 | */ |
527 | 527 | function _from_tables($tables) |
528 | 528 | { |
@@ -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 | // ------------------------------------------------------------------------ |
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 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * @param mixed primary key(s) |
74 | 74 | * @param mixed key(s) |
75 | 75 | * @param boolean should 'IF NOT EXISTS' be added to the SQL |
76 | - * @return bool |
|
76 | + * @return string |
|
77 | 77 | */ |
78 | 78 | function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) |
79 | 79 | { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @param string the default value |
204 | 204 | * @param boolean should 'NOT NULL' be added |
205 | 205 | * @param string the field after which we should add the new field |
206 | - * @return object |
|
206 | + * @return string |
|
207 | 207 | */ |
208 | 208 | function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') |
209 | 209 | { |
@@ -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 |
@@ -20,7 +20,10 @@ |
||
20 | 20 | <section class="slice color-three no-margin"> |
21 | 21 | <div class="w-section inverse no-padding"> |
22 | 22 | <div style="color:red;margin-left: 60px;"> |
23 | - <?php if (isset($validation_errors)) echo $validation_errors; ?> |
|
23 | + <?php if (isset($validation_errors)) { |
|
24 | + echo $validation_errors; |
|
25 | +} |
|
26 | +?> |
|
24 | 27 | </div> |
25 | 28 | <?php echo $form; ?> |
26 | 29 | </div> |
@@ -24,7 +24,10 @@ |
||
24 | 24 | <section class="slice color-three no-margin"> |
25 | 25 | <div class="w-section inverse no-padding"> |
26 | 26 | <div style="color:red;margin-left: 60px;"> |
27 | - <?php if (isset($validation_errors)) echo $validation_errors; ?> |
|
27 | + <?php if (isset($validation_errors)) { |
|
28 | + echo $validation_errors; |
|
29 | +} |
|
30 | +?> |
|
28 | 31 | </div> |
29 | 32 | <?php echo $form; ?> |
30 | 33 | </div> |
@@ -20,7 +20,10 @@ |
||
20 | 20 | <section class="slice color-three no-margin"> |
21 | 21 | <div class="w-section inverse no-padding"> |
22 | 22 | <div style="color:red;margin-left: 60px;"> |
23 | - <?php if (isset($validation_errors)) echo $validation_errors; ?> |
|
23 | + <?php if (isset($validation_errors)) { |
|
24 | + echo $validation_errors; |
|
25 | +} |
|
26 | +?> |
|
24 | 27 | </div> |
25 | 28 | <?php echo $form; ?> |
26 | 29 | </div> |