Class CI_Config - echiong/testRepo GitHub Wiki
##Class CI_Config
CodeIgniter Config Class
This class contains functions that enable config files to be managed
Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category:
Libraries
Author:
ExpressionEngine Dev Team
Link:
http://codeigniter.com/user_guide/libraries/config.html
Located at system/core/Config.php
##Methods summary
public boolean __construct ( )
Constructor
Sets the $config data from the primary config.php file as a class variable
Returns
boolean
if the file was successfully loaded or not
public boolean load ( string $file = '', boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE )
Load Config File
Parameters
$file
string
the config file name
$use_sections
boolean
if configuration values should be loaded into their own section
$fail_gracefully
boolean
true if errors should just return false, false if an error message should be
displayed
Returns
boolean
if the file was loaded correctly
public string item ( string $item, string $index = '' )
Fetch a config file item
Parameters
$item
string
the config item name
$index
string
the index name
Returns
string
public string slash_item ( string $item )
Fetch a config file item - adds slash after item (if item is not empty)
Parameters
$item
string
the config item name
Returns
string
public string site_url ( string $uri = '' )
Site URL Returns base_url . index_page [. uri_string]
Parameters
$uri
string
the URI string
Returns
string
public string base_url ( string $uri = '' )
Base URL Returns base_url [. uri_string]
Parameters
$uri
string
$uri
Returns
string
protected string _uri_string ( mixed $uri )
Build URI string for use in Config::site_url() and Config::base_url()
Parameters
$uri
mixed
$uri
Returns
string
public string system_url ( )
System URL
Returns
string
public set_item ( string $item, string $value )
Set a config file item
Parameters
$item
string
the config item key
$value
string
the config item value
public _assign_to_config ( array $items = array() )
Assign to Config
This function is called by the front controller (CodeIgniter.php) after the Config class is instantiated. It permits config items to be assigned or overriden by variables contained in the index.php file
Parameters
$items
array
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="config" id="$config">
<td class="attributes"><code>
public
array
</code></td>
<td class="name">
$config
array()
<div class="description detailed">
List of all loaded config values
</div>
</div></td>
</tr>
<tr data-order="is_loaded" id="$is_loaded">
<td class="attributes"><code>
public
array
</code></td>
<td class="name">
$is_loaded
array()
<div class="description detailed">
List of all loaded config files
</div>
</div></td>
</tr>
<tr data-order="_config_paths" id="$_config_paths">
<td class="attributes"><code>
public
array
</code></td>
<td class="name">
$_config_paths
array(APPPATH)
<div class="description detailed">
List of paths to search when trying to load a config file
</div>
</div></td>
</tr>
</table>