@@ -331,19 +331,16 @@ discard block |
||
| 331 | 331 | if ($reflection->hasMethod('set_'.$key)) |
| 332 | 332 | { |
| 333 | 333 | $this->{'set_'.$key}($config[$key]); |
| 334 | - } |
|
| 335 | - else |
|
| 334 | + } else |
|
| 336 | 335 | { |
| 337 | 336 | $this->$key = $config[$key]; |
| 338 | 337 | } |
| 339 | - } |
|
| 340 | - else |
|
| 338 | + } else |
|
| 341 | 339 | { |
| 342 | 340 | $this->$key = $defaults[$key]; |
| 343 | 341 | } |
| 344 | 342 | } |
| 345 | - } |
|
| 346 | - else |
|
| 343 | + } else |
|
| 347 | 344 | { |
| 348 | 345 | foreach ($config as $key => &$value) |
| 349 | 346 | { |
@@ -352,8 +349,7 @@ discard block |
||
| 352 | 349 | if ($reflection->hasMethod('set_'.$key)) |
| 353 | 350 | { |
| 354 | 351 | $this->{'set_'.$key}($value); |
| 355 | - } |
|
| 356 | - else |
|
| 352 | + } else |
|
| 357 | 353 | { |
| 358 | 354 | $this->$key = $value; |
| 359 | 355 | } |
@@ -415,9 +411,11 @@ discard block |
||
| 415 | 411 | } |
| 416 | 412 | |
| 417 | 413 | // Was the file able to be uploaded? If not, determine the reason why. |
| 418 | - if ( ! file_exists($_file['tmp_name'])) // modified by ci-phpunit-test |
|
| 414 | + if ( ! file_exists($_file['tmp_name'])) { |
|
| 415 | + // modified by ci-phpunit-test |
|
| 419 | 416 | { |
| 420 | 417 | $error = isset($_file['error']) ? $_file['error'] : 4; |
| 418 | + } |
|
| 421 | 419 | |
| 422 | 420 | switch ($error) |
| 423 | 421 | { |
@@ -482,8 +480,7 @@ discard block |
||
| 482 | 480 | if (strpos($this->_file_name_override, '.') === FALSE) |
| 483 | 481 | { |
| 484 | 482 | $this->file_name .= $this->file_ext; |
| 485 | - } |
|
| 486 | - else |
|
| 483 | + } else |
|
| 487 | 484 | { |
| 488 | 485 | // An extension was provided, let's have it! |
| 489 | 486 | $this->file_ext = $this->get_extension($this->_file_name_override); |
@@ -881,8 +878,7 @@ discard block |
||
| 881 | 878 | if (in_array($this->file_type, $png_mimes)) |
| 882 | 879 | { |
| 883 | 880 | $this->file_type = 'image/png'; |
| 884 | - } |
|
| 885 | - elseif (in_array($this->file_type, $jpeg_mimes)) |
|
| 881 | + } elseif (in_array($this->file_type, $jpeg_mimes)) |
|
| 886 | 882 | { |
| 887 | 883 | $this->file_type = 'image/jpeg'; |
| 888 | 884 | } |
@@ -1148,9 +1144,12 @@ discard block |
||
| 1148 | 1144 | |
| 1149 | 1145 | if (function_exists('getimagesize') && @getimagesize($file) !== FALSE) |
| 1150 | 1146 | { |
| 1151 | - if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary |
|
| 1147 | + if (($file = @fopen($file, 'rb')) === FALSE) { |
|
| 1148 | + // "b" to force binary |
|
| 1152 | 1149 | { |
| 1153 | - return FALSE; // Couldn't open the file, return FALSE |
|
| 1150 | + return FALSE; |
|
| 1151 | + } |
|
| 1152 | + // Couldn't open the file, return FALSE |
|
| 1154 | 1153 | } |
| 1155 | 1154 | |
| 1156 | 1155 | $opening_bytes = fread($file, 256); |
@@ -1269,9 +1268,11 @@ discard block |
||
| 1269 | 1268 | if (function_exists('finfo_file')) |
| 1270 | 1269 | { |
| 1271 | 1270 | $finfo = @finfo_open(FILEINFO_MIME); |
| 1272 | - if (is_resource($finfo)) // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system |
|
| 1271 | + if (is_resource($finfo)) { |
|
| 1272 | + // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system |
|
| 1273 | 1273 | { |
| 1274 | 1274 | $mime = @finfo_file($finfo, $file['tmp_name']); |
| 1275 | + } |
|
| 1275 | 1276 | finfo_close($finfo); |
| 1276 | 1277 | |
| 1277 | 1278 | /* According to the comments section of the PHP manual page, |
@@ -1356,10 +1357,12 @@ discard block |
||
| 1356 | 1357 | if (function_exists('mime_content_type')) |
| 1357 | 1358 | { |
| 1358 | 1359 | $this->file_type = @mime_content_type($file['tmp_name']); |
| 1359 | - if (strlen($this->file_type) > 0) // It's possible that mime_content_type() returns FALSE or an empty string |
|
| 1360 | + if (strlen($this->file_type) > 0) { |
|
| 1361 | + // It's possible that mime_content_type() returns FALSE or an empty string |
|
| 1360 | 1362 | { |
| 1361 | 1363 | return; |
| 1362 | 1364 | } |
| 1365 | + } |
|
| 1363 | 1366 | } |
| 1364 | 1367 | |
| 1365 | 1368 | $this->file_type = $file['type']; |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -315,8 +312,7 @@ discard block |
||
| 315 | 312 | } |
| 316 | 313 | |
| 317 | 314 | log_message('info', 'CI_Model class loaded'); |
| 318 | - } |
|
| 319 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 315 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 320 | 316 | { |
| 321 | 317 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 322 | 318 | } |
@@ -477,8 +473,7 @@ discard block |
||
| 477 | 473 | require_once($driver_path); |
| 478 | 474 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 479 | 475 | } |
| 480 | - } |
|
| 481 | - else |
|
| 476 | + } else |
|
| 482 | 477 | { |
| 483 | 478 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 484 | 479 | } |
@@ -765,16 +760,14 @@ discard block |
||
| 765 | 760 | if (is_int($key)) |
| 766 | 761 | { |
| 767 | 762 | $this->driver($value, $params); |
| 768 | - } |
|
| 769 | - else |
|
| 763 | + } else |
|
| 770 | 764 | { |
| 771 | 765 | $this->driver($key, $params, $value); |
| 772 | 766 | } |
| 773 | 767 | } |
| 774 | 768 | |
| 775 | 769 | return $this; |
| 776 | - } |
|
| 777 | - elseif (empty($library)) |
|
| 770 | + } elseif (empty($library)) |
|
| 778 | 771 | { |
| 779 | 772 | return FALSE; |
| 780 | 773 | } |
@@ -873,8 +866,7 @@ discard block |
||
| 873 | 866 | array_shift($this->_ci_helper_paths); |
| 874 | 867 | array_shift($this->_ci_view_paths); |
| 875 | 868 | array_pop($config->_config_paths); |
| 876 | - } |
|
| 877 | - else |
|
| 869 | + } else |
|
| 878 | 870 | { |
| 879 | 871 | $path = rtrim($path, '/').'/'; |
| 880 | 872 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -938,8 +930,7 @@ discard block |
||
| 938 | 930 | { |
| 939 | 931 | $_ci_x = explode('/', $_ci_path); |
| 940 | 932 | $_ci_file = end($_ci_x); |
| 941 | - } |
|
| 942 | - else |
|
| 933 | + } else |
|
| 943 | 934 | { |
| 944 | 935 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 945 | 936 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1006,8 +997,7 @@ discard block |
||
| 1006 | 997 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1007 | 998 | { |
| 1008 | 999 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1009 | - } |
|
| 1010 | - else |
|
| 1000 | + } else |
|
| 1011 | 1001 | { |
| 1012 | 1002 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1013 | 1003 | } |
@@ -1034,8 +1024,7 @@ discard block |
||
| 1034 | 1024 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1035 | 1025 | { |
| 1036 | 1026 | ob_end_flush(); |
| 1037 | - } |
|
| 1038 | - else |
|
| 1027 | + } else |
|
| 1039 | 1028 | { |
| 1040 | 1029 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1041 | 1030 | @ob_end_clean(); |
@@ -1075,8 +1064,7 @@ discard block |
||
| 1075 | 1064 | |
| 1076 | 1065 | // Get the filename from the path |
| 1077 | 1066 | $class = substr($class, $last_slash); |
| 1078 | - } |
|
| 1079 | - else |
|
| 1067 | + } else |
|
| 1080 | 1068 | { |
| 1081 | 1069 | $subdir = ''; |
| 1082 | 1070 | } |
@@ -1214,8 +1202,7 @@ discard block |
||
| 1214 | 1202 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1215 | 1203 | { |
| 1216 | 1204 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1217 | - } |
|
| 1218 | - else |
|
| 1205 | + } else |
|
| 1219 | 1206 | { |
| 1220 | 1207 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1221 | 1208 | } |
@@ -1279,8 +1266,7 @@ discard block |
||
| 1279 | 1266 | { |
| 1280 | 1267 | include($path.'config/'.strtolower($class).'.php'); |
| 1281 | 1268 | $found = TRUE; |
| 1282 | - } |
|
| 1283 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1269 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1284 | 1270 | { |
| 1285 | 1271 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1286 | 1272 | $found = TRUE; |
@@ -1290,8 +1276,7 @@ discard block |
||
| 1290 | 1276 | { |
| 1291 | 1277 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1292 | 1278 | $found = TRUE; |
| 1293 | - } |
|
| 1294 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1279 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1295 | 1280 | { |
| 1296 | 1281 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1297 | 1282 | $found = TRUE; |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -313,8 +310,7 @@ discard block |
||
| 313 | 310 | { |
| 314 | 311 | throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model"); |
| 315 | 312 | } |
| 316 | - } |
|
| 317 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 313 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 318 | 314 | { |
| 319 | 315 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 320 | 316 | } |
@@ -471,8 +467,7 @@ discard block |
||
| 471 | 467 | require_once($driver_path); |
| 472 | 468 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 473 | 469 | } |
| 474 | - } |
|
| 475 | - else |
|
| 470 | + } else |
|
| 476 | 471 | { |
| 477 | 472 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 478 | 473 | } |
@@ -761,16 +756,14 @@ discard block |
||
| 761 | 756 | if (is_int($key)) |
| 762 | 757 | { |
| 763 | 758 | $this->driver($value, $params); |
| 764 | - } |
|
| 765 | - else |
|
| 759 | + } else |
|
| 766 | 760 | { |
| 767 | 761 | $this->driver($key, $params, $value); |
| 768 | 762 | } |
| 769 | 763 | } |
| 770 | 764 | |
| 771 | 765 | return $this; |
| 772 | - } |
|
| 773 | - elseif (empty($library)) |
|
| 766 | + } elseif (empty($library)) |
|
| 774 | 767 | { |
| 775 | 768 | return FALSE; |
| 776 | 769 | } |
@@ -869,8 +862,7 @@ discard block |
||
| 869 | 862 | array_shift($this->_ci_helper_paths); |
| 870 | 863 | array_shift($this->_ci_view_paths); |
| 871 | 864 | array_pop($config->_config_paths); |
| 872 | - } |
|
| 873 | - else |
|
| 865 | + } else |
|
| 874 | 866 | { |
| 875 | 867 | $path = rtrim($path, '/').'/'; |
| 876 | 868 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -934,8 +926,7 @@ discard block |
||
| 934 | 926 | { |
| 935 | 927 | $_ci_x = explode('/', $_ci_path); |
| 936 | 928 | $_ci_file = end($_ci_x); |
| 937 | - } |
|
| 938 | - else |
|
| 929 | + } else |
|
| 939 | 930 | { |
| 940 | 931 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 941 | 932 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1002,8 +993,7 @@ discard block |
||
| 1002 | 993 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1003 | 994 | { |
| 1004 | 995 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1005 | - } |
|
| 1006 | - else |
|
| 996 | + } else |
|
| 1007 | 997 | { |
| 1008 | 998 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1009 | 999 | } |
@@ -1030,8 +1020,7 @@ discard block |
||
| 1030 | 1020 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1031 | 1021 | { |
| 1032 | 1022 | ob_end_flush(); |
| 1033 | - } |
|
| 1034 | - else |
|
| 1023 | + } else |
|
| 1035 | 1024 | { |
| 1036 | 1025 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1037 | 1026 | @ob_end_clean(); |
@@ -1071,8 +1060,7 @@ discard block |
||
| 1071 | 1060 | |
| 1072 | 1061 | // Get the filename from the path |
| 1073 | 1062 | $class = substr($class, $last_slash); |
| 1074 | - } |
|
| 1075 | - else |
|
| 1063 | + } else |
|
| 1076 | 1064 | { |
| 1077 | 1065 | $subdir = ''; |
| 1078 | 1066 | } |
@@ -1210,8 +1198,7 @@ discard block |
||
| 1210 | 1198 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1211 | 1199 | { |
| 1212 | 1200 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1213 | - } |
|
| 1214 | - else |
|
| 1201 | + } else |
|
| 1215 | 1202 | { |
| 1216 | 1203 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1217 | 1204 | } |
@@ -1227,8 +1214,7 @@ discard block |
||
| 1227 | 1214 | { |
| 1228 | 1215 | $prefix = config_item('subclass_prefix'); |
| 1229 | 1216 | break; |
| 1230 | - } |
|
| 1231 | - else |
|
| 1217 | + } else |
|
| 1232 | 1218 | { |
| 1233 | 1219 | log_message('debug', $path.' exists, but does not declare '.$subclass); |
| 1234 | 1220 | } |
@@ -1277,8 +1263,7 @@ discard block |
||
| 1277 | 1263 | { |
| 1278 | 1264 | include($path.'config/'.strtolower($class).'.php'); |
| 1279 | 1265 | $found = TRUE; |
| 1280 | - } |
|
| 1281 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1266 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1282 | 1267 | { |
| 1283 | 1268 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1284 | 1269 | $found = TRUE; |
@@ -1288,8 +1273,7 @@ discard block |
||
| 1288 | 1273 | { |
| 1289 | 1274 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1290 | 1275 | $found = TRUE; |
| 1291 | - } |
|
| 1292 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1276 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1293 | 1277 | { |
| 1294 | 1278 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1295 | 1279 | $found = TRUE; |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -313,8 +310,7 @@ discard block |
||
| 313 | 310 | { |
| 314 | 311 | throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model"); |
| 315 | 312 | } |
| 316 | - } |
|
| 317 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 313 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 318 | 314 | { |
| 319 | 315 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 320 | 316 | } |
@@ -471,8 +467,7 @@ discard block |
||
| 471 | 467 | require_once($driver_path); |
| 472 | 468 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 473 | 469 | } |
| 474 | - } |
|
| 475 | - else |
|
| 470 | + } else |
|
| 476 | 471 | { |
| 477 | 472 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 478 | 473 | } |
@@ -761,16 +756,14 @@ discard block |
||
| 761 | 756 | if (is_int($key)) |
| 762 | 757 | { |
| 763 | 758 | $this->driver($value, $params); |
| 764 | - } |
|
| 765 | - else |
|
| 759 | + } else |
|
| 766 | 760 | { |
| 767 | 761 | $this->driver($key, $params, $value); |
| 768 | 762 | } |
| 769 | 763 | } |
| 770 | 764 | |
| 771 | 765 | return $this; |
| 772 | - } |
|
| 773 | - elseif (empty($library)) |
|
| 766 | + } elseif (empty($library)) |
|
| 774 | 767 | { |
| 775 | 768 | return FALSE; |
| 776 | 769 | } |
@@ -869,8 +862,7 @@ discard block |
||
| 869 | 862 | array_shift($this->_ci_helper_paths); |
| 870 | 863 | array_shift($this->_ci_view_paths); |
| 871 | 864 | array_pop($config->_config_paths); |
| 872 | - } |
|
| 873 | - else |
|
| 865 | + } else |
|
| 874 | 866 | { |
| 875 | 867 | $path = rtrim($path, '/').'/'; |
| 876 | 868 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -934,8 +926,7 @@ discard block |
||
| 934 | 926 | { |
| 935 | 927 | $_ci_x = explode('/', $_ci_path); |
| 936 | 928 | $_ci_file = end($_ci_x); |
| 937 | - } |
|
| 938 | - else |
|
| 929 | + } else |
|
| 939 | 930 | { |
| 940 | 931 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 941 | 932 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1013,8 +1004,7 @@ discard block |
||
| 1013 | 1004 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1014 | 1005 | { |
| 1015 | 1006 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1016 | - } |
|
| 1017 | - else |
|
| 1007 | + } else |
|
| 1018 | 1008 | { |
| 1019 | 1009 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1020 | 1010 | } |
@@ -1041,8 +1031,7 @@ discard block |
||
| 1041 | 1031 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1042 | 1032 | { |
| 1043 | 1033 | ob_end_flush(); |
| 1044 | - } |
|
| 1045 | - else |
|
| 1034 | + } else |
|
| 1046 | 1035 | { |
| 1047 | 1036 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1048 | 1037 | @ob_end_clean(); |
@@ -1082,8 +1071,7 @@ discard block |
||
| 1082 | 1071 | |
| 1083 | 1072 | // Get the filename from the path |
| 1084 | 1073 | $class = substr($class, $last_slash); |
| 1085 | - } |
|
| 1086 | - else |
|
| 1074 | + } else |
|
| 1087 | 1075 | { |
| 1088 | 1076 | $subdir = ''; |
| 1089 | 1077 | } |
@@ -1221,8 +1209,7 @@ discard block |
||
| 1221 | 1209 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1222 | 1210 | { |
| 1223 | 1211 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1224 | - } |
|
| 1225 | - else |
|
| 1212 | + } else |
|
| 1226 | 1213 | { |
| 1227 | 1214 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1228 | 1215 | } |
@@ -1238,8 +1225,7 @@ discard block |
||
| 1238 | 1225 | { |
| 1239 | 1226 | $prefix = config_item('subclass_prefix'); |
| 1240 | 1227 | break; |
| 1241 | - } |
|
| 1242 | - else |
|
| 1228 | + } else |
|
| 1243 | 1229 | { |
| 1244 | 1230 | log_message('debug', $path.' exists, but does not declare '.$subclass); |
| 1245 | 1231 | } |
@@ -1288,8 +1274,7 @@ discard block |
||
| 1288 | 1274 | { |
| 1289 | 1275 | include($path.'config/'.strtolower($class).'.php'); |
| 1290 | 1276 | $found = TRUE; |
| 1291 | - } |
|
| 1292 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1277 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1293 | 1278 | { |
| 1294 | 1279 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1295 | 1280 | $found = TRUE; |
@@ -1299,8 +1284,7 @@ discard block |
||
| 1299 | 1284 | { |
| 1300 | 1285 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1301 | 1286 | $found = TRUE; |
| 1302 | - } |
|
| 1303 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1287 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1304 | 1288 | { |
| 1305 | 1289 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1306 | 1290 | $found = TRUE; |
@@ -1496,8 +1480,7 @@ discard block |
||
| 1496 | 1480 | if ( ! is_array($filename)) |
| 1497 | 1481 | { |
| 1498 | 1482 | return array(strtolower(str_replace(array($extension, '.php'), '', $filename).$extension)); |
| 1499 | - } |
|
| 1500 | - else |
|
| 1483 | + } else |
|
| 1501 | 1484 | { |
| 1502 | 1485 | foreach ($filename as $key => $val) |
| 1503 | 1486 | { |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -313,8 +310,7 @@ discard block |
||
| 313 | 310 | { |
| 314 | 311 | throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model"); |
| 315 | 312 | } |
| 316 | - } |
|
| 317 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 313 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 318 | 314 | { |
| 319 | 315 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 320 | 316 | } |
@@ -471,8 +467,7 @@ discard block |
||
| 471 | 467 | require_once($driver_path); |
| 472 | 468 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 473 | 469 | } |
| 474 | - } |
|
| 475 | - else |
|
| 470 | + } else |
|
| 476 | 471 | { |
| 477 | 472 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 478 | 473 | } |
@@ -759,16 +754,14 @@ discard block |
||
| 759 | 754 | if (is_int($key)) |
| 760 | 755 | { |
| 761 | 756 | $this->driver($value, $params); |
| 762 | - } |
|
| 763 | - else |
|
| 757 | + } else |
|
| 764 | 758 | { |
| 765 | 759 | $this->driver($key, $params, $value); |
| 766 | 760 | } |
| 767 | 761 | } |
| 768 | 762 | |
| 769 | 763 | return $this; |
| 770 | - } |
|
| 771 | - elseif (empty($library)) |
|
| 764 | + } elseif (empty($library)) |
|
| 772 | 765 | { |
| 773 | 766 | return FALSE; |
| 774 | 767 | } |
@@ -867,8 +860,7 @@ discard block |
||
| 867 | 860 | array_shift($this->_ci_helper_paths); |
| 868 | 861 | array_shift($this->_ci_view_paths); |
| 869 | 862 | array_pop($config->_config_paths); |
| 870 | - } |
|
| 871 | - else |
|
| 863 | + } else |
|
| 872 | 864 | { |
| 873 | 865 | $path = rtrim($path, '/').'/'; |
| 874 | 866 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -932,8 +924,7 @@ discard block |
||
| 932 | 924 | { |
| 933 | 925 | $_ci_x = explode('/', $_ci_path); |
| 934 | 926 | $_ci_file = end($_ci_x); |
| 935 | - } |
|
| 936 | - else |
|
| 927 | + } else |
|
| 937 | 928 | { |
| 938 | 929 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 939 | 930 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1000,8 +991,7 @@ discard block |
||
| 1000 | 991 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1001 | 992 | { |
| 1002 | 993 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1003 | - } |
|
| 1004 | - else |
|
| 994 | + } else |
|
| 1005 | 995 | { |
| 1006 | 996 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1007 | 997 | } |
@@ -1028,8 +1018,7 @@ discard block |
||
| 1028 | 1018 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1029 | 1019 | { |
| 1030 | 1020 | ob_end_flush(); |
| 1031 | - } |
|
| 1032 | - else |
|
| 1021 | + } else |
|
| 1033 | 1022 | { |
| 1034 | 1023 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1035 | 1024 | @ob_end_clean(); |
@@ -1069,8 +1058,7 @@ discard block |
||
| 1069 | 1058 | |
| 1070 | 1059 | // Get the filename from the path |
| 1071 | 1060 | $class = substr($class, $last_slash); |
| 1072 | - } |
|
| 1073 | - else |
|
| 1061 | + } else |
|
| 1074 | 1062 | { |
| 1075 | 1063 | $subdir = ''; |
| 1076 | 1064 | } |
@@ -1208,8 +1196,7 @@ discard block |
||
| 1208 | 1196 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1209 | 1197 | { |
| 1210 | 1198 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1211 | - } |
|
| 1212 | - else |
|
| 1199 | + } else |
|
| 1213 | 1200 | { |
| 1214 | 1201 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1215 | 1202 | } |
@@ -1273,8 +1260,7 @@ discard block |
||
| 1273 | 1260 | { |
| 1274 | 1261 | include($path.'config/'.strtolower($class).'.php'); |
| 1275 | 1262 | $found = TRUE; |
| 1276 | - } |
|
| 1277 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1263 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1278 | 1264 | { |
| 1279 | 1265 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1280 | 1266 | $found = TRUE; |
@@ -1284,8 +1270,7 @@ discard block |
||
| 1284 | 1270 | { |
| 1285 | 1271 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1286 | 1272 | $found = TRUE; |
| 1287 | - } |
|
| 1288 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1273 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1289 | 1274 | { |
| 1290 | 1275 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1291 | 1276 | $found = TRUE; |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -315,8 +312,7 @@ discard block |
||
| 315 | 312 | } |
| 316 | 313 | |
| 317 | 314 | log_message('info', 'CI_Model class loaded'); |
| 318 | - } |
|
| 319 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 315 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 320 | 316 | { |
| 321 | 317 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 322 | 318 | } |
@@ -477,8 +473,7 @@ discard block |
||
| 477 | 473 | require_once($driver_path); |
| 478 | 474 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 479 | 475 | } |
| 480 | - } |
|
| 481 | - else |
|
| 476 | + } else |
|
| 482 | 477 | { |
| 483 | 478 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 484 | 479 | } |
@@ -765,16 +760,14 @@ discard block |
||
| 765 | 760 | if (is_int($key)) |
| 766 | 761 | { |
| 767 | 762 | $this->driver($value, $params); |
| 768 | - } |
|
| 769 | - else |
|
| 763 | + } else |
|
| 770 | 764 | { |
| 771 | 765 | $this->driver($key, $params, $value); |
| 772 | 766 | } |
| 773 | 767 | } |
| 774 | 768 | |
| 775 | 769 | return $this; |
| 776 | - } |
|
| 777 | - elseif (empty($library)) |
|
| 770 | + } elseif (empty($library)) |
|
| 778 | 771 | { |
| 779 | 772 | return FALSE; |
| 780 | 773 | } |
@@ -873,8 +866,7 @@ discard block |
||
| 873 | 866 | array_shift($this->_ci_helper_paths); |
| 874 | 867 | array_shift($this->_ci_view_paths); |
| 875 | 868 | array_pop($config->_config_paths); |
| 876 | - } |
|
| 877 | - else |
|
| 869 | + } else |
|
| 878 | 870 | { |
| 879 | 871 | $path = rtrim($path, '/').'/'; |
| 880 | 872 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -938,8 +930,7 @@ discard block |
||
| 938 | 930 | { |
| 939 | 931 | $_ci_x = explode('/', $_ci_path); |
| 940 | 932 | $_ci_file = end($_ci_x); |
| 941 | - } |
|
| 942 | - else |
|
| 933 | + } else |
|
| 943 | 934 | { |
| 944 | 935 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 945 | 936 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1006,8 +997,7 @@ discard block |
||
| 1006 | 997 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1007 | 998 | { |
| 1008 | 999 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1009 | - } |
|
| 1010 | - else |
|
| 1000 | + } else |
|
| 1011 | 1001 | { |
| 1012 | 1002 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1013 | 1003 | } |
@@ -1034,8 +1024,7 @@ discard block |
||
| 1034 | 1024 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1035 | 1025 | { |
| 1036 | 1026 | ob_end_flush(); |
| 1037 | - } |
|
| 1038 | - else |
|
| 1027 | + } else |
|
| 1039 | 1028 | { |
| 1040 | 1029 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1041 | 1030 | @ob_end_clean(); |
@@ -1075,8 +1064,7 @@ discard block |
||
| 1075 | 1064 | |
| 1076 | 1065 | // Get the filename from the path |
| 1077 | 1066 | $class = substr($class, $last_slash); |
| 1078 | - } |
|
| 1079 | - else |
|
| 1067 | + } else |
|
| 1080 | 1068 | { |
| 1081 | 1069 | $subdir = ''; |
| 1082 | 1070 | } |
@@ -1214,8 +1202,7 @@ discard block |
||
| 1214 | 1202 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1215 | 1203 | { |
| 1216 | 1204 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1217 | - } |
|
| 1218 | - else |
|
| 1205 | + } else |
|
| 1219 | 1206 | { |
| 1220 | 1207 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1221 | 1208 | } |
@@ -1279,8 +1266,7 @@ discard block |
||
| 1279 | 1266 | { |
| 1280 | 1267 | include($path.'config/'.strtolower($class).'.php'); |
| 1281 | 1268 | $found = TRUE; |
| 1282 | - } |
|
| 1283 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1269 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1284 | 1270 | { |
| 1285 | 1271 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1286 | 1272 | $found = TRUE; |
@@ -1290,8 +1276,7 @@ discard block |
||
| 1290 | 1276 | { |
| 1291 | 1277 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1292 | 1278 | $found = TRUE; |
| 1293 | - } |
|
| 1294 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1279 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1295 | 1280 | { |
| 1296 | 1281 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1297 | 1282 | $found = TRUE; |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -315,8 +312,7 @@ discard block |
||
| 315 | 312 | } |
| 316 | 313 | |
| 317 | 314 | log_message('info', 'CI_Model class loaded'); |
| 318 | - } |
|
| 319 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 315 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 320 | 316 | { |
| 321 | 317 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 322 | 318 | } |
@@ -477,8 +473,7 @@ discard block |
||
| 477 | 473 | require_once($driver_path); |
| 478 | 474 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 479 | 475 | } |
| 480 | - } |
|
| 481 | - else |
|
| 476 | + } else |
|
| 482 | 477 | { |
| 483 | 478 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 484 | 479 | } |
@@ -765,16 +760,14 @@ discard block |
||
| 765 | 760 | if (is_int($key)) |
| 766 | 761 | { |
| 767 | 762 | $this->driver($value, $params); |
| 768 | - } |
|
| 769 | - else |
|
| 763 | + } else |
|
| 770 | 764 | { |
| 771 | 765 | $this->driver($key, $params, $value); |
| 772 | 766 | } |
| 773 | 767 | } |
| 774 | 768 | |
| 775 | 769 | return $this; |
| 776 | - } |
|
| 777 | - elseif (empty($library)) |
|
| 770 | + } elseif (empty($library)) |
|
| 778 | 771 | { |
| 779 | 772 | return FALSE; |
| 780 | 773 | } |
@@ -873,8 +866,7 @@ discard block |
||
| 873 | 866 | array_shift($this->_ci_helper_paths); |
| 874 | 867 | array_shift($this->_ci_view_paths); |
| 875 | 868 | array_pop($config->_config_paths); |
| 876 | - } |
|
| 877 | - else |
|
| 869 | + } else |
|
| 878 | 870 | { |
| 879 | 871 | $path = rtrim($path, '/').'/'; |
| 880 | 872 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -938,8 +930,7 @@ discard block |
||
| 938 | 930 | { |
| 939 | 931 | $_ci_x = explode('/', $_ci_path); |
| 940 | 932 | $_ci_file = end($_ci_x); |
| 941 | - } |
|
| 942 | - else |
|
| 933 | + } else |
|
| 943 | 934 | { |
| 944 | 935 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 945 | 936 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1006,8 +997,7 @@ discard block |
||
| 1006 | 997 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1007 | 998 | { |
| 1008 | 999 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1009 | - } |
|
| 1010 | - else |
|
| 1000 | + } else |
|
| 1011 | 1001 | { |
| 1012 | 1002 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1013 | 1003 | } |
@@ -1034,8 +1024,7 @@ discard block |
||
| 1034 | 1024 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1035 | 1025 | { |
| 1036 | 1026 | ob_end_flush(); |
| 1037 | - } |
|
| 1038 | - else |
|
| 1027 | + } else |
|
| 1039 | 1028 | { |
| 1040 | 1029 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1041 | 1030 | @ob_end_clean(); |
@@ -1075,8 +1064,7 @@ discard block |
||
| 1075 | 1064 | |
| 1076 | 1065 | // Get the filename from the path |
| 1077 | 1066 | $class = substr($class, $last_slash); |
| 1078 | - } |
|
| 1079 | - else |
|
| 1067 | + } else |
|
| 1080 | 1068 | { |
| 1081 | 1069 | $subdir = ''; |
| 1082 | 1070 | } |
@@ -1214,8 +1202,7 @@ discard block |
||
| 1214 | 1202 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1215 | 1203 | { |
| 1216 | 1204 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1217 | - } |
|
| 1218 | - else |
|
| 1205 | + } else |
|
| 1219 | 1206 | { |
| 1220 | 1207 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1221 | 1208 | } |
@@ -1279,8 +1266,7 @@ discard block |
||
| 1279 | 1266 | { |
| 1280 | 1267 | include($path.'config/'.strtolower($class).'.php'); |
| 1281 | 1268 | $found = TRUE; |
| 1282 | - } |
|
| 1283 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1269 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1284 | 1270 | { |
| 1285 | 1271 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1286 | 1272 | $found = TRUE; |
@@ -1290,8 +1276,7 @@ discard block |
||
| 1290 | 1276 | { |
| 1291 | 1277 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1292 | 1278 | $found = TRUE; |
| 1293 | - } |
|
| 1294 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1279 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1295 | 1280 | { |
| 1296 | 1281 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1297 | 1282 | $found = TRUE; |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -313,8 +310,7 @@ discard block |
||
| 313 | 310 | { |
| 314 | 311 | throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model"); |
| 315 | 312 | } |
| 316 | - } |
|
| 317 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 313 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 318 | 314 | { |
| 319 | 315 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 320 | 316 | } |
@@ -471,8 +467,7 @@ discard block |
||
| 471 | 467 | require_once($driver_path); |
| 472 | 468 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 473 | 469 | } |
| 474 | - } |
|
| 475 | - else |
|
| 470 | + } else |
|
| 476 | 471 | { |
| 477 | 472 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 478 | 473 | } |
@@ -761,16 +756,14 @@ discard block |
||
| 761 | 756 | if (is_int($key)) |
| 762 | 757 | { |
| 763 | 758 | $this->driver($value, $params); |
| 764 | - } |
|
| 765 | - else |
|
| 759 | + } else |
|
| 766 | 760 | { |
| 767 | 761 | $this->driver($key, $params, $value); |
| 768 | 762 | } |
| 769 | 763 | } |
| 770 | 764 | |
| 771 | 765 | return $this; |
| 772 | - } |
|
| 773 | - elseif (empty($library)) |
|
| 766 | + } elseif (empty($library)) |
|
| 774 | 767 | { |
| 775 | 768 | return FALSE; |
| 776 | 769 | } |
@@ -869,8 +862,7 @@ discard block |
||
| 869 | 862 | array_shift($this->_ci_helper_paths); |
| 870 | 863 | array_shift($this->_ci_view_paths); |
| 871 | 864 | array_pop($config->_config_paths); |
| 872 | - } |
|
| 873 | - else |
|
| 865 | + } else |
|
| 874 | 866 | { |
| 875 | 867 | $path = rtrim($path, '/').'/'; |
| 876 | 868 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -934,8 +926,7 @@ discard block |
||
| 934 | 926 | { |
| 935 | 927 | $_ci_x = explode('/', $_ci_path); |
| 936 | 928 | $_ci_file = end($_ci_x); |
| 937 | - } |
|
| 938 | - else |
|
| 929 | + } else |
|
| 939 | 930 | { |
| 940 | 931 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 941 | 932 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1002,8 +993,7 @@ discard block |
||
| 1002 | 993 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1003 | 994 | { |
| 1004 | 995 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1005 | - } |
|
| 1006 | - else |
|
| 996 | + } else |
|
| 1007 | 997 | { |
| 1008 | 998 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1009 | 999 | } |
@@ -1030,8 +1020,7 @@ discard block |
||
| 1030 | 1020 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1031 | 1021 | { |
| 1032 | 1022 | ob_end_flush(); |
| 1033 | - } |
|
| 1034 | - else |
|
| 1023 | + } else |
|
| 1035 | 1024 | { |
| 1036 | 1025 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1037 | 1026 | @ob_end_clean(); |
@@ -1071,8 +1060,7 @@ discard block |
||
| 1071 | 1060 | |
| 1072 | 1061 | // Get the filename from the path |
| 1073 | 1062 | $class = substr($class, $last_slash); |
| 1074 | - } |
|
| 1075 | - else |
|
| 1063 | + } else |
|
| 1076 | 1064 | { |
| 1077 | 1065 | $subdir = ''; |
| 1078 | 1066 | } |
@@ -1210,8 +1198,7 @@ discard block |
||
| 1210 | 1198 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1211 | 1199 | { |
| 1212 | 1200 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1213 | - } |
|
| 1214 | - else |
|
| 1201 | + } else |
|
| 1215 | 1202 | { |
| 1216 | 1203 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1217 | 1204 | } |
@@ -1227,8 +1214,7 @@ discard block |
||
| 1227 | 1214 | { |
| 1228 | 1215 | $prefix = config_item('subclass_prefix'); |
| 1229 | 1216 | break; |
| 1230 | - } |
|
| 1231 | - else |
|
| 1217 | + } else |
|
| 1232 | 1218 | { |
| 1233 | 1219 | log_message('debug', $path.' exists, but does not declare '.$subclass); |
| 1234 | 1220 | } |
@@ -1277,8 +1263,7 @@ discard block |
||
| 1277 | 1263 | { |
| 1278 | 1264 | include($path.'config/'.strtolower($class).'.php'); |
| 1279 | 1265 | $found = TRUE; |
| 1280 | - } |
|
| 1281 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1266 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1282 | 1267 | { |
| 1283 | 1268 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1284 | 1269 | $found = TRUE; |
@@ -1288,8 +1273,7 @@ discard block |
||
| 1288 | 1273 | { |
| 1289 | 1274 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1290 | 1275 | $found = TRUE; |
| 1291 | - } |
|
| 1292 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1276 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1293 | 1277 | { |
| 1294 | 1278 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1295 | 1279 | $found = TRUE; |
@@ -200,16 +200,14 @@ discard block |
||
| 200 | 200 | if (empty($library)) |
| 201 | 201 | { |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 204 | - elseif (is_array($library)) |
|
| 203 | + } elseif (is_array($library)) |
|
| 205 | 204 | { |
| 206 | 205 | foreach ($library as $key => $value) |
| 207 | 206 | { |
| 208 | 207 | if (is_int($key)) |
| 209 | 208 | { |
| 210 | 209 | $this->library($value, $params); |
| 211 | - } |
|
| 212 | - else |
|
| 210 | + } else |
|
| 213 | 211 | { |
| 214 | 212 | $this->library($key, $params, $value); |
| 215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | if (empty($model)) |
| 247 | 245 | { |
| 248 | 246 | return $this; |
| 249 | - } |
|
| 250 | - elseif (is_array($model)) |
|
| 247 | + } elseif (is_array($model)) |
|
| 251 | 248 | { |
| 252 | 249 | foreach ($model as $key => $value) |
| 253 | 250 | { |
@@ -313,8 +310,7 @@ discard block |
||
| 313 | 310 | { |
| 314 | 311 | throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model"); |
| 315 | 312 | } |
| 316 | - } |
|
| 317 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 313 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
| 318 | 314 | { |
| 319 | 315 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
| 320 | 316 | } |
@@ -471,8 +467,7 @@ discard block |
||
| 471 | 467 | require_once($driver_path); |
| 472 | 468 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
| 473 | 469 | } |
| 474 | - } |
|
| 475 | - else |
|
| 470 | + } else |
|
| 476 | 471 | { |
| 477 | 472 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
| 478 | 473 | } |
@@ -761,16 +756,14 @@ discard block |
||
| 761 | 756 | if (is_int($key)) |
| 762 | 757 | { |
| 763 | 758 | $this->driver($value, $params); |
| 764 | - } |
|
| 765 | - else |
|
| 759 | + } else |
|
| 766 | 760 | { |
| 767 | 761 | $this->driver($key, $params, $value); |
| 768 | 762 | } |
| 769 | 763 | } |
| 770 | 764 | |
| 771 | 765 | return $this; |
| 772 | - } |
|
| 773 | - elseif (empty($library)) |
|
| 766 | + } elseif (empty($library)) |
|
| 774 | 767 | { |
| 775 | 768 | return FALSE; |
| 776 | 769 | } |
@@ -869,8 +862,7 @@ discard block |
||
| 869 | 862 | array_shift($this->_ci_helper_paths); |
| 870 | 863 | array_shift($this->_ci_view_paths); |
| 871 | 864 | array_pop($config->_config_paths); |
| 872 | - } |
|
| 873 | - else |
|
| 865 | + } else |
|
| 874 | 866 | { |
| 875 | 867 | $path = rtrim($path, '/').'/'; |
| 876 | 868 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -934,8 +926,7 @@ discard block |
||
| 934 | 926 | { |
| 935 | 927 | $_ci_x = explode('/', $_ci_path); |
| 936 | 928 | $_ci_file = end($_ci_x); |
| 937 | - } |
|
| 938 | - else |
|
| 929 | + } else |
|
| 939 | 930 | { |
| 940 | 931 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
| 941 | 932 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1002,8 +993,7 @@ discard block |
||
| 1002 | 993 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
| 1003 | 994 | { |
| 1004 | 995 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 1005 | - } |
|
| 1006 | - else |
|
| 996 | + } else |
|
| 1007 | 997 | { |
| 1008 | 998 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
| 1009 | 999 | } |
@@ -1030,8 +1020,7 @@ discard block |
||
| 1030 | 1020 | if (ob_get_level() > $this->_ci_ob_level + 1) |
| 1031 | 1021 | { |
| 1032 | 1022 | ob_end_flush(); |
| 1033 | - } |
|
| 1034 | - else |
|
| 1023 | + } else |
|
| 1035 | 1024 | { |
| 1036 | 1025 | $_ci_CI->output->append_output(ob_get_contents()); |
| 1037 | 1026 | @ob_end_clean(); |
@@ -1071,8 +1060,7 @@ discard block |
||
| 1071 | 1060 | |
| 1072 | 1061 | // Get the filename from the path |
| 1073 | 1062 | $class = substr($class, $last_slash); |
| 1074 | - } |
|
| 1075 | - else |
|
| 1063 | + } else |
|
| 1076 | 1064 | { |
| 1077 | 1065 | $subdir = ''; |
| 1078 | 1066 | } |
@@ -1210,8 +1198,7 @@ discard block |
||
| 1210 | 1198 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
| 1211 | 1199 | { |
| 1212 | 1200 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
| 1213 | - } |
|
| 1214 | - else |
|
| 1201 | + } else |
|
| 1215 | 1202 | { |
| 1216 | 1203 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
| 1217 | 1204 | } |
@@ -1227,8 +1214,7 @@ discard block |
||
| 1227 | 1214 | { |
| 1228 | 1215 | $prefix = config_item('subclass_prefix'); |
| 1229 | 1216 | break; |
| 1230 | - } |
|
| 1231 | - else |
|
| 1217 | + } else |
|
| 1232 | 1218 | { |
| 1233 | 1219 | log_message('debug', $path.' exists, but does not declare '.$subclass); |
| 1234 | 1220 | } |
@@ -1277,8 +1263,7 @@ discard block |
||
| 1277 | 1263 | { |
| 1278 | 1264 | include($path.'config/'.strtolower($class).'.php'); |
| 1279 | 1265 | $found = TRUE; |
| 1280 | - } |
|
| 1281 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1266 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1282 | 1267 | { |
| 1283 | 1268 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
| 1284 | 1269 | $found = TRUE; |
@@ -1288,8 +1273,7 @@ discard block |
||
| 1288 | 1273 | { |
| 1289 | 1274 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
| 1290 | 1275 | $found = TRUE; |
| 1291 | - } |
|
| 1292 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1276 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1293 | 1277 | { |
| 1294 | 1278 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
| 1295 | 1279 | $found = TRUE; |