From 0b59f270a432f8c7b6128981f0a39b4a2e2fbd34 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 13 May 2008 04:22:33 +0000 Subject: Some sweeping syntax changes for consistency: (! foo) changed to ( ! foo) || changed to OR changed newline standardization code in various places from preg_replace to str_replace --- system/libraries/Loader.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'system/libraries/Loader.php') diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 7c6da8849..5e3819ea6 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -1,4 +1,4 @@ -load->database($db_conn, FALSE, TRUE); } - if (! class_exists('Model')) + if ( ! class_exists('Model')) { load_class('Model', FALSE); } @@ -230,7 +230,7 @@ class CI_Loader { */ function dbutil() { - if (! class_exists('CI_DB')) + if ( ! class_exists('CI_DB')) { $this->database(); } @@ -260,7 +260,7 @@ class CI_Loader { */ function dbforge() { - if (! class_exists('CI_DB')) + if ( ! class_exists('CI_DB')) { $this->database(); } @@ -355,7 +355,7 @@ class CI_Loader { */ function helper($helpers = array()) { - if (! is_array($helpers)) + if ( ! is_array($helpers)) { $helpers = array($helpers); } @@ -376,7 +376,7 @@ class CI_Loader { { $base_helper = BASEPATH.'helpers/'.$helper.EXT; - if (! file_exists($base_helper)) + if ( ! file_exists($base_helper)) { show_error('Unable to load the requested file: helpers/'.$helper.EXT); } @@ -437,7 +437,7 @@ class CI_Loader { */ function plugin($plugins = array()) { - if (! is_array($plugins)) + if ( ! is_array($plugins)) { $plugins = array($plugins); } @@ -507,7 +507,7 @@ class CI_Loader { */ function script($scripts = array()) { - if (! is_array($scripts)) + if ( ! is_array($scripts)) { $scripts = array($scripts); } @@ -521,7 +521,7 @@ class CI_Loader { continue; } - if (! file_exists(APPPATH.'scripts/'.$script.EXT)) + if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) { show_error('Unable to load the requested script: scripts/'.$script.EXT); } @@ -546,7 +546,7 @@ class CI_Loader { { $CI =& get_instance(); - if (! is_array($file)) + if ( ! is_array($file)) { $file = array($file); } @@ -632,7 +632,7 @@ class CI_Loader { // Set the default data variables foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val) { - $$_ci_val = (! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; + $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; } // Set the path to the requested file @@ -648,7 +648,7 @@ class CI_Loader { $_ci_file = end($_ci_x); } - if (! file_exists($_ci_path)) + if ( ! file_exists($_ci_path)) { show_error('Unable to load the requested file: '.$_ci_file); } @@ -662,7 +662,7 @@ class CI_Loader { $_ci_CI =& get_instance(); foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var) { - if (! isset($this->$_ci_key)) + if ( ! isset($this->$_ci_key)) { $this->$_ci_key =& $_ci_CI->$_ci_key; } @@ -703,7 +703,7 @@ class CI_Loader { if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) { - echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('/", "; ?>", str_replace('_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; // Instantiate the class $CI =& get_instance(); @@ -890,7 +890,7 @@ class CI_Loader { { include_once(APPPATH.'config/autoload'.EXT); - if (! isset($autoload)) + if ( ! isset($autoload)) { return FALSE; } @@ -918,7 +918,7 @@ class CI_Loader { // A little tweak to remain backward compatible // The $autoload['core'] item was deprecated - if (! isset($autoload['libraries'])) + if ( ! isset($autoload['libraries'])) { $autoload['libraries'] = $autoload['core']; } -- cgit v1.2.3-24-g4f1b