summaryrefslogtreecommitdiffstats
path: root/system/core/Config.php
diff options
context:
space:
mode:
authorPascal Kriete <pascal.kriete@ellislab.com>2010-11-04 22:59:52 +0100
committerPascal Kriete <pascal.kriete@ellislab.com>2010-11-04 22:59:52 +0100
commite917f9be8b05c81357c1c2c9730d5060685d644d (patch)
treeb6a7d5ce8ba57b69ba61454f77829b04f2ce5974 /system/core/Config.php
parent5b2d2da5ae2e97043c6bef53e565d30e50196e2b (diff)
parente1f6e9ddff788f6a154f5f35dc117d14aeb0c484 (diff)
Automated merge with http://hg.ellislab.com/CodeIgniter2
Diffstat (limited to 'system/core/Config.php')
-rw-r--r--system/core/Config.php48
1 files changed, 24 insertions, 24 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index 7e0443c1f..24503ab5d 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -45,10 +45,10 @@ class CI_Config {
*/
function CI_Config()
{
- $this->config =& get_config();
+ $this->config =& get_config();
log_message('debug', "Config Class Initialized");
}
-
+
// --------------------------------------------------------------------
/**
@@ -57,16 +57,16 @@ class CI_Config {
* @access public
* @param string the config file name
* @return boolean if the file was loaded correctly
- */
+ */
function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
$file = ($file == '') ? 'config' : str_replace(EXT, '', $file);
$loaded = FALSE;
-
+
foreach($this->_config_paths as $path)
{
$file_path = $path.'config/'.$file.EXT;
-
+
if (in_array($file_path, $this->is_loaded, TRUE))
{
$loaded = TRUE;
@@ -77,7 +77,7 @@ class CI_Config {
{
continue;
}
-
+
include($file_path);
if ( ! isset($config) OR ! is_array($config))
@@ -88,7 +88,7 @@ class CI_Config {
}
show_error('Your '.$file_path.' file does not appear to contain a valid configuration array.');
}
-
+
if ($use_sections === TRUE)
{
if (isset($this->config[$file]))
@@ -104,14 +104,14 @@ class CI_Config {
{
$this->config = array_merge($this->config, $config);
}
-
+
$this->is_loaded[] = $file_path;
unset($config);
-
+
$loaded = TRUE;
log_message('debug', 'Config file loaded: '.$file_path);
}
-
+
if ($loaded === FALSE)
{
if ($fail_gracefully === TRUE)
@@ -123,7 +123,7 @@ class CI_Config {
return TRUE;
}
-
+
// --------------------------------------------------------------------
/**
@@ -137,9 +137,9 @@ class CI_Config {
* @return string
*/
function item($item, $index = '')
- {
+ {
if ($index == '')
- {
+ {
if ( ! isset($this->config[$item]))
{
return FALSE;
@@ -164,8 +164,8 @@ class CI_Config {
return $pref;
}
-
- // --------------------------------------------------------------------
+
+ // --------------------------------------------------------------------
/**
* Fetch a config file item - adds slash after item
@@ -188,13 +188,13 @@ class CI_Config {
$pref = $this->config[$item];
if ($pref != '' && substr($pref, -1) != '/')
- {
+ {
$pref .= '/';
}
return $pref;
}
-
+
// --------------------------------------------------------------------
/**
@@ -224,9 +224,9 @@ class CI_Config {
{
$uri = implode('/', $uri);
}
-
+
$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
- return $this->slash_item('base_url').$this->slash_item('index_page').trim($uri, '/').$suffix;
+ return $this->slash_item('base_url').$this->slash_item('index_page').trim($uri, '/').$suffix;
}
else
{
@@ -254,7 +254,7 @@ class CI_Config {
}
}
}
-
+
// --------------------------------------------------------------------
/**
@@ -268,7 +268,7 @@ class CI_Config {
$x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH));
return $this->slash_item('base_url').end($x).'/';
}
-
+
// --------------------------------------------------------------------
/**
@@ -283,7 +283,7 @@ class CI_Config {
{
$this->config[$item] = $value;
}
-
+
// --------------------------------------------------------------------
/**
@@ -296,7 +296,7 @@ class CI_Config {
* @access private
* @param array
* @return void
- */
+ */
function _assign_to_config($items = array())
{
if (is_array($items))
@@ -305,7 +305,7 @@ class CI_Config {
{
$this->set_item($key, $val);
}
- }
+ }
}
}