@@ -58,13 +58,11 @@ |
||
58 | 58 | $new_source .= '{ ' . self::CODE; |
59 | 59 | $start_method = false; |
60 | 60 | $replacement = each(self::$replacement); |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $new_source .= $token; |
65 | 64 | } |
66 | - } |
|
67 | - else |
|
65 | + } else |
|
68 | 66 | { |
69 | 67 | $new_source .= $token[1]; |
70 | 68 | } |
@@ -56,12 +56,10 @@ discard block |
||
56 | 56 | if (isset($info['class_method'])) |
57 | 57 | { |
58 | 58 | $called_method = $info['class_method']; |
59 | - } |
|
60 | - elseif (isset($info['function'])) |
|
59 | + } elseif (isset($info['function'])) |
|
61 | 60 | { |
62 | 61 | $called_method = $info['function']; |
63 | - } |
|
64 | - else |
|
62 | + } else |
|
65 | 63 | { |
66 | 64 | $called_method = 'n/a'; |
67 | 65 | } |
@@ -88,8 +86,7 @@ discard block |
||
88 | 86 | ) |
89 | 87 | { |
90 | 88 | $patch = self::$patches[$class][$method]; |
91 | - } |
|
92 | - else |
|
89 | + } else |
|
93 | 90 | { |
94 | 91 | return __GO_TO_ORIG__; |
95 | 92 | } |
@@ -19,8 +19,7 @@ |
||
19 | 19 | if ($class === null) |
20 | 20 | { |
21 | 21 | $message = 'exit() called in ' . $method . '() function'; |
22 | - } |
|
23 | - else |
|
22 | + } else |
|
24 | 23 | { |
25 | 24 | $message = 'exit() called in ' . $class . '::' . $method . '()'; |
26 | 25 | } |
@@ -169,12 +169,10 @@ discard block |
||
169 | 169 | file_exists(APPPATH.'vendor/autoload.php') |
170 | 170 | ? require_once(APPPATH.'vendor/autoload.php') |
171 | 171 | : log_message('error', '$config[\'composer_autoload\'] is set to TRUE but '.APPPATH.'vendor/autoload.php was not found.'); |
172 | - } |
|
173 | - elseif (file_exists($composer_autoload)) |
|
172 | + } elseif (file_exists($composer_autoload)) |
|
174 | 173 | { |
175 | 174 | require_once($composer_autoload); |
176 | - } |
|
177 | - else |
|
175 | + } else |
|
178 | 176 | { |
179 | 177 | log_message('error', 'Could not find the specified $config[\'composer_autoload\'] path: '.$composer_autoload); |
180 | 178 | } |
@@ -250,8 +248,7 @@ discard block |
||
250 | 248 | // This is required for mb_convert_encoding() to strip invalid characters. |
251 | 249 | // That's utilized by CI_Utf8, but it's also done for consistency with iconv. |
252 | 250 | mb_substitute_character('none'); |
253 | - } |
|
254 | - else |
|
251 | + } else |
|
255 | 252 | { |
256 | 253 | define('MB_ENABLED', FALSE); |
257 | 254 | } |
@@ -264,8 +261,7 @@ discard block |
||
264 | 261 | // iconv.internal_encoding is deprecated starting with PHP 5.6 |
265 | 262 | // and it's usage triggers E_DEPRECATED messages. |
266 | 263 | @ini_set('iconv.internal_encoding', $charset); |
267 | - } |
|
268 | - else |
|
264 | + } else |
|
269 | 265 | { |
270 | 266 | define('ICONV_ENABLED', FALSE); |
271 | 267 | } |
@@ -405,16 +401,14 @@ discard block |
||
405 | 401 | if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) |
406 | 402 | { |
407 | 403 | $e404 = TRUE; |
408 | - } |
|
409 | - else |
|
404 | + } else |
|
410 | 405 | { |
411 | 406 | require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); |
412 | 407 | |
413 | 408 | if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) |
414 | 409 | { |
415 | 410 | $e404 = TRUE; |
416 | - } |
|
417 | - elseif (method_exists($class, '_remap')) |
|
411 | + } elseif (method_exists($class, '_remap')) |
|
418 | 412 | { |
419 | 413 | $params = array($method, array_slice($URI->rsegments, 2)); |
420 | 414 | $method = '_remap'; |
@@ -456,8 +450,7 @@ discard block |
||
456 | 450 | $RTR->directory = ''; |
457 | 451 | } |
458 | 452 | } |
459 | - } |
|
460 | - else |
|
453 | + } else |
|
461 | 454 | { |
462 | 455 | $e404 = FALSE; |
463 | 456 | } |
@@ -473,8 +466,7 @@ discard block |
||
473 | 466 | 1 => $class, |
474 | 467 | 2 => $method |
475 | 468 | ); |
476 | - } |
|
477 | - else |
|
469 | + } else |
|
478 | 470 | { |
479 | 471 | show_404($RTR->directory.$class.'/'.$method); |
480 | 472 | } |
@@ -154,14 +154,16 @@ discard block |
||
154 | 154 | if ($status_code < 100) |
155 | 155 | { |
156 | 156 | $exit_status = $status_code + 9; // 9 is EXIT__AUTO_MIN |
157 | - if ($exit_status > 125) // 125 is EXIT__AUTO_MAX |
|
157 | + if ($exit_status > 125) { |
|
158 | + // 125 is EXIT__AUTO_MAX |
|
158 | 159 | { |
159 | - $exit_status = 1; // EXIT_ERROR |
|
160 | + $exit_status = 1; |
|
161 | + } |
|
162 | + // EXIT_ERROR |
|
160 | 163 | } |
161 | 164 | |
162 | 165 | $status_code = 500; |
163 | - } |
|
164 | - else |
|
166 | + } else |
|
165 | 167 | { |
166 | 168 | $exit_status = 1; // EXIT_ERROR |
167 | 169 | } |
@@ -250,8 +252,7 @@ discard block |
||
250 | 252 | if (isset($stati[$code])) |
251 | 253 | { |
252 | 254 | $text = $stati[$code]; |
253 | - } |
|
254 | - else |
|
255 | + } else |
|
255 | 256 | { |
256 | 257 | show_error('No status text available. Please check your status code number or supply your own message text.', 500); |
257 | 258 | } |
@@ -277,8 +278,7 @@ discard block |
||
277 | 278 | if (strpos(PHP_SAPI, 'cgi') === 0) |
278 | 279 | { |
279 | 280 | header('Status: '.$code.' '.$text, TRUE); |
280 | - } |
|
281 | - else |
|
281 | + } else |
|
282 | 282 | { |
283 | 283 | $server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; |
284 | 284 | header($server_protocol.' '.$code.' '.$text, TRUE, $code); |
@@ -192,16 +192,14 @@ discard block |
||
192 | 192 | if (empty($library)) |
193 | 193 | { |
194 | 194 | return $this; |
195 | - } |
|
196 | - elseif (is_array($library)) |
|
195 | + } elseif (is_array($library)) |
|
197 | 196 | { |
198 | 197 | foreach ($library as $key => $value) |
199 | 198 | { |
200 | 199 | if (is_int($key)) |
201 | 200 | { |
202 | 201 | $this->library($value, $params); |
203 | - } |
|
204 | - else |
|
202 | + } else |
|
205 | 203 | { |
206 | 204 | $this->library($key, $params, $value); |
207 | 205 | } |
@@ -238,8 +236,7 @@ discard block |
||
238 | 236 | if (empty($model)) |
239 | 237 | { |
240 | 238 | return $this; |
241 | - } |
|
242 | - elseif (is_array($model)) |
|
239 | + } elseif (is_array($model)) |
|
243 | 240 | { |
244 | 241 | foreach ($model as $key => $value) |
245 | 242 | { |
@@ -427,8 +424,7 @@ discard block |
||
427 | 424 | require_once($driver_path); |
428 | 425 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
429 | 426 | } |
430 | - } |
|
431 | - else |
|
427 | + } else |
|
432 | 428 | { |
433 | 429 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
434 | 430 | } |
@@ -696,8 +692,7 @@ discard block |
||
696 | 692 | } |
697 | 693 | |
698 | 694 | return $this; |
699 | - } |
|
700 | - elseif (empty($library)) |
|
695 | + } elseif (empty($library)) |
|
701 | 696 | { |
702 | 697 | return FALSE; |
703 | 698 | } |
@@ -790,8 +785,7 @@ discard block |
||
790 | 785 | array_shift($this->_ci_helper_paths); |
791 | 786 | array_shift($this->_ci_view_paths); |
792 | 787 | array_pop($config->_config_paths); |
793 | - } |
|
794 | - else |
|
788 | + } else |
|
795 | 789 | { |
796 | 790 | $path = rtrim($path, '/').'/'; |
797 | 791 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -853,8 +847,7 @@ discard block |
||
853 | 847 | { |
854 | 848 | $_ci_x = explode('/', $_ci_path); |
855 | 849 | $_ci_file = end($_ci_x); |
856 | - } |
|
857 | - else |
|
850 | + } else |
|
858 | 851 | { |
859 | 852 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
860 | 853 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -924,8 +917,7 @@ discard block |
||
924 | 917 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
925 | 918 | { |
926 | 919 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
927 | - } |
|
928 | - else |
|
920 | + } else |
|
929 | 921 | { |
930 | 922 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
931 | 923 | } |
@@ -952,8 +944,7 @@ discard block |
||
952 | 944 | if (ob_get_level() > $this->_ci_ob_level + 1) |
953 | 945 | { |
954 | 946 | ob_end_flush(); |
955 | - } |
|
956 | - else |
|
947 | + } else |
|
957 | 948 | { |
958 | 949 | $_ci_CI->output->append_output(ob_get_contents()); |
959 | 950 | @ob_end_clean(); |
@@ -993,8 +984,7 @@ discard block |
||
993 | 984 | |
994 | 985 | // Get the filename from the path |
995 | 986 | $class = substr($class, $last_slash); |
996 | - } |
|
997 | - else |
|
987 | + } else |
|
998 | 988 | { |
999 | 989 | $subdir = ''; |
1000 | 990 | } |
@@ -1135,8 +1125,7 @@ discard block |
||
1135 | 1125 | { |
1136 | 1126 | $prefix = config_item('subclass_prefix'); |
1137 | 1127 | break; |
1138 | - } |
|
1139 | - else |
|
1128 | + } else |
|
1140 | 1129 | { |
1141 | 1130 | log_message('debug', $path.' exists, but does not declare '.$subclass); |
1142 | 1131 | } |
@@ -1183,8 +1172,7 @@ discard block |
||
1183 | 1172 | { |
1184 | 1173 | include($path.'config/'.strtolower($class).'.php'); |
1185 | 1174 | $found = TRUE; |
1186 | - } |
|
1187 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1175 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1188 | 1176 | { |
1189 | 1177 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
1190 | 1178 | $found = TRUE; |
@@ -1194,8 +1182,7 @@ discard block |
||
1194 | 1182 | { |
1195 | 1183 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
1196 | 1184 | $found = TRUE; |
1197 | - } |
|
1198 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1185 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1199 | 1186 | { |
1200 | 1187 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
1201 | 1188 | $found = TRUE; |
@@ -1386,8 +1373,7 @@ discard block |
||
1386 | 1373 | if ( ! is_array($filename)) |
1387 | 1374 | { |
1388 | 1375 | return array(strtolower(str_replace(array($extension, '.php'), '', $filename).$extension)); |
1389 | - } |
|
1390 | - else |
|
1376 | + } else |
|
1391 | 1377 | { |
1392 | 1378 | foreach ($filename as $key => $val) |
1393 | 1379 | { |
@@ -63,16 +63,14 @@ discard block |
||
63 | 63 | if ($method === 'auto' && isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) |
64 | 64 | { |
65 | 65 | $method = 'refresh'; |
66 | - } |
|
67 | - elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
66 | + } elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
68 | 67 | { |
69 | 68 | if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1') |
70 | 69 | { |
71 | 70 | $code = ($_SERVER['REQUEST_METHOD'] !== 'GET') |
72 | 71 | ? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get |
73 | 72 | : 307; |
74 | - } |
|
75 | - else |
|
73 | + } else |
|
76 | 74 | { |
77 | 75 | $code = 302; |
78 | 76 | } |
@@ -97,8 +95,7 @@ discard block |
||
97 | 95 | if (ENVIRONMENT !== 'testing') |
98 | 96 | { |
99 | 97 | exit; |
100 | - } |
|
101 | - else |
|
98 | + } else |
|
102 | 99 | { |
103 | 100 | while (ob_get_level() > 1) |
104 | 101 | { |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | if (strpos($class, 'Mock_') === 0) |
64 | 64 | { |
65 | 65 | $class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class)); |
66 | - } |
|
67 | - elseif (strpos($class, 'CI_') === 0) |
|
66 | + } elseif (strpos($class, 'CI_') === 0) |
|
68 | 67 | { |
69 | 68 | $subclass = substr($class, 3); |
70 | 69 | |
@@ -72,39 +71,32 @@ discard block |
||
72 | 71 | { |
73 | 72 | $dir = SYSTEM_PATH.'core'.DIRECTORY_SEPARATOR; |
74 | 73 | $class = $subclass; |
75 | - } |
|
76 | - elseif (in_array($subclass, $ci_libraries)) |
|
74 | + } elseif (in_array($subclass, $ci_libraries)) |
|
77 | 75 | { |
78 | 76 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR; |
79 | 77 | $class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass; |
80 | - } |
|
81 | - elseif (in_array($subclass, $ci_drivers)) |
|
78 | + } elseif (in_array($subclass, $ci_drivers)) |
|
82 | 79 | { |
83 | 80 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$subclass.DIRECTORY_SEPARATOR; |
84 | 81 | $class = $subclass; |
85 | - } |
|
86 | - elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
82 | + } elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
87 | 83 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$parent.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
88 | 84 | $class = $subclass; |
89 | - } |
|
90 | - elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
85 | + } elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
91 | 86 | { |
92 | 87 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
93 | 88 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR.'subdrivers'.DIRECTORY_SEPARATOR; |
94 | 89 | $file = $dir.$m[1].'_'.$m[2].'_'.$m[3].'.php'; |
95 | - } |
|
96 | - elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
90 | + } elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
97 | 91 | { |
98 | 92 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
99 | 93 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR; |
100 | 94 | $file = $dir.$m[1].'_'.$m[2].'.php'; |
101 | - } |
|
102 | - elseif (strpos($class, 'CI_DB') === 0) |
|
95 | + } elseif (strpos($class, 'CI_DB') === 0) |
|
103 | 96 | { |
104 | 97 | $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR; |
105 | 98 | $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
106 | - } |
|
107 | - else |
|
99 | + } else |
|
108 | 100 | { |
109 | 101 | $class = strtolower($class); |
110 | 102 | } |
@@ -38,8 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $patched = true; |
40 | 40 | $new_source = static::generateNewSource($source); |
41 | - } |
|
42 | - else |
|
41 | + } else |
|
43 | 42 | { |
44 | 43 | $new_source = $source; |
45 | 44 | } |