From 585600207a79c1d9a7b0af5883bf384629b753a3 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Wed, 10 Nov 2010 16:01:20 -0500 Subject: Removing instantiate_class(), which was needed to make php 4 and 5.3 play together nicely. Removed all instantiations by reference. --- system/core/Common.php | 21 +-------------------- system/core/Loader.php | 2 +- system/database/DB.php | 2 +- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/system/core/Common.php b/system/core/Common.php index 56fe713bd..6a3d5ac0a 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -163,29 +163,10 @@ // Keep track of what we just loaded is_loaded($class); - $_classes[$class] =& instantiate_class(new $name()); + $_classes[$class] = new $name(); return $_classes[$class]; } -// ------------------------------------------------------------------------ - -/** - * Instantiate Class - * - * Returns a new class object by reference, used by load_class() and the DB class. - * Required to retain PHP 4 compatibility and also not make PHP 5.3 cry. - * - * Use: $obj =& instantiate_class(new Foo()); - * - * @access public - * @param object - * @return object - */ - function &instantiate_class(&$class_object) - { - return $class_object; - } - // -------------------------------------------------------------------- /** diff --git a/system/core/Loader.php b/system/core/Loader.php index 69917648d..e97b18102 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -267,7 +267,7 @@ class CI_Loader { require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; - $CI->dbutil =& instantiate_class(new $class()); + $CI->dbutil = new $class(); } // -------------------------------------------------------------------- diff --git a/system/database/DB.php b/system/database/DB.php index b51995b68..60a67e821 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -130,7 +130,7 @@ function &DB($params = '', $active_record_override = NULL) // Instantiate the DB adapter $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; - $DB =& instantiate_class(new $driver($params)); + $DB = new $driver($params); if ($DB->autoinit == TRUE) { -- cgit v1.2.3-24-g4f1b