Pascal Kriete avatar Pascal Kriete committed 5f61df7 Merge

Comments (0)

Files changed (1)

system/core/Loader.php

 	var $_ci_library_paths	= array();
 	var $_ci_model_paths	= array();
 	var $_ci_helper_paths	= array();
-	var $_ci_is_instance	= FALSE; // Whether we should use $this or $CI =& get_instance()
 	var $_base_classes		= array(); // Set by the controller class
 	var $_ci_cached_vars	= array();
 	var $_ci_classes		= array();
 
 		// This allows anything loaded using $this->load (views, files, etc.)
 		// to become accessible from within the Controller and Model functions.
-		// Only needed when running PHP 5
 
-		if ($this->_ci_is_instance())
+		$_ci_CI =& get_instance();
+		foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var)
 		{
-			$_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;
-				}
+				$this->$_ci_key =& $_ci_CI->$_ci_key;
 			}
 		}
 
 	// --------------------------------------------------------------------
 
 	/**
-	 * Determines whether we should use the CI instance or $this
-	 * @PHP4
-	 *
-	 * @access	private
-	 * @return	bool
-	 */
-	function _ci_is_instance()
-	{
-		if (is_php('5.0.0') == TRUE)
-		{
-			return TRUE;
-		}
-
-		global $CI;
-		return (is_object($CI)) ? TRUE : FALSE;
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
 	 * Get a reference to a specific library or model
 	 *
 	 * @access	private
 	 */
 	function &_ci_get_component($component)
 	{
-		if ($this->_ci_is_instance())
-		{
-			$CI =& get_instance();
-			return $CI->$component;
-		}
-		else
-		{
-			return $this->$component;
-		}
+		$CI =& get_instance();
+		return $CI->$component;
 	}
 
 	// --------------------------------------------------------------------
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.