From 6a15b2d8e84b38e1a42d7c27ae2f6ed393e72399 Mon Sep 17 00:00:00 2001 From: Tom Klingenberg Date: Fri, 7 Oct 2011 20:03:30 +0200 Subject: CI_Loader::driver() processes empty library. Fixed. This causes endless recursion calls _ci_load_class(), see #550 --- system/core/Loader.php | 5 +++++ 1 file changed, 5 insertions(+) mode change 100755 => 100644 system/core/Loader.php (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php old mode 100755 new mode 100644 index de0fc06d2..5539aae14 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -616,6 +616,11 @@ class CI_Loader { require BASEPATH.'libraries/Driver.php'; } + if ($library == '') + { + return FALSE; + } + // We can save the loader some time since Drivers will *always* be in a subfolder, // and typically identically named to the library if ( ! strpos($library, '/')) -- cgit v1.2.3-24-g4f1b From f4a4bd8fac188ebc9cda822ffc811c218fd92b45 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 20 Oct 2011 12:18:42 -0500 Subject: adding new license file (OSL 3.0) and updating readme to ReST added notice of license to all source files. OSL to all except the few files we ship inside of the application folder, those are AFL. Updated license in user guide. incrementing next dev version to 3.0 due to licensing change --- system/core/Loader.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 5539aae14..4e14b54af 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -22,7 +34,7 @@ * * @package CodeIgniter * @subpackage Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @category Loader * @link http://codeigniter.com/user_guide/libraries/loader.html */ -- cgit v1.2.3-24-g4f1b From 81dd22393368862760e1cfb30a0d73d070cd38af Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Fri, 18 Nov 2011 20:49:35 -0600 Subject: add method get_vars() to CI_Loader to retrieve all variables loaded with $this->load->vars() --- system/core/Loader.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 4e14b54af..d42dbbf38 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -494,6 +494,20 @@ class CI_Loader { // -------------------------------------------------------------------- + /** + * Get Variables + * + * Retrieve all loaded variables + * + * @return array + */ + public function get_vars() + { + return $this->_ci_cached_vars; + } + + // -------------------------------------------------------------------- + /** * Load Helper * -- cgit v1.2.3-24-g4f1b From 5c1aa631c5f5ec2f6b75ba1158178418e50ba11a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 25 Dec 2011 01:24:29 -0600 Subject: Abstracting the loading of files in the config directory depending on environments. --- system/core/Loader.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 4e14b54af..12d07bbe0 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1125,14 +1125,7 @@ class CI_Loader { */ protected function _ci_autoloader() { - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) - { - include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); - } - else - { - include(APPPATH.'config/autoload.php'); - } + load_environ_config('autoload'); if ( ! isset($autoload)) { -- cgit v1.2.3-24-g4f1b From d96f88277c1e9a4c069c2e2ee3d779385549f31a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 27 Dec 2011 16:23:47 -0600 Subject: Revert "Abstracting the loading of files in the config directory depending on environments." This reverts commit 5c1aa631c5f5ec2f6b75ba1158178418e50ba11a. --- system/core/Loader.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 83d134ef4..d42dbbf38 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1139,7 +1139,14 @@ class CI_Loader { */ protected function _ci_autoloader() { - load_environ_config('autoload'); + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) + { + include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); + } + else + { + include(APPPATH.'config/autoload.php'); + } if ( ! isset($autoload)) { -- cgit v1.2.3-24-g4f1b From 0defe5d33ee2633f377a109519ca818becc60f64 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 1 Jan 2012 18:46:41 -0600 Subject: Updating copyright date to 2012 --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index d42dbbf38..c4a6b501c 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From d72973519623f40f121e9cd2df93146ee2543a1f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 7 Jan 2012 22:53:14 +0200 Subject: Improve the core Loader library --- system/core/Loader.php | 90 +++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 53 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index c4a6b501c..689ae1ecd 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1,13 +1,13 @@ - 'unit', - 'user_agent' => 'agent'); + protected $_ci_varmap = array( + 'unit_test' => 'unit', + 'user_agent' => 'agent' + ); /** * Constructor @@ -141,7 +130,7 @@ class CI_Loader { $this->_ci_model_paths = array(APPPATH); $this->_ci_view_paths = array(VIEWPATH => TRUE); - log_message('debug', "Loader Class Initialized"); + log_message('debug', 'Loader Class Initialized'); } // -------------------------------------------------------------------- @@ -162,7 +151,6 @@ class CI_Loader { $this->_base_classes =& is_loaded(); $this->_ci_autoloader(); - return $this; } @@ -311,9 +299,7 @@ class CI_Loader { require_once($mod_path.'models/'.$path.$model.'.php'); $model = ucfirst($model); - $CI->$name = new $model(); - $this->_ci_models[] = $name; return; } @@ -350,7 +336,7 @@ class CI_Loader { return DB($params, $active_record); } - // Initialize the db variable. Needed to prevent + // Initialize the db variable. Needed to prevent // reference errors with some configurations $CI->db = ''; @@ -716,11 +702,11 @@ class CI_Loader { if ($path == '') { - $void = array_shift($this->_ci_library_paths); - $void = array_shift($this->_ci_model_paths); - $void = array_shift($this->_ci_helper_paths); - $void = array_shift($this->_ci_view_paths); - $void = array_shift($config->_config_paths); + array_shift($this->_ci_library_paths); + array_shift($this->_ci_model_paths); + array_shift($this->_ci_helper_paths); + array_shift($this->_ci_view_paths); + array_shift($config->_config_paths); } else { @@ -808,7 +794,6 @@ class CI_Loader { // This allows anything loaded using $this->load (views, files, etc.) // to become accessible from within the Controller and Model functions. - $_ci_CI =& get_instance(); foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var) { @@ -837,12 +822,11 @@ class CI_Loader { * * We buffer the output for two reasons: * 1. Speed. You get a significant speed boost. - * 2. So that the final rendered template can be - * post-processed by the output class. Why do we - * need post processing? For one thing, in order to - * show the elapsed page load time. Unless we - * can intercept the content right before it's sent to - * the browser and then stop the timer it won't be accurate. + * 2. So that the final rendered template can be post-processed by + * the output class. Why do we need post processing? For one thing, + * in order to show the elapsed page load time. Unless we can + * intercept the content right before it's sent to the browser and + * then stop the timer it won't be accurate. */ ob_start(); @@ -915,10 +899,10 @@ class CI_Loader { if (($last_slash = strrpos($class, '/')) !== FALSE) { // Extract the path - $subdir = substr($class, 0, $last_slash + 1); + $subdir = substr($class, 0, ++$last_slash); // Get the filename from the path - $class = substr($class, $last_slash + 1); + $class = substr($class, $last_slash); } // We'll test for both lowercase and capitalized versions of the file name @@ -933,15 +917,15 @@ class CI_Loader { if ( ! file_exists($baseclass)) { - log_message('error', "Unable to load the requested class: ".$class); - show_error("Unable to load the requested class: ".$class); + log_message('error', 'Unable to load the requested class: '.$class); + show_error('Unable to load the requested class: '.$class); } - // Safety: Was the class already loaded by a previous call? + // Safety: Was the class already loaded by a previous call? if (in_array($subclass, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see - // if a custom object name is being supplied. If so, we'll + // if a custom object name is being supplied. If so, we'll // return a new instance of the object if ( ! is_null($object_name)) { @@ -953,7 +937,7 @@ class CI_Loader { } $is_duplicate = TRUE; - log_message('debug', $class." class already loaded. Second attempt ignored."); + log_message('debug', $class.' class already loaded. Second attempt ignored.'); return; } @@ -970,17 +954,17 @@ class CI_Loader { { $filepath = $path.'libraries/'.$subdir.$class.'.php'; - // Does the file exist? No? Bummer... + // Does the file exist? No? Bummer... if ( ! file_exists($filepath)) { continue; } - // Safety: Was the class already loaded by a previous call? + // Safety: Was the class already loaded by a previous call? if (in_array($filepath, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see - // if a custom object name is being supplied. If so, we'll + // if a custom object name is being supplied. If so, we'll // return a new instance of the object if ( ! is_null($object_name)) { @@ -992,7 +976,7 @@ class CI_Loader { } $is_duplicate = TRUE; - log_message('debug', $class." class already loaded. Second attempt ignored."); + log_message('debug', $class.' class already loaded. Second attempt ignored.'); return; } @@ -1003,7 +987,7 @@ class CI_Loader { } // END FOREACH - // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified? + // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified? if ($subdir == '') { $path = strtolower($class).'/'.$class; @@ -1014,8 +998,8 @@ class CI_Loader { // We do not issue errors if the load call failed due to a duplicate request if ($is_duplicate == FALSE) { - log_message('error', "Unable to load the requested class: ".$class); - show_error("Unable to load the requested class: ".$class); + log_message('error', 'Unable to load the requested class: '.$class); + show_error('Unable to load the requested class: '.$class); } } @@ -1094,12 +1078,12 @@ class CI_Loader { // Is the class name valid? if ( ! class_exists($name)) { - log_message('error', "Non-existent class: ".$name); - show_error("Non-existent class: ".$class); + log_message('error', 'Non-existent class: '.$name); + show_error('Non-existent class: '.$class); } // Set the variable name we will assign the class to - // Was a custom class name supplied? If so we'll use it + // Was a custom class name supplied? If so we'll use it $class = strtolower($class); if (is_null($object_name)) @@ -1271,4 +1255,4 @@ class CI_Loader { } /* End of file Loader.php */ -/* Location: ./system/core/Loader.php */ \ No newline at end of file +/* Location: ./system/core/Loader.php */ -- cgit v1.2.3-24-g4f1b From 75f7c12815c62782163a54e84707f50459b6ef5d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 8 Jan 2012 03:49:25 +0200 Subject: Remove loading of ['core'] elements --- system/core/Loader.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 689ae1ecd..272fe4291 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1165,13 +1165,6 @@ class CI_Loader { } } - // A little tweak to remain backward compatible - // The $autoload['core'] item was deprecated - if ( ! isset($autoload['libraries']) AND isset($autoload['core'])) - { - $autoload['libraries'] = $autoload['core']; - } - // Load libraries if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) { -- cgit v1.2.3-24-g4f1b From d47baab1bd4d655a68981834d11727ae8c2a3a45 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Jan 2012 16:56:46 +0200 Subject: Fix issue #904 --- system/core/Loader.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 272fe4291..12daaa928 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -250,10 +250,10 @@ class CI_Loader { if (($last_slash = strrpos($model, '/')) !== FALSE) { // The path is in front of the last slash - $path = substr($model, 0, $last_slash + 1); + $path = substr($model, 0, ++$last_slash); // And the model name behind it - $model = substr($model, $last_slash + 1); + $model = substr($model, $last_slash); } if ($name == '') @@ -833,10 +833,9 @@ class CI_Loader { // If the PHP installation does not support short tags we'll // do a little string replacement, changing the short tags // to standard PHP echo statements. - if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) { - echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace(''.preg_replace('/;*\s*\?>/', '; ?>', str_replace(' $this->_ci_ob_level + 1) { @@ -1233,13 +1231,13 @@ class CI_Loader { { if ( ! is_array($filename)) { - return array(strtolower(str_replace('.php', '', str_replace($extension, '', $filename)).$extension)); + return array(strtolower(str_replace(array($extension, '.php'), '', $filename).$extension)); } else { foreach ($filename as $key => $val) { - $filename[$key] = strtolower(str_replace('.php', '', str_replace($extension, '', $val)).$extension); + $filename[$key] = strtolower(str_replace(array($extension, '.php'), '', $val).$extension); } return $filename; -- cgit v1.2.3-24-g4f1b From 7efad20597ef7e06f8cf837a9f40918d2d3f2727 Mon Sep 17 00:00:00 2001 From: Jamie Rumbelow Date: Sun, 19 Feb 2012 12:37:00 +0000 Subject: Renaming Active Record to Query Builder across the system --- system/core/Loader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 12daaa928..750e8cdd6 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -315,16 +315,16 @@ class CI_Loader { * * @param string the DB credentials * @param bool whether to return the DB object - * @param bool whether to enable active record (this allows us to override the config setting) + * @param bool whether to enable query builder (this allows us to override the config setting) * @return object */ - public function database($params = '', $return = FALSE, $active_record = NULL) + public function database($params = '', $return = FALSE, $query_builder = NULL) { // Grab the super object $CI =& get_instance(); // Do we even need to load the database class? - if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db)) + if (class_exists('CI_DB') AND $return == FALSE AND $query_builder == NULL AND isset($CI->db) AND is_object($CI->db)) { return FALSE; } @@ -333,7 +333,7 @@ class CI_Loader { if ($return === TRUE) { - return DB($params, $active_record); + return DB($params, $query_builder); } // Initialize the db variable. Needed to prevent @@ -341,7 +341,7 @@ class CI_Loader { $CI->db = ''; // Load the DB class - $CI->db =& DB($params, $active_record); + $CI->db =& DB($params, $query_builder); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From f5e8e1c61e4ed82db42d82d01c4e52b767effa78 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 6 Mar 2012 13:11:27 +0200 Subject: Changed rewrite_short_tags to have no effect on PHP 5.4 --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 12daaa928..20cf7ef33 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -833,7 +833,7 @@ class CI_Loader { // If the PHP installation does not support short tags we'll // do a little string replacement, changing the short tags // to standard PHP echo statements. - if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) + if ( ! is_php('5.4') && (bool) @ini_get('short_open_tag') === FALSE && config_item('rewrite_short_tags') == TRUE) { echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace(' Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 12daaa928..971d30325 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From 9929d6f77a0e54288b1696343439b0e91b21866e Mon Sep 17 00:00:00 2001 From: Christopher Guiney Date: Fri, 9 Mar 2012 19:53:24 -0800 Subject: Allow drivers to be loaded as an array, like models and libraries. --- system/core/Loader.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 3d91915c4..42d8162bb 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -615,13 +615,22 @@ class CI_Loader { * * Loads a driver library * - * @param string the name of the class + * @param mixed the name of the class or array of classes * @param mixed the optional parameters * @param string an optional object name * @return void */ public function driver($library = '', $params = NULL, $object_name = NULL) { + if(is_array($library)) + { + foreach ( $library as $driver ) + { + $this->driver($driver); + } + return FALSE; + } + if ( ! class_exists('CI_Driver_Library')) { // we aren't instantiating an object here, that'll be done by the Library itself -- cgit v1.2.3-24-g4f1b From b54d355faabef775703119a23dd55004b84a1140 Mon Sep 17 00:00:00 2001 From: Christopher Guiney Date: Sat, 10 Mar 2012 08:38:10 -0800 Subject: Fixing some spacing. --- system/core/Loader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 42d8162bb..9b9cc2fef 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -622,9 +622,9 @@ class CI_Loader { */ public function driver($library = '', $params = NULL, $object_name = NULL) { - if(is_array($library)) + if (is_array($library)) { - foreach ( $library as $driver ) + foreach ($library as $driver) { $this->driver($driver); } -- cgit v1.2.3-24-g4f1b From 94af355dd00417424675f7b24c42affb827db0cd Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 26 Mar 2012 23:10:42 +0300 Subject: Some style adjustments and fixed comments in the Loader class --- system/core/Loader.php | 59 +++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 9b9cc2fef..976a5a575 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * Loader Class * @@ -281,7 +279,7 @@ class CI_Loader { continue; } - if ($db_conn !== FALSE AND ! class_exists('CI_DB')) + if ($db_conn !== FALSE && ! class_exists('CI_DB')) { if ($db_conn === TRUE) { @@ -324,7 +322,7 @@ class CI_Loader { $CI =& get_instance(); // Do we even need to load the database class? - if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db)) + if (class_exists('CI_DB') && $return == FALSE && $active_record == NULL && isset($CI->db) && is_object($CI->db)) { return FALSE; } @@ -399,13 +397,13 @@ class CI_Loader { /** * Load View * - * This function is used to load a "view" file. It has three parameters: + * This function is used to load a "view" file. It has three parameters: * * 1. The name of the "view" file to be included. * 2. An associative array of data to be extracted for use in the view. - * 3. TRUE/FALSE - whether to return the data or load it. In - * some cases it's advantageous to be able to return data so that - * a developer can process it in some way. + * 3. TRUE/FALSE - whether to return the data or load it. In + * some cases it's advantageous to be able to return data so that + * a developer can process it in some way. * * @param string * @param array @@ -447,14 +445,14 @@ class CI_Loader { */ public function vars($vars = array(), $val = '') { - if ($val != '' AND is_string($vars)) + if ($val != '' && is_string($vars)) { $vars = array($vars => $val); } $vars = $this->_ci_object_to_array($vars); - if (is_array($vars) AND count($vars) > 0) + if (is_array($vars) && count($vars) > 0) { foreach ($vars as $key => $val) { @@ -660,7 +658,7 @@ class CI_Loader { * Prepends a parent path to the library, model, helper, and config path arrays * * @param string - * @param boolean + * @param bool * @return void */ public function add_package_path($path, $view_cascade=TRUE) @@ -701,9 +699,9 @@ class CI_Loader { * Remove a path from the library, model, and helper path arrays if it exists * If no path is provided, the most recently added path is removed. * - * @param type + * @param string * @param bool - * @return type + * @return void */ public function remove_package_path($path = '', $remove_config_path = TRUE) { @@ -764,7 +762,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]) ? $_ci_data[$_ci_val] : FALSE; } $file_exists = FALSE; @@ -1019,11 +1017,11 @@ class CI_Loader { * @param string * @param bool * @param string an optional object name - * @return null + * @return void */ protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) { - // Is there an associated config file for this class? Note: these should always be lowercase + // Is there an associated config file for this class? Note: these should always be lowercase if ($config === NULL) { // Fetch the config paths containing any package paths @@ -1038,24 +1036,24 @@ class CI_Loader { // We test for both uppercase and lowercase, for servers that // are case-sensitive with regard to file names. Check for environment // first, global next - if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) + if (defined('ENVIRONMENT') && file_exists($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) { - include($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); + include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); break; } - elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) + elseif (defined('ENVIRONMENT') && file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) { - include($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); + include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); break; } - elseif (file_exists($path .'config/'.strtolower($class).'.php')) + elseif (file_exists($path.'config/'.strtolower($class).'.php')) { - include($path .'config/'.strtolower($class).'.php'); + include($path.'config/'.strtolower($class).'.php'); break; } - elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).'.php')) + elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) { - include($path .'config/'.ucfirst(strtolower($class)).'.php'); + include($path.'config/'.ucfirst(strtolower($class)).'.php'); break; } } @@ -1095,7 +1093,7 @@ class CI_Loader { if (is_null($object_name)) { - $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + $classvar = isset($this->_ci_varmap[$class]) ? $this->_ci_varmap[$class] : $class; } else { @@ -1130,7 +1128,7 @@ class CI_Loader { */ protected function _ci_autoloader() { - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) + if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); } @@ -1166,14 +1164,14 @@ class CI_Loader { // Autoload helpers and languages foreach (array('helper', 'language') as $type) { - if (isset($autoload[$type]) AND count($autoload[$type]) > 0) + if (isset($autoload[$type]) && count($autoload[$type]) > 0) { $this->$type($autoload[$type]); } } // Load libraries - if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) + if (isset($autoload['libraries']) && count($autoload['libraries']) > 0) { // Load the database driver. if (in_array('database', $autoload['libraries'])) @@ -1208,7 +1206,7 @@ class CI_Loader { */ protected function _ci_object_to_array($object) { - return (is_object($object)) ? get_object_vars($object) : $object; + return is_object($object) ? get_object_vars($object) : $object; } // -------------------------------------------------------------------- @@ -1252,7 +1250,8 @@ class CI_Loader { return $filename; } } + } /* End of file Loader.php */ -/* Location: ./system/core/Loader.php */ +/* Location: ./system/core/Loader.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From a11b16b1af42bbb4ffbc15eeee50a3d3ceb402d5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 28 Mar 2012 12:22:04 +0300 Subject: Fix a CI_Loader::_ci_load_class() bug --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 976a5a575..027ed20e5 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1111,7 +1111,7 @@ class CI_Loader { } else { - $CI->$classvar = new $name; + $CI->$classvar = new $name(); } } -- cgit v1.2.3-24-g4f1b From 3684d349d1f5239ad9703c07f14ae77389818daf Mon Sep 17 00:00:00 2001 From: Korri Date: Tue, 17 Apr 2012 00:35:08 -0400 Subject: Adding a package adds configuration folder to the end of the list. --- system/core/Loader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 027ed20e5..a4039c6f0 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -673,7 +673,7 @@ class CI_Loader { // Add config file path $config =& $this->_ci_get_component('config'); - array_unshift($config->_config_paths, $path); + array_push($config->_config_paths, $path); } // -------------------------------------------------------------------- @@ -713,7 +713,7 @@ class CI_Loader { array_shift($this->_ci_model_paths); array_shift($this->_ci_helper_paths); array_shift($this->_ci_view_paths); - array_shift($config->_config_paths); + array_pop($config->_config_paths); } else { -- cgit v1.2.3-24-g4f1b From ad4750509885ad5bb368fc308f86d8c06d45b15c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 19 Apr 2012 13:21:06 -0400 Subject: Normalize comments in core files --- system/core/Loader.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 027ed20e5..e1531843a 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -138,7 +138,6 @@ class CI_Loader { * * This method is called once in CI_Controller. * - * @param array * @return object */ public function initialize() @@ -1123,7 +1122,6 @@ class CI_Loader { * The config/autoload.php file contains an array that permits sub-systems, * libraries, and helpers to be loaded automatically. * - * @param array * @return void */ protected function _ci_autoloader() -- cgit v1.2.3-24-g4f1b From 40403d21274d5e0792c7ab816ad984d6387d5c20 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 19 Apr 2012 16:38:50 -0400 Subject: Additional formatting fixes --- system/core/Loader.php | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index e1531843a..b99ce6964 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -45,75 +45,86 @@ class CI_Loader { * @var int */ protected $_ci_ob_level; + /** * List of paths to load views from * * @var array */ - protected $_ci_view_paths = array(); + protected $_ci_view_paths = array(); + /** * List of paths to load libraries from * * @var array */ - protected $_ci_library_paths = array(); + protected $_ci_library_paths = array(); + /** * List of paths to load models from * * @var array */ - protected $_ci_model_paths = array(); + protected $_ci_model_paths = array(); + /** * List of paths to load helpers from * * @var array */ - protected $_ci_helper_paths = array(); + protected $_ci_helper_paths = array(); + /** * List of loaded base classes * * @var array */ - protected $_base_classes = array(); // Set by the controller class + protected $_base_classes = array(); // Set by the controller class + /** * List of cached variables * * @var array */ - protected $_ci_cached_vars = array(); + protected $_ci_cached_vars = array(); + /** * List of loaded classes * * @var array */ - protected $_ci_classes = array(); + protected $_ci_classes = array(); + /** * List of loaded files * * @var array */ - protected $_ci_loaded_files = array(); + protected $_ci_loaded_files = array(); + /** * List of loaded models * * @var array */ - protected $_ci_models = array(); + protected $_ci_models = array(); + /** * List of loaded helpers * * @var array */ - protected $_ci_helpers = array(); + protected $_ci_helpers = array(); + /** * List of class name mappings * * @var array */ - protected $_ci_varmap = array( - 'unit_test' => 'unit', - 'user_agent' => 'agent' - ); + protected $_ci_varmap = array( + 'unit_test' => 'unit', + 'user_agent' => 'agent' + ); /** * Constructor -- cgit v1.2.3-24-g4f1b From 48a7fbbeb53e82e9298036d40c42ec2564699ed0 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 23 Apr 2012 11:58:16 -0400 Subject: Use tabs to separate class properties --- system/core/Loader.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index b99ce6964..7fb3eab41 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -51,77 +51,77 @@ class CI_Loader { * * @var array */ - protected $_ci_view_paths = array(); + protected $_ci_view_paths = array(); /** * List of paths to load libraries from * * @var array */ - protected $_ci_library_paths = array(); + protected $_ci_library_paths = array(); /** * List of paths to load models from * * @var array */ - protected $_ci_model_paths = array(); + protected $_ci_model_paths = array(); /** * List of paths to load helpers from * * @var array */ - protected $_ci_helper_paths = array(); + protected $_ci_helper_paths = array(); /** * List of loaded base classes * * @var array */ - protected $_base_classes = array(); // Set by the controller class + protected $_base_classes = array(); // Set by the controller class /** * List of cached variables * * @var array */ - protected $_ci_cached_vars = array(); + protected $_ci_cached_vars = array(); /** * List of loaded classes * * @var array */ - protected $_ci_classes = array(); + protected $_ci_classes = array(); /** * List of loaded files * * @var array */ - protected $_ci_loaded_files = array(); + protected $_ci_loaded_files = array(); /** * List of loaded models * * @var array */ - protected $_ci_models = array(); + protected $_ci_models = array(); /** * List of loaded helpers * * @var array */ - protected $_ci_helpers = array(); + protected $_ci_helpers = array(); /** * List of class name mappings * * @var array */ - protected $_ci_varmap = array( + protected $_ci_varmap = array( 'unit_test' => 'unit', 'user_agent' => 'agent' ); -- cgit v1.2.3-24-g4f1b From 92ebfb65ac044f5c2e6d88fba137253854cf1b94 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 May 2012 12:49:24 +0300 Subject: Cleanup the core classes --- system/core/Loader.php | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index bf7f6cb02..3eb09e6ab 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -32,8 +32,8 @@ * * @package CodeIgniter * @subpackage Libraries - * @author EllisLab Dev Team * @category Loader + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/loader.html */ class CI_Loader { @@ -45,77 +45,77 @@ class CI_Loader { * @var int */ protected $_ci_ob_level; - + /** * List of paths to load views from * * @var array */ protected $_ci_view_paths = array(); - + /** * List of paths to load libraries from * * @var array */ protected $_ci_library_paths = array(); - + /** * List of paths to load models from * * @var array */ protected $_ci_model_paths = array(); - + /** * List of paths to load helpers from * * @var array */ protected $_ci_helper_paths = array(); - + /** * List of loaded base classes * * @var array */ protected $_base_classes = array(); // Set by the controller class - + /** * List of cached variables * * @var array */ protected $_ci_cached_vars = array(); - + /** * List of loaded classes * * @var array */ protected $_ci_classes = array(); - + /** * List of loaded files * * @var array */ protected $_ci_loaded_files = array(); - + /** * List of loaded models * * @var array */ protected $_ci_models = array(); - + /** * List of loaded helpers * * @var array */ protected $_ci_helpers = array(); - + /** * List of class name mappings * @@ -130,6 +130,8 @@ class CI_Loader { * Constructor * * Sets the path to the view files and gets the initial output buffering level + * + * @return void */ public function __construct() { @@ -178,12 +180,7 @@ class CI_Loader { */ public function is_loaded($class) { - if (isset($this->_ci_classes[$class])) - { - return $this->_ci_classes[$class]; - } - - return FALSE; + return isset($this->_ci_classes[$class]) ? $this->_ci_classes[$class] : FALSE; } // -------------------------------------------------------------------- @@ -1263,4 +1260,4 @@ class CI_Loader { } /* End of file Loader.php */ -/* Location: ./system/core/Loader.php */ +/* Location: ./system/core/Loader.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From ed944a3c70a0bad158cd5a6ca5ce1f2e717aff5d Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:07:47 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/core --- system/core/Loader.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 3eb09e6ab..adfe92845 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -208,7 +208,7 @@ class CI_Loader { return; } - if ($library == '' OR isset($this->_base_classes[$library])) + if ($library === '' OR isset($this->_base_classes[$library])) { return FALSE; } @@ -244,7 +244,7 @@ class CI_Loader { return; } - if ($model == '') + if ($model === '') { return; } @@ -261,7 +261,7 @@ class CI_Loader { $model = substr($model, $last_slash); } - if ($name == '') + if ($name === '') { $name = $model; } @@ -329,7 +329,7 @@ class CI_Loader { $CI =& get_instance(); // Do we even need to load the database class? - if (class_exists('CI_DB') && $return == FALSE && $query_builder == NULL && isset($CI->db) && is_object($CI->db)) + if (class_exists('CI_DB') && $return === FALSE && $query_builder === NULL && isset($CI->db) && is_object($CI->db)) { return FALSE; } @@ -452,7 +452,7 @@ class CI_Loader { */ public function vars($vars = array(), $val = '') { - if ($val != '' && is_string($vars)) + if ($val !== '' && is_string($vars)) { $vars = array($vars => $val); } @@ -642,7 +642,7 @@ class CI_Loader { require BASEPATH.'libraries/Driver.php'; } - if ($library == '') + if ($library === '') { return FALSE; } @@ -714,7 +714,7 @@ class CI_Loader { { $config =& $this->_ci_get_component('config'); - if ($path == '') + if ($path === '') { array_shift($this->_ci_library_paths); array_shift($this->_ci_model_paths); @@ -775,7 +775,7 @@ class CI_Loader { $file_exists = FALSE; // Set the path to the requested file - if ($_ci_path != '') + if ($_ci_path !== '') { $_ci_x = explode('/', $_ci_path); $_ci_file = end($_ci_x); @@ -783,7 +783,7 @@ class CI_Loader { else { $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); - $_ci_file = ($_ci_ext == '') ? $_ci_view.'.php' : $_ci_view; + $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; foreach ($this->_ci_view_paths as $view_file => $cascade) { @@ -847,7 +847,7 @@ class CI_Loader { // If the PHP installation does not support short tags we'll // do a little string replacement, changing the short tags // to standard PHP echo statements. - if ( ! is_php('5.4') && (bool) @ini_get('short_open_tag') === FALSE && config_item('rewrite_short_tags') == TRUE) + if ( ! is_php('5.4') && (bool) @ini_get('short_open_tag') === FALSE && config_item('rewrite_short_tags') === TRUE) { echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('_ci_load_class($path, $params); @@ -1008,7 +1008,7 @@ class CI_Loader { // If we got this far we were unable to find the requested class. // We do not issue errors if the load call failed due to a duplicate request - if ($is_duplicate == FALSE) + if ($is_duplicate === FALSE) { log_message('error', 'Unable to load the requested class: '.$class); show_error('Unable to load the requested class: '.$class); @@ -1067,7 +1067,7 @@ class CI_Loader { } } - if ($prefix == '') + if ($prefix === '') { if (class_exists('CI_'.$class)) { -- cgit v1.2.3-24-g4f1b From 40bd2a7fb2fb98a10c4e3758897a595ae78ab5f8 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 16:04:15 +0100 Subject: Don't assume $_ci_path is a string (could be FALSE) --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index adfe92845..66a9e7faa 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -775,7 +775,7 @@ class CI_Loader { $file_exists = FALSE; // Set the path to the requested file - if ($_ci_path !== '') + if (is_string($_ci_path) && $_ci_path !== '') { $_ci_x = explode('/', $_ci_path); $_ci_file = end($_ci_x); -- cgit v1.2.3-24-g4f1b From 10d78f61399dd647ada0afaa43e5e9ec48d55e82 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 4 Jun 2012 14:41:53 -0500 Subject: Loader was too specific about === "", some cases were NULL. Signed-off-by: Phil Sturgeon --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 66a9e7faa..09e948714 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -261,7 +261,7 @@ class CI_Loader { $model = substr($model, $last_slash); } - if ($name === '') + if (empty($name)) { $name = $model; } -- cgit v1.2.3-24-g4f1b From cce918033a99186cd76019d022571a8d9321d899 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 12 Jun 2012 13:25:31 +0300 Subject: Fix APPPATH --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 09e948714..94739c74a 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -668,7 +668,7 @@ class CI_Loader { * @param bool * @return void */ - public function add_package_path($path, $view_cascade=TRUE) + public function add_package_path($path, $view_cascade = TRUE) { $path = rtrim($path, '/').'/'; -- cgit v1.2.3-24-g4f1b From 02506187c12ee6236d3cc7a1d992cfeb987b36aa Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 3 Jul 2012 07:28:50 +0200 Subject: Fix an error in Loader code documentation That's not $this->load_vars(), but $this->load->vars() --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 94739c74a..d51ee0b34 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -820,7 +820,7 @@ class CI_Loader { /* * Extract and cache variables * - * You can either set variables using the dedicated $this->load_vars() + * You can either set variables using the dedicated $this->load->vars() * function or via the second parameter of this function. We'll merge * the two types and cache them so that views that are embedded within * other views can have access to these variables. -- cgit v1.2.3-24-g4f1b From 975504f33550030ef4a92310c23b59f7b25a7b84 Mon Sep 17 00:00:00 2001 From: joellimberg Date: Fri, 13 Jul 2012 18:45:24 +0300 Subject: Rename $babe => $single_model, in foreach ($model AS $babe) {...} --- system/core/Loader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index d51ee0b34..93b8f9e29 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -237,9 +237,9 @@ class CI_Loader { { if (is_array($model)) { - foreach ($model as $babe) + foreach ($model as $single_model) { - $this->model($babe); + $this->model($single_model); } return; } -- cgit v1.2.3-24-g4f1b From 3cf174bef3dba5e7e30a9524195aac7773e4d444 Mon Sep 17 00:00:00 2001 From: Joel Limberg Date: Fri, 13 Jul 2012 20:49:57 +0300 Subject: Loader::model() - rename foreach ($model AS $single_model) to ($model AS $class). Consistent with ::library() and ::_ci_load_class() --- system/core/Loader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 93b8f9e29..bfcef1cbc 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -237,9 +237,9 @@ class CI_Loader { { if (is_array($model)) { - foreach ($model as $single_model) + foreach ($model as $class) { - $this->model($single_model); + $this->model($class); } return; } -- cgit v1.2.3-24-g4f1b From eee2df6846ec072303dd87192d328fbd1de6b06a Mon Sep 17 00:00:00 2001 From: jonnu Date: Mon, 16 Jul 2012 13:06:16 +0100 Subject: Inconsistency between log_message and show_error when encountering a non-existant class Signed-off-by: jonnu --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index bfcef1cbc..0bc6e844a 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1091,7 +1091,7 @@ class CI_Loader { if ( ! class_exists($name)) { log_message('error', 'Non-existent class: '.$name); - show_error('Non-existent class: '.$class); + show_error('Non-existent class: '.$name); } // Set the variable name we will assign the class to -- cgit v1.2.3-24-g4f1b