@@ -314,7 +314,7 @@ |
||
314 | 314 | * |
315 | 315 | * A wrapper method. |
316 | 316 | * |
317 | - * @param mixed $n |
|
317 | + * @param integer $n |
|
318 | 318 | * @param string $type 'object' or 'array' |
319 | 319 | * @return mixed |
320 | 320 | */ |
@@ -69,28 +69,28 @@ |
||
69 | 69 | * |
70 | 70 | * @var array[] |
71 | 71 | */ |
72 | - public $result_array = array(); |
|
72 | + public $result_array = array(); |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Result Object |
76 | 76 | * |
77 | 77 | * @var object[] |
78 | 78 | */ |
79 | - public $result_object = array(); |
|
79 | + public $result_object = array(); |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Custom Result Object |
83 | 83 | * |
84 | 84 | * @var object[] |
85 | 85 | */ |
86 | - public $custom_result_object = array(); |
|
86 | + public $custom_result_object = array(); |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * Current Row index |
90 | 90 | * |
91 | 91 | * @var int |
92 | 92 | */ |
93 | - public $current_row = 0; |
|
93 | + public $current_row = 0; |
|
94 | 94 | |
95 | 95 | /** |
96 | 96 | * Number of rows |
@@ -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 | } |
@@ -104,7 +104,7 @@ |
||
104 | 104 | * Non-persistent database connection |
105 | 105 | * |
106 | 106 | * @param bool $persistent |
107 | - * @return resource |
|
107 | + * @return false|string |
|
108 | 108 | */ |
109 | 109 | public function db_connect($persistent = FALSE) |
110 | 110 | { |
@@ -341,11 +341,11 @@ discard block |
||
341 | 341 | $retval = array(); |
342 | 342 | for ($i = 0, $c = count($query); $i < $c; $i++) |
343 | 343 | { |
344 | - $retval[$i] = new stdClass(); |
|
344 | + $retval[$i] = new stdClass(); |
|
345 | 345 | $retval[$i]->name = $query[$i]->COLUMN_NAME; |
346 | 346 | $retval[$i]->type = $query[$i]->DATA_TYPE; |
347 | - $retval[$i]->max_length = ($query[$i]->CHARACTER_MAXIMUM_LENGTH > 0) ? $query[$i]->CHARACTER_MAXIMUM_LENGTH : $query[$i]->NUMERIC_PRECISION; |
|
348 | - $retval[$i]->default = $query[$i]->COLUMN_DEFAULT; |
|
347 | + $retval[$i]->max_length = ($query[$i]->CHARACTER_MAXIMUM_LENGTH > 0) ? $query[$i]->CHARACTER_MAXIMUM_LENGTH : $query[$i]->NUMERIC_PRECISION; |
|
348 | + $retval[$i]->default = $query[$i]->COLUMN_DEFAULT; |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | return $retval; |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | ."\nWHERE ".$this->escape_identifiers('CI_rownum').' BETWEEN '.($this->qb_offset + 1).' AND '.$limit; |
502 | 502 | } |
503 | 503 | |
504 | - return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$limit.' ', $sql); |
|
504 | + return preg_replace('/(^\SELECT (DISTINCT)?)/i', '\\1 TOP '.$limit.' ', $sql); |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | // -------------------------------------------------------------------- |
@@ -496,8 +496,7 @@ |
||
496 | 496 | if (empty($_SERVER['HTTP_REFERER'])) |
497 | 497 | { |
498 | 498 | $this->referer = FALSE; |
499 | - } |
|
500 | - else |
|
499 | + } else |
|
501 | 500 | { |
502 | 501 | $referer_host = @parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST); |
503 | 502 | $own_host = parse_url(config_item('base_url'), PHP_URL_HOST); |
@@ -238,7 +238,7 @@ |
||
238 | 238 | * Execute the query |
239 | 239 | * |
240 | 240 | * @param string $sql an SQL query |
241 | - * @return mixed |
|
241 | + * @return resource |
|
242 | 242 | */ |
243 | 243 | protected function _execute($sql) |
244 | 244 | { |
@@ -153,16 +153,16 @@ |
||
153 | 153 | $retval = array(); |
154 | 154 | for ($i = 0, $c = count($query); $i < $c; $i++) |
155 | 155 | { |
156 | - $retval[$i] = new stdClass(); |
|
157 | - $retval[$i]->name = $query[$i]->Field; |
|
156 | + $retval[$i] = new stdClass(); |
|
157 | + $retval[$i]->name = $query[$i]->Field; |
|
158 | 158 | |
159 | 159 | sscanf($query[$i]->Type, '%[a-z](%d)', |
160 | 160 | $retval[$i]->type, |
161 | 161 | $retval[$i]->max_length |
162 | 162 | ); |
163 | 163 | |
164 | - $retval[$i]->default = $query[$i]->Default; |
|
165 | - $retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
|
164 | + $retval[$i]->default = $query[$i]->Default; |
|
165 | + $retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $retval; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * Execute the query |
267 | 267 | * |
268 | 268 | * @param string $sql an SQL query |
269 | - * @return resource |
|
269 | + * @return boolean |
|
270 | 270 | */ |
271 | 271 | protected function _execute($sql) |
272 | 272 | { |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | /** |
431 | 431 | * Insert ID |
432 | 432 | * |
433 | - * @return int |
|
433 | + * @return string|null |
|
434 | 434 | */ |
435 | 435 | public function insert_id() |
436 | 436 | { |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | $retval = array(); |
521 | 521 | for ($i = 0, $c = count($query); $i < $c; $i++) |
522 | 522 | { |
523 | - $retval[$i] = new stdClass(); |
|
523 | + $retval[$i] = new stdClass(); |
|
524 | 524 | $retval[$i]->name = $query[$i]->COLUMN_NAME; |
525 | 525 | $retval[$i]->type = $query[$i]->DATA_TYPE; |
526 | 526 | |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | { |
531 | 531 | $length = $query[$i]->DATA_LENGTH; |
532 | 532 | } |
533 | - $retval[$i]->max_length = $length; |
|
533 | + $retval[$i]->max_length = $length; |
|
534 | 534 | |
535 | 535 | $default = $query[$i]->DATA_DEFAULT; |
536 | 536 | if ($default === NULL && $query[$i]->NULLABLE === 'N') |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | { |
632 | 632 | if ($this->qb_limit) |
633 | 633 | { |
634 | - $this->where('rownum <= ',$this->qb_limit, FALSE); |
|
634 | + $this->where('rownum <= ', $this->qb_limit, FALSE); |
|
635 | 635 | $this->qb_limit = FALSE; |
636 | 636 | } |
637 | 637 |
@@ -176,8 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | $this->dsn = $this->hostname; |
178 | 178 | return; |
179 | - } |
|
180 | - elseif ($this->hostname !== '' && strpos($this->hostname, '/') === FALSE && strpos($this->hostname, ':') === FALSE |
|
179 | + } elseif ($this->hostname !== '' && strpos($this->hostname, '/') === FALSE && strpos($this->hostname, ':') === FALSE |
|
181 | 180 | && (( ! empty($this->port) && ctype_digit($this->port)) OR $this->database !== '')) |
182 | 181 | { |
183 | 182 | /* If the hostname field isn't empty, doesn't contain |
@@ -255,8 +254,7 @@ discard block |
||
255 | 254 | if ( ! $this->conn_id OR ($version_string = oci_server_version($this->conn_id)) === FALSE) |
256 | 255 | { |
257 | 256 | return FALSE; |
258 | - } |
|
259 | - elseif (preg_match('#Release\s(\d+(?:\.\d+)+)#', $version_string, $match)) |
|
257 | + } elseif (preg_match('#Release\s(\d+(?:\.\d+)+)#', $version_string, $match)) |
|
260 | 258 | { |
261 | 259 | return $this->data_cache['version'] = $match[1]; |
262 | 260 | } |
@@ -480,8 +478,7 @@ discard block |
||
480 | 478 | if (strpos($table, '.') !== FALSE) |
481 | 479 | { |
482 | 480 | sscanf($table, '%[^.].%s', $owner, $table); |
483 | - } |
|
484 | - else |
|
481 | + } else |
|
485 | 482 | { |
486 | 483 | $owner = $this->username; |
487 | 484 | } |
@@ -504,8 +501,7 @@ discard block |
||
504 | 501 | if (strpos($table, '.') !== FALSE) |
505 | 502 | { |
506 | 503 | sscanf($table, '%[^.].%s', $owner, $table); |
507 | - } |
|
508 | - else |
|
504 | + } else |
|
509 | 505 | { |
510 | 506 | $owner = $this->username; |
511 | 507 | } |
@@ -565,12 +561,10 @@ discard block |
||
565 | 561 | if (is_resource($this->curs_id)) |
566 | 562 | { |
567 | 563 | return oci_error($this->curs_id); |
568 | - } |
|
569 | - elseif (is_resource($this->stmt_id)) |
|
564 | + } elseif (is_resource($this->stmt_id)) |
|
570 | 565 | { |
571 | 566 | return oci_error($this->stmt_id); |
572 | - } |
|
573 | - elseif (is_resource($this->conn_id)) |
|
567 | + } elseif (is_resource($this->conn_id)) |
|
574 | 568 | { |
575 | 569 | return oci_error($this->conn_id); |
576 | 570 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | * Create database |
78 | 78 | * |
79 | 79 | * @param string $db_name |
80 | - * @return string |
|
80 | + * @return boolean |
|
81 | 81 | */ |
82 | 82 | public function create_database($db_name) |
83 | 83 | { |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | * |
52 | 52 | * @var string |
53 | 53 | */ |
54 | - protected $_rename_table = FALSE; |
|
54 | + protected $_rename_table = FALSE; |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * UNSIGNED support |
58 | 58 | * |
59 | 59 | * @var array |
60 | 60 | */ |
61 | - protected $_unsigned = array( |
|
61 | + protected $_unsigned = array( |
|
62 | 62 | 'SMALLINT' => 'INTEGER', |
63 | 63 | 'INTEGER' => 'INT64', |
64 | 64 | 'FLOAT' => 'DOUBLE PRECISION' |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @var string |
71 | 71 | */ |
72 | - protected $_null = 'NULL'; |
|
72 | + protected $_null = 'NULL'; |
|
73 | 73 | |
74 | 74 | // -------------------------------------------------------------------- |
75 | 75 |
@@ -95,8 +95,7 @@ |
||
95 | 95 | if ( ! file_exists($this->db->database) OR ! @unlink($this->db->database)) |
96 | 96 | { |
97 | 97 | return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE; |
98 | - } |
|
99 | - elseif ( ! empty($this->db->data_cache['db_names'])) |
|
98 | + } elseif ( ! empty($this->db->data_cache['db_names'])) |
|
100 | 99 | { |
101 | 100 | $key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE); |
102 | 101 | if ($key !== FALSE) |
@@ -483,7 +483,7 @@ |
||
483 | 483 | * @param string $orderby |
484 | 484 | * @param string $direction ASC, DESC or RANDOM |
485 | 485 | * @param bool $escape |
486 | - * @return object |
|
486 | + * @return CI_DB_query_builder |
|
487 | 487 | */ |
488 | 488 | public function order_by($orderby, $direction = '', $escape = NULL) |
489 | 489 | { |
@@ -352,8 +352,8 @@ discard block |
||
352 | 352 | $v = pg_version($this->conn_id); |
353 | 353 | $v = isset($v['server']) ? $v['server'] : 0; // 'server' key is only available since PosgreSQL 7.4 |
354 | 354 | |
355 | - $table = (func_num_args() > 0) ? func_get_arg(0) : NULL; |
|
356 | - $column = (func_num_args() > 1) ? func_get_arg(1) : NULL; |
|
355 | + $table = (func_num_args() > 0) ? func_get_arg(0) : NULL; |
|
356 | + $column = (func_num_args() > 1) ? func_get_arg(1) : NULL; |
|
357 | 357 | |
358 | 358 | if ($table === NULL && $v >= '8.1') |
359 | 359 | { |
@@ -450,11 +450,11 @@ discard block |
||
450 | 450 | $retval = array(); |
451 | 451 | for ($i = 0, $c = count($query); $i < $c; $i++) |
452 | 452 | { |
453 | - $retval[$i] = new stdClass(); |
|
453 | + $retval[$i] = new stdClass(); |
|
454 | 454 | $retval[$i]->name = $query[$i]->column_name; |
455 | 455 | $retval[$i]->type = $query[$i]->data_type; |
456 | - $retval[$i]->max_length = ($query[$i]->character_maximum_length > 0) ? $query[$i]->character_maximum_length : $query[$i]->numeric_precision; |
|
457 | - $retval[$i]->default = $query[$i]->column_default; |
|
456 | + $retval[$i]->max_length = ($query[$i]->character_maximum_length > 0) ? $query[$i]->character_maximum_length : $query[$i]->numeric_precision; |
|
457 | + $retval[$i]->default = $query[$i]->column_default; |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | return $retval; |
@@ -319,8 +319,7 @@ discard block |
||
319 | 319 | if (is_php('5.4.4') && (is_string($str) OR (is_object($str) && method_exists($str, '__toString')))) |
320 | 320 | { |
321 | 321 | return pg_escape_literal($this->conn_id, $str); |
322 | - } |
|
323 | - elseif (is_bool($str)) |
|
322 | + } elseif (is_bool($str)) |
|
324 | 323 | { |
325 | 324 | return ($str) ? 'TRUE' : 'FALSE'; |
326 | 325 | } |
@@ -358,8 +357,7 @@ discard block |
||
358 | 357 | if ($table === NULL && $v >= '8.1') |
359 | 358 | { |
360 | 359 | $sql = 'SELECT LASTVAL() AS ins_id'; |
361 | - } |
|
362 | - elseif ($table !== NULL) |
|
360 | + } elseif ($table !== NULL) |
|
363 | 361 | { |
364 | 362 | if ($column !== NULL && $v >= '8.0') |
365 | 363 | { |
@@ -367,16 +365,14 @@ discard block |
||
367 | 365 | $query = $this->query($sql); |
368 | 366 | $query = $query->row(); |
369 | 367 | $seq = $query->seq; |
370 | - } |
|
371 | - else |
|
368 | + } else |
|
372 | 369 | { |
373 | 370 | // seq_name passed in table parameter |
374 | 371 | $seq = $table; |
375 | 372 | } |
376 | 373 | |
377 | 374 | $sql = 'SELECT CURRVAL(\''.$seq."') AS ins_id"; |
378 | - } |
|
379 | - else |
|
375 | + } else |
|
380 | 376 | { |
381 | 377 | return pg_last_oid($this->result_id); |
382 | 378 | } |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 1.3.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 1.3.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -97,7 +97,7 @@ |
||
97 | 97 | * |
98 | 98 | * @param string |
99 | 99 | * @param int |
100 | - * @return int |
|
100 | + * @return string |
|
101 | 101 | */ |
102 | 102 | function mdate($datestr = '', $time = '') |
103 | 103 | { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | function timespan($seconds = 1, $time = '', $units = 7) |
179 | 179 | { |
180 | - $CI =& get_instance(); |
|
180 | + $CI = & get_instance(); |
|
181 | 181 | $CI->lang->load('date'); |
182 | 182 | |
183 | 183 | is_numeric($seconds) OR $seconds = 1; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | } |
309 | 309 | |
310 | - $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
|
310 | + $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
|
311 | 311 | return $days_in_month[$month - 1]; |
312 | 312 | } |
313 | 313 | } |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | */ |
571 | 571 | function timezone_menu($default = 'UTC', $class = '', $name = 'timezones', $attributes = '') |
572 | 572 | { |
573 | - $CI =& get_instance(); |
|
573 | + $CI = & get_instance(); |
|
574 | 574 | $CI->lang->load('date'); |
575 | 575 | |
576 | 576 | $default = ($default === 'GMT') ? 'UTC' : $default; |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | $is_unix = ! ( ! $is_unix OR $is_unix === 'days'); |
694 | 694 | |
695 | 695 | // Validate input and try strtotime() on invalid timestamps/intervals, just in case |
696 | - if ( ( ! ctype_digit((string) $unix_start) && ($unix_start = @strtotime($unix_start)) === FALSE) |
|
696 | + if (( ! ctype_digit((string) $unix_start) && ($unix_start = @strtotime($unix_start)) === FALSE) |
|
697 | 697 | OR ( ! ctype_digit((string) $mixed) && ($is_unix === FALSE OR ($mixed = @strtotime($mixed)) === FALSE)) |
698 | 698 | OR ($is_unix === TRUE && $mixed < $unix_start)) |
699 | 699 | { |
@@ -104,8 +104,7 @@ discard block |
||
104 | 104 | if ($datestr === '') |
105 | 105 | { |
106 | 106 | return ''; |
107 | - } |
|
108 | - elseif (empty($time)) |
|
107 | + } elseif (empty($time)) |
|
109 | 108 | { |
110 | 109 | $time = now(); |
111 | 110 | } |
@@ -283,8 +282,7 @@ discard block |
||
283 | 282 | if ($month < 1 OR $month > 12) |
284 | 283 | { |
285 | 284 | return 0; |
286 | - } |
|
287 | - elseif ( ! is_numeric($year) OR strlen($year) !== 4) |
|
285 | + } elseif ( ! is_numeric($year) OR strlen($year) !== 4) |
|
288 | 286 | { |
289 | 287 | $year = date('Y'); |
290 | 288 | } |
@@ -420,8 +418,7 @@ discard block |
||
420 | 418 | if ($fmt === 'us') |
421 | 419 | { |
422 | 420 | $r .= date('h', $time).':'.date('i', $time); |
423 | - } |
|
424 | - else |
|
421 | + } else |
|
425 | 422 | { |
426 | 423 | $r .= date('H', $time).':'.date('i', $time); |
427 | 424 | } |
@@ -477,8 +474,7 @@ discard block |
||
477 | 474 | if ($ampm[0] === 'p' && $hour < 12) |
478 | 475 | { |
479 | 476 | $hour += 12; |
480 | - } |
|
481 | - elseif ($ampm[0] === 'a' && $hour === 12) |
|
477 | + } elseif ($ampm[0] === 'a' && $hour === 12) |
|
482 | 478 | { |
483 | 479 | $hour = 0; |
484 | 480 | } |
@@ -505,8 +501,7 @@ discard block |
||
505 | 501 | if (empty($bad_date)) |
506 | 502 | { |
507 | 503 | return 'Unknown'; |
508 | - } |
|
509 | - elseif (empty($format)) |
|
504 | + } elseif (empty($format)) |
|
510 | 505 | { |
511 | 506 | $format = 'U'; |
512 | 507 | } |
@@ -518,8 +513,7 @@ discard block |
||
518 | 513 | { |
519 | 514 | $year = substr($bad_date, 0, 4); |
520 | 515 | $month = substr($bad_date, 4, 2); |
521 | - } |
|
522 | - else |
|
516 | + } else |
|
523 | 517 | { |
524 | 518 | $month = substr($bad_date, 0, 2); |
525 | 519 | $year = substr($bad_date, 2, 4); |
@@ -732,8 +726,7 @@ discard block |
||
732 | 726 | { |
733 | 727 | $arg = new DateTime(); |
734 | 728 | $arg->setTimestamp($mixed); |
735 | - } |
|
736 | - else |
|
729 | + } else |
|
737 | 730 | { |
738 | 731 | $arg = (int) $mixed; |
739 | 732 | } |
@@ -764,23 +757,23 @@ discard block |
||
764 | 757 | $arg = new DateTime(); |
765 | 758 | $arg->setDate(date('Y', $mixed), date('n', $mixed), date('j', $mixed)); |
766 | 759 | $arg->setTime(date('G', $mixed), date('i', $mixed), date('s', $mixed)); |
767 | - } |
|
768 | - else |
|
760 | + } else |
|
769 | 761 | { |
770 | 762 | $arg = (int) $mixed; |
771 | 763 | } |
772 | 764 | $range[] = $from->format($format); |
773 | 765 | |
774 | - if (is_int($arg)) // Day intervals |
|
766 | + if (is_int($arg)) { |
|
767 | + // Day intervals |
|
775 | 768 | { |
776 | 769 | do |
777 | 770 | { |
778 | 771 | $from->modify('+1 day'); |
772 | + } |
|
779 | 773 | $range[] = $from->format($format); |
780 | 774 | } |
781 | 775 | while (--$arg > 0); |
782 | - } |
|
783 | - else // end date UNIX timestamp |
|
776 | + } else // end date UNIX timestamp |
|
784 | 777 | { |
785 | 778 | for ($from->modify('+1 day'), $end_check = $arg->format('Ymd'); $from->format('Ymd') < $end_check; $from->modify('+1 day')) |
786 | 779 | { |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 1.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 1.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -220,6 +220,7 @@ discard block |
||
220 | 220 | * @param string path to source |
221 | 221 | * @param bool Look only at the top level directory specified? |
222 | 222 | * @param bool internal variable to determine recursion status - do not use in calls |
223 | + * @param string $source_dir |
|
223 | 224 | * @return array |
224 | 225 | */ |
225 | 226 | function get_dir_file_info($source_dir, $top_level_only = TRUE, $_recursion = FALSE) |
@@ -272,6 +273,7 @@ discard block |
||
272 | 273 | * |
273 | 274 | * @param string path to file |
274 | 275 | * @param mixed array or comma separated string of information returned |
276 | + * @param string $file |
|
275 | 277 | * @return array |
276 | 278 | */ |
277 | 279 | function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) |
@@ -415,17 +415,17 @@ |
||
415 | 415 | // Owner |
416 | 416 | $symbolic .= (($perms & 0x0100) ? 'r' : '-') |
417 | 417 | .(($perms & 0x0080) ? 'w' : '-') |
418 | - .(($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); |
|
418 | + .(($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-')); |
|
419 | 419 | |
420 | 420 | // Group |
421 | 421 | $symbolic .= (($perms & 0x0020) ? 'r' : '-') |
422 | 422 | .(($perms & 0x0010) ? 'w' : '-') |
423 | - .(($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); |
|
423 | + .(($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-')); |
|
424 | 424 | |
425 | 425 | // World |
426 | 426 | $symbolic .= (($perms & 0x0004) ? 'r' : '-') |
427 | 427 | .(($perms & 0x0002) ? 'w' : '-') |
428 | - .(($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); |
|
428 | + .(($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-')); |
|
429 | 429 | |
430 | 430 | return $symbolic; |
431 | 431 | } |
@@ -141,8 +141,7 @@ discard block |
||
141 | 141 | if (is_dir($path.DIRECTORY_SEPARATOR.$filename) && $filename[0] !== '.') |
142 | 142 | { |
143 | 143 | delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $htdocs, $_level + 1); |
144 | - } |
|
145 | - elseif ($htdocs !== TRUE OR ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) |
|
144 | + } elseif ($htdocs !== TRUE OR ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) |
|
146 | 145 | { |
147 | 146 | @unlink($path.DIRECTORY_SEPARATOR.$filename); |
148 | 147 | } |
@@ -190,8 +189,7 @@ discard block |
||
190 | 189 | if (is_dir($source_dir.$file) && $file[0] !== '.') |
191 | 190 | { |
192 | 191 | get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE); |
193 | - } |
|
194 | - elseif ($file[0] !== '.') |
|
192 | + } elseif ($file[0] !== '.') |
|
195 | 193 | { |
196 | 194 | $_filedata[] = ($include_path === TRUE) ? $source_dir.$file : $file; |
197 | 195 | } |
@@ -242,8 +240,7 @@ discard block |
||
242 | 240 | if (is_dir($source_dir.$file) && $file[0] !== '.' && $top_level_only === FALSE) |
243 | 241 | { |
244 | 242 | get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, TRUE); |
245 | - } |
|
246 | - elseif ($file[0] !== '.') |
|
243 | + } elseif ($file[0] !== '.') |
|
247 | 244 | { |
248 | 245 | $_filedata[$file] = get_file_info($source_dir.$file); |
249 | 246 | $_filedata[$file]['relative_path'] = $relative_path; |
@@ -382,32 +379,25 @@ discard block |
||
382 | 379 | if (($perms & 0xC000) === 0xC000) |
383 | 380 | { |
384 | 381 | $symbolic = 's'; // Socket |
385 | - } |
|
386 | - elseif (($perms & 0xA000) === 0xA000) |
|
382 | + } elseif (($perms & 0xA000) === 0xA000) |
|
387 | 383 | { |
388 | 384 | $symbolic = 'l'; // Symbolic Link |
389 | - } |
|
390 | - elseif (($perms & 0x8000) === 0x8000) |
|
385 | + } elseif (($perms & 0x8000) === 0x8000) |
|
391 | 386 | { |
392 | 387 | $symbolic = '-'; // Regular |
393 | - } |
|
394 | - elseif (($perms & 0x6000) === 0x6000) |
|
388 | + } elseif (($perms & 0x6000) === 0x6000) |
|
395 | 389 | { |
396 | 390 | $symbolic = 'b'; // Block special |
397 | - } |
|
398 | - elseif (($perms & 0x4000) === 0x4000) |
|
391 | + } elseif (($perms & 0x4000) === 0x4000) |
|
399 | 392 | { |
400 | 393 | $symbolic = 'd'; // Directory |
401 | - } |
|
402 | - elseif (($perms & 0x2000) === 0x2000) |
|
394 | + } elseif (($perms & 0x2000) === 0x2000) |
|
403 | 395 | { |
404 | 396 | $symbolic = 'c'; // Character special |
405 | - } |
|
406 | - elseif (($perms & 0x1000) === 0x1000) |
|
397 | + } elseif (($perms & 0x1000) === 0x1000) |
|
407 | 398 | { |
408 | 399 | $symbolic = 'p'; // FIFO pipe |
409 | - } |
|
410 | - else |
|
400 | + } else |
|
411 | 401 | { |
412 | 402 | $symbolic = 'u'; // Unknown |
413 | 403 | } |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 1.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 1.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -326,10 +326,10 @@ |
||
326 | 326 | /** |
327 | 327 | * Drop-down Menu |
328 | 328 | * |
329 | - * @param mixed $data |
|
329 | + * @param string $data |
|
330 | 330 | * @param mixed $options |
331 | 331 | * @param mixed $selected |
332 | - * @param mixed $extra |
|
332 | + * @param string|false $extra |
|
333 | 333 | * @return string |
334 | 334 | */ |
335 | 335 | function form_dropdown($data = '', $options = array(), $selected = array(), $extra = '') |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | function form_open($action = '', $attributes = array(), $hidden = array()) |
65 | 65 | { |
66 | - $CI =& get_instance(); |
|
66 | + $CI = & get_instance(); |
|
67 | 67 | |
68 | 68 | // If no action is provided then set to the current url |
69 | 69 | if ( ! $action) |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | */ |
689 | 689 | function set_value($field, $default = '', $html_escape = TRUE) |
690 | 690 | { |
691 | - $CI =& get_instance(); |
|
691 | + $CI = & get_instance(); |
|
692 | 692 | |
693 | 693 | $value = (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field)) |
694 | 694 | ? $CI->form_validation->set_value($field, $default) |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | */ |
717 | 717 | function set_select($field, $value = '', $default = FALSE) |
718 | 718 | { |
719 | - $CI =& get_instance(); |
|
719 | + $CI = & get_instance(); |
|
720 | 720 | |
721 | 721 | if (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field)) |
722 | 722 | { |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | */ |
764 | 764 | function set_checkbox($field, $value = '', $default = FALSE) |
765 | 765 | { |
766 | - $CI =& get_instance(); |
|
766 | + $CI = & get_instance(); |
|
767 | 767 | |
768 | 768 | if (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field)) |
769 | 769 | { |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | */ |
816 | 816 | function set_radio($field, $value = '', $default = FALSE) |
817 | 817 | { |
818 | - $CI =& get_instance(); |
|
818 | + $CI = & get_instance(); |
|
819 | 819 | |
820 | 820 | if (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field)) |
821 | 821 | { |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | */ |
868 | 868 | function form_error($field = '', $prefix = '', $suffix = '') |
869 | 869 | { |
870 | - if (FALSE === ($OBJ =& _get_validation_object())) |
|
870 | + if (FALSE === ($OBJ = & _get_validation_object())) |
|
871 | 871 | { |
872 | 872 | return ''; |
873 | 873 | } |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | */ |
893 | 893 | function validation_errors($prefix = '', $suffix = '') |
894 | 894 | { |
895 | - if (FALSE === ($OBJ =& _get_validation_object())) |
|
895 | + if (FALSE === ($OBJ = & _get_validation_object())) |
|
896 | 896 | { |
897 | 897 | return ''; |
898 | 898 | } |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | */ |
1013 | 1013 | function &_get_validation_object() |
1014 | 1014 | { |
1015 | - $CI =& get_instance(); |
|
1015 | + $CI = & get_instance(); |
|
1016 | 1016 | |
1017 | 1017 | // We set this as a variable since we're returning by reference. |
1018 | 1018 | $return = FALSE; |
@@ -127,8 +127,7 @@ discard block |
||
127 | 127 | if (is_string($attributes)) |
128 | 128 | { |
129 | 129 | $attributes .= ' enctype="multipart/form-data"'; |
130 | - } |
|
131 | - else |
|
130 | + } else |
|
132 | 131 | { |
133 | 132 | $attributes['enctype'] = 'multipart/form-data'; |
134 | 133 | } |
@@ -174,8 +173,7 @@ discard block |
||
174 | 173 | if ( ! is_array($value)) |
175 | 174 | { |
176 | 175 | $form .= '<input type="hidden" name="'.$name.'" value="'.html_escape($value)."\" />\n"; |
177 | - } |
|
178 | - else |
|
176 | + } else |
|
179 | 177 | { |
180 | 178 | foreach ($value as $k => $v) |
181 | 179 | { |
@@ -281,8 +279,7 @@ discard block |
||
281 | 279 | if ( ! is_array($data) OR ! isset($data['value'])) |
282 | 280 | { |
283 | 281 | $val = $value; |
284 | - } |
|
285 | - else |
|
282 | + } else |
|
286 | 283 | { |
287 | 284 | $val = $data['value']; |
288 | 285 | unset($data['value']); // textareas don't use the value attribute |
@@ -349,8 +346,7 @@ discard block |
||
349 | 346 | $options = $data['options']; |
350 | 347 | unset($data['options']); // select tags don't use an options attribute |
351 | 348 | } |
352 | - } |
|
353 | - else |
|
349 | + } else |
|
354 | 350 | { |
355 | 351 | $defaults = array('name' => $data); |
356 | 352 | } |
@@ -367,8 +363,7 @@ discard block |
||
367 | 363 | { |
368 | 364 | $selected = array($_POST[$data['name']]); |
369 | 365 | } |
370 | - } |
|
371 | - elseif (isset($_POST[$data])) |
|
366 | + } elseif (isset($_POST[$data])) |
|
372 | 367 | { |
373 | 368 | $selected = array($_POST[$data]); |
374 | 369 | } |
@@ -401,8 +396,7 @@ discard block |
||
401 | 396 | } |
402 | 397 | |
403 | 398 | $form .= "</optgroup>\n"; |
404 | - } |
|
405 | - else |
|
399 | + } else |
|
406 | 400 | { |
407 | 401 | $form .= '<option value="'.html_escape($key).'"' |
408 | 402 | .(in_array($key, $selected) ? ' selected="selected"' : '').'>' |
@@ -438,8 +432,7 @@ discard block |
||
438 | 432 | if ($checked == FALSE) |
439 | 433 | { |
440 | 434 | unset($data['checked']); |
441 | - } |
|
442 | - else |
|
435 | + } else |
|
443 | 436 | { |
444 | 437 | $data['checked'] = 'checked'; |
445 | 438 | } |
@@ -448,8 +441,7 @@ discard block |
||
448 | 441 | if ($checked == TRUE) |
449 | 442 | { |
450 | 443 | $defaults['checked'] = 'checked'; |
451 | - } |
|
452 | - else |
|
444 | + } else |
|
453 | 445 | { |
454 | 446 | unset($defaults['checked']); |
455 | 447 | } |
@@ -721,8 +713,7 @@ discard block |
||
721 | 713 | if (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field)) |
722 | 714 | { |
723 | 715 | return $CI->form_validation->set_select($field, $value, $default); |
724 | - } |
|
725 | - elseif (($input = $CI->input->post($field, FALSE)) === NULL) |
|
716 | + } elseif (($input = $CI->input->post($field, FALSE)) === NULL) |
|
726 | 717 | { |
727 | 718 | return ($default === TRUE) ? ' selected="selected"' : ''; |
728 | 719 | } |
@@ -940,8 +931,7 @@ discard block |
||
940 | 931 | if ($key === 'value') |
941 | 932 | { |
942 | 933 | $val = html_escape($val); |
943 | - } |
|
944 | - elseif ($key === 'name' && ! strlen($default['name'])) |
|
934 | + } elseif ($key === 'name' && ! strlen($default['name'])) |
|
945 | 935 | { |
946 | 936 | continue; |
947 | 937 | } |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 1.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 1.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |