diff options
Diffstat (limited to 'system/codeigniter')
-rw-r--r-- | system/codeigniter/Base4.php | 4 | ||||
-rw-r--r-- | system/codeigniter/CodeIgniter.php | 20 | ||||
-rw-r--r-- | system/codeigniter/Common.php | 28 |
3 files changed, 28 insertions, 24 deletions
diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index 8b3dc92f3..9366b4588 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -21,8 +21,8 @@ * This file is used only when Code Igniter is being run under PHP 4. * * In order to allow CI to work under PHP 4 we had to make the Loader class - * the parent class of the Controller Base class. It's the only way we - * could enable functions like $this->load->library('email') to instantiate + * the parent of the Controller Base class. It's the only way we enabled + * enable functions like $this->load->library('email') to instantiate * classes that can then be used within controllers as $this->email->send() * * PHP 4 also has trouble referencing the CI super object within application diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 63ae45864..611b1a621 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -50,7 +50,7 @@ set_magic_quotes_runtime(0); // Kill magic quotes * ------------------------------------------------------ */ -$BM =& _load_class('Benchmark'); +$BM =& load_class('Benchmark'); $BM->mark('total_execution_time_start'); $BM->mark('loading_time_base_clases_start'); @@ -60,7 +60,7 @@ $BM->mark('loading_time_base_clases_start'); * ------------------------------------------------------ */ -$EXT =& _load_class('Hooks'); +$EXT =& load_class('Hooks'); /* * ------------------------------------------------------ @@ -75,9 +75,9 @@ $EXT->_call_hook('pre_system'); * ------------------------------------------------------ */ -$CFG =& _load_class('Config'); -$RTR =& _load_class('Router'); -$OUT =& _load_class('Output'); +$CFG =& load_class('Config'); +$RTR =& load_class('Router'); +$OUT =& load_class('Output'); /* * ------------------------------------------------------ @@ -99,9 +99,9 @@ if ($EXT->_call_hook('cache_override') === FALSE) * ------------------------------------------------------ */ -$IN =& _load_class('Input'); -$URI =& _load_class('URI'); -$LANG =& _load_class('Language'); +$IN =& load_class('Input'); +$URI =& load_class('URI'); +$LANG =& load_class('Language'); /* * ------------------------------------------------------ @@ -116,7 +116,7 @@ $LANG =& _load_class('Language'); * */ -_load_class('Loader', FALSE); +load_class('Loader', FALSE); if (floor(phpversion()) < 5) { @@ -127,7 +127,7 @@ else require(BASEPATH.'codeigniter/Base5'.EXT); } -_load_class('Controller', FALSE); +load_class('Controller', FALSE); require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index a801c0821..8ac80d634 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -41,7 +41,7 @@ * @param bool optional flag that lets classes get loaded but not instantiated * @return object */ -function _load_class($class, $instantiate = TRUE) +function &load_class($class, $instantiate = TRUE) { static $objects = array(); @@ -55,7 +55,8 @@ function _load_class($class, $instantiate = TRUE) // which we don't need to load. We only instantiate it. if ($class == 'Instance') { - return $objects[$class] =& new $class(); + $objects[$class] =& new $class(); + return $objects[$class]; } // If the requested class does not exist in the application/libraries @@ -104,18 +105,21 @@ function _load_class($class, $instantiate = TRUE) if ($instantiate == FALSE) { - return $objects[$class] = TRUE; + $objects[$class] = TRUE; + return $objects[$class]; } if ($is_subclass == TRUE) { $name = 'MY_'.$class; - return $objects[$class] =& new $name(); + $objects[$class] =& new $name(); + return $objects[$class]; } $name = ($class != 'Controller') ? 'CI_'.$class : $class; - return $objects[$class] =& new $name(); + $objects[$class] =& new $name(); + return $objects[$class]; } /** @@ -124,7 +128,7 @@ function _load_class($class, $instantiate = TRUE) * @access private * @return array */ -function &_get_config() +function &get_config() { static $main_conf; @@ -162,7 +166,7 @@ function &_get_config() */ function show_error($message) { - $error =& _load_class('Exceptions'); + $error =& load_class('Exceptions'); echo $error->show_error('An Error Was Encountered', $message); exit; } @@ -180,7 +184,7 @@ function show_error($message) */ function show_404($page = '') { - $error =& _load_class('Exceptions'); + $error =& load_class('Exceptions'); $error->show_404($page); exit; } @@ -199,13 +203,13 @@ function log_message($level = 'error', $message, $php_error = FALSE) { static $LOG; - $config =& _get_config(); + $config = get_config(); if ($config['log_errors'] === FALSE) { return; } - $LOG =& _load_class('Log'); + $LOG =& load_class('Log'); $LOG->write_log($level, $message, $php_error); } @@ -238,7 +242,7 @@ function _exception_handler($severity, $message, $filepath, $line) return; } - $error =& _load_class('Exceptions'); + $error =& load_class('Exceptions'); // Should we display the error? // We'll get the current error_reporting level and add its bits @@ -250,7 +254,7 @@ function _exception_handler($severity, $message, $filepath, $line) } // Should we log the error? No? We're done... - $config =& _get_config(); + $config = get_config(); if ($config['log_errors'] === FALSE) { return; |