Merge pull request #2121 from TheDigitalOrchard/develop

utilize static function variables in Common::log_message() to "cache" lo...
diff --git a/system/core/Common.php b/system/core/Common.php
index a4b4f2b..d494caf 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -413,14 +413,23 @@
 	 */
 	function log_message($level = 'error', $message, $php_error = FALSE)
 	{
-		static $_log;
+		static $_log, $_log_threshold;
+		
+		if ($_log_threshold === NULL)
+		{
+			$_log_threshold = config_item('log_threshold');
+		}
 
-		if (config_item('log_threshold') === 0)
+		if ($_log_threshold === 0)
 		{
 			return;
 		}
 
-		$_log =& load_class('Log', 'core');
+		if ($_log === NULL)
+		{
+			$_log =& load_class('Log', 'core');
+		}
+		
 		$_log->write_log($level, $message, $php_error);
 	}
 }
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 5e6c400..9bfddc1 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -52,28 +52,28 @@
 	 *
 	 * @var	array
 	 */
-	protected $_ci_view_paths =	array();
+	protected $_ci_view_paths =	array(VIEWPATH	=> TRUE);
 
 	/**
 	 * List of paths to load libraries from
 	 *
 	 * @var	array
 	 */
-	protected $_ci_library_paths =	array();
+	protected $_ci_library_paths =	array(APPPATH, BASEPATH);
 
 	/**
 	 * List of paths to load models from
 	 *
 	 * @var	array
 	 */
-	protected $_ci_model_paths =	array();
+	protected $_ci_model_paths =	array(APPPATH);
 
 	/**
 	 * List of paths to load helpers from
 	 *
 	 * @var	array
 	 */
-	protected $_ci_helper_paths =	array();
+	protected $_ci_helper_paths =	array(APPPATH, BASEPATH);
 
 	/**
 	 * List of loaded base classes
@@ -137,10 +137,6 @@
 	public function __construct()
 	{
 		$this->_ci_ob_level  = ob_get_level();
-		$this->_ci_library_paths = array(APPPATH, BASEPATH);
-		$this->_ci_helper_paths = array(APPPATH, BASEPATH);
-		$this->_ci_model_paths = array(APPPATH);
-		$this->_ci_view_paths = array(VIEWPATH	=> TRUE);
 
 		log_message('debug', 'Loader Class Initialized');
 	}