diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php
index 8b3dc92..9366b45 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 63ae458..611b1a6 100644
--- a/system/codeigniter/CodeIgniter.php
+++ b/system/codeigniter/CodeIgniter.php
@@ -50,7 +50,7 @@
* ------------------------------------------------------
*/
-$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 @@
* ------------------------------------------------------
*/
-$EXT =& _load_class('Hooks');
+$EXT =& load_class('Hooks');
/*
* ------------------------------------------------------
@@ -75,9 +75,9 @@
* ------------------------------------------------------
*/
-$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 @@
* ------------------------------------------------------
*/
-$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 @@
*
*/
-_load_class('Loader', FALSE);
+load_class('Loader', FALSE);
if (floor(phpversion()) < 5)
{
@@ -127,7 +127,7 @@
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 a801c08..8ac80d6 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 @@
// 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 @@
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 @@
* @access private
* @return array
*/
-function &_get_config()
+function &get_config()
{
static $main_conf;
@@ -162,7 +166,7 @@
*/
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_404($page = '')
{
- $error =& _load_class('Exceptions');
+ $error =& load_class('Exceptions');
$error->show_404($page);
exit;
}
@@ -199,13 +203,13 @@
{
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 @@
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 @@
}
// Should we log the error? No? We're done...
- $config =& _get_config();
+ $config = get_config();
if ($config['log_errors'] === FALSE)
{
return;
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index c8a00b7..99c95a6 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -682,7 +682,8 @@
}
}
- return $this->data_cache['table_names'] =& $retval;
+ $this->data_cache['table_names'] = $retval;
+ return $this->data_cache['table_names'];
}
// --------------------------------------------------------------------
@@ -747,7 +748,8 @@
}
}
- return $this->data_cache['field_names'][$table] =& $retval;
+ $this->data_cache['field_names'][$table] = $retval;
+ return $this->data_cache['field_names'][$table];
}
// --------------------------------------------------------------------
@@ -931,7 +933,8 @@
*/
function cache_on()
{
- return $this->cache_on = TRUE;
+ $this->cache_on = TRUE;
+ return TRUE;
}
// --------------------------------------------------------------------
@@ -944,7 +947,8 @@
*/
function cache_off()
{
- return $this->cache_on = FALSE;
+ $this->cache_on = FALSE;
+ return FALSE;
}
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index c2c5f1f..51e43a7 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -110,7 +110,8 @@
}
}
- return $this->data_cache['db_names'] =& $dbs;
+ $this->data_cache['db_names'] = $dbs;
+ return $this->data_cache['db_names'];
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index e83c640..794405a 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -163,7 +163,8 @@
*/
function get_cursor()
{
- return $this->curs_id = ocinewcursor($this->conn_id);
+ $this->curs_id = ocinewcursor($this->conn_id);
+ return $this->curs_id;
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php
index 0c265de..b08b879 100644
--- a/system/database/drivers/postgre/postgre_utility.php
+++ b/system/database/drivers/postgre/postgre_utility.php
@@ -106,7 +106,7 @@
*/
function _repair_table($table)
{
- return return FALSE;
+ return FALSE;
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Config.php b/system/libraries/Config.php
index 26770cc..82836b1 100644
--- a/system/libraries/Config.php
+++ b/system/libraries/Config.php
@@ -44,7 +44,7 @@
*/
function CI_Config()
{
- $this->config =& _get_config();
+ $this->config = get_config();
log_message('debug', "Config Class Initialized");
}
// END CI_Config()
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php
index 7a3f5e5..938c46e 100644
--- a/system/libraries/Controller.php
+++ b/system/libraries/Controller.php
@@ -73,7 +73,7 @@
foreach ($classes as $var => $class)
{
- $this->$var =& _load_class($class);
+ $this->$var =& load_class($class);
}
diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php
index 8767e10..e2d0500 100644
--- a/system/libraries/Hooks.php
+++ b/system/libraries/Hooks.php
@@ -53,7 +53,7 @@
*/
function _initialize()
{
- $CFG =& _load_class('Config');
+ $CFG =& load_class('Config');
// If hooks are not enabled in the config file
// there is nothing else to do
diff --git a/system/libraries/Input.php b/system/libraries/Input.php
index 0d3c87b..72344e3 100644
--- a/system/libraries/Input.php
+++ b/system/libraries/Input.php
@@ -44,7 +44,7 @@
{
log_message('debug', "Input Class Initialized");
- $CFG =& _load_class('Config');
+ $CFG =& load_class('Config');
$this->use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE;
$this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE;
$this->_sanitize_globals();
@@ -306,7 +306,8 @@
if ($this->ip_address === FALSE)
{
- return $this->ip_address = '0.0.0.0';
+ $this->ip_address = '0.0.0.0';
+ return $this->ip_address;
}
if (strstr($this->ip_address, ','))
diff --git a/system/libraries/Log.php b/system/libraries/Log.php
index eff7cb7..09538fa 100644
--- a/system/libraries/Log.php
+++ b/system/libraries/Log.php
@@ -42,7 +42,7 @@
*/
function CI_Log()
{
- $config =& _get_config();
+ $config = get_config();
$this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/';
diff --git a/system/libraries/Output.php b/system/libraries/Output.php
index 507beab..7e85945 100644
--- a/system/libraries/Output.php
+++ b/system/libraries/Output.php
@@ -299,8 +299,8 @@
*/
function _display_cache(&$CFG, &$RTR)
{
- $CFG =& _load_class('Config');
- $RTR =& _load_class('Router');
+ $CFG =& load_class('Config');
+ $RTR =& load_class(('Router');
$cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path');
diff --git a/system/libraries/Router.php b/system/libraries/Router.php
index 27e3c27..dab8488 100644
--- a/system/libraries/Router.php
+++ b/system/libraries/Router.php
@@ -48,7 +48,7 @@
*/
function CI_Router()
{
- $this->config =& _load_class('Config');
+ $this->config =& load_class('Config');
$this->_set_route_mapping();
log_message('debug', "Router Class Initialized");
}
diff --git a/system/libraries/URI.php b/system/libraries/URI.php
index 80b1126..fcf6afe 100644
--- a/system/libraries/URI.php
+++ b/system/libraries/URI.php
@@ -42,7 +42,7 @@
*/
function CI_URI()
{
- $this->router =& _load_class('Router');
+ $this->router =& load_class('Router');
log_message('debug', "URI Class Initialized");
}
diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html
index 732e1c7..9836671 100644
--- a/user_guide/general/changelog.html
+++ b/user_guide/general/changelog.html
@@ -116,7 +116,7 @@
<li>Removed the is_numeric test from the db->escape() function.</li>
<li>Fixed a MySQLi bug that was causing error messages not to contain proper error data.</li>
<li>Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.</li>
-<li>Fixed a bug that was causing a PHP error when the Exceptions class was called within the _get_config() function since it was causing problems.</li>
+<li>Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.</li>
<li>Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.</li>
<li>Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.</li>
<li>Added some code to allow email attachments to be reset when sending batches of email.</li>