summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-12 20:30:36 +0200
committeradmin <devnull@localhost>2006-10-12 20:30:36 +0200
commit80b2bd9b7f1ecafed0d0170be60bd0a2d8a4201c (patch)
treee5b482a3fc266758421686fb62f64b81d6e85330 /system
parent9fa003797d794a63aa58356926fac9649269c668 (diff)
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Loader.php36
1 files changed, 16 insertions, 20 deletions
diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php
index 1f6a8bce1..2d312e9eb 100644
--- a/system/libraries/Loader.php
+++ b/system/libraries/Loader.php
@@ -67,15 +67,15 @@ class CI_Loader {
*
* @access public
* @param string the name of the class
- * @param sring the optional class variable name to assign the library to
+ * @param mixed the optional parameters
* @return void
*/
- function library($class, $varname = NULL)
+ function library($class, $params = FALSE)
{
if ($class == '')
return;
- $this->_ci_load_class($class, $varname);
+ $this->_ci_load_class($class, $params);
$this->_ci_assign_to_models();
}
@@ -640,7 +640,7 @@ class CI_Loader {
* @param mixed any additional parameters
* @return void
*/
- function _ci_load_class($class, $varname = NULL)
+ function _ci_load_class($class, $params = FALSE)
{
// Prep the class name
$class = strtolower(str_replace(EXT, '', $class));
@@ -665,7 +665,7 @@ class CI_Loader {
}
}
- return $this->_ci_init_class($filename, 'MY_', $varname);
+ return $this->_ci_init_class($filename, 'MY_', $params);
}
// Lets search for the requested library file and load it.
@@ -680,7 +680,7 @@ class CI_Loader {
if (file_exists($path.'libraries/'.$filename.EXT))
{
include_once($path.'libraries/'.$filename.EXT);
- return $this->_ci_init_class($filename, '', $varname);
+ return $this->_ci_init_class($filename, '', $params);
}
}
}
@@ -700,13 +700,16 @@ class CI_Loader {
* @param string
* @return null
*/
- function _ci_init_class($class, $prefix = '', $varname = NULL)
+ function _ci_init_class($class, $prefix = '', $config = FALSE)
{
// Is there an associated config file for this class?
- $config = NULL;
- if (file_exists(APPPATH.'config/'.$class.EXT))
+ if ($config !== FALSE)
{
- include_once(APPPATH.'config/'.$class.EXT);
+ $config = FALSE;
+ if (file_exists(APPPATH.'config/'.$class.EXT))
+ {
+ include_once(APPPATH.'config/'.$class.EXT);
+ }
}
if ($prefix == '')
@@ -719,16 +722,9 @@ class CI_Loader {
}
// Set the variable name we will assign the class to
- if ( ! is_null($varname))
- {
- $classvar = $varname;
- }
- else
- {
- $class = strtolower($class);
- $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class];
- }
-
+ $class = strtolower($class);
+ $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class];
+
// Instantiate the class
$CI =& get_instance();
if ($config !== NULL)