PHP Class CI_Config, TastyIgniter

显示文件 Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$_config_paths array List of paths to search when trying to load a config file.
$config array List of all loaded config values
$is_loaded array List of all loaded config files

Public Methods

Method Description
__construct ( ) : void Class constructor
base_url ( string | string[] $uri = '', string $protocol = NULL ) : string Base URL
item ( string $item, string $index = '' ) : string | null Fetch a config file item
load ( string $file = '', boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE ) : boolean Load Config File
set_item ( string $item, string $value ) : void Set a config file item
site_url ( string | string[] $uri = '', string $protocol = NULL ) : string Site URL
slash_item ( string $item ) : string | null Fetch a config file item with slash appended (if not empty)
system_url ( ) : string System URL

Protected Methods

Method Description
_uri_string ( string | string[] $uri ) : string Build URI string

Method Details

__construct() public method

Sets the $config data from the primary config.php file as a class variable.
public __construct ( ) : void
return void

_uri_string() protected method

Build URI string
protected _uri_string ( string | string[] $uri ) : string
$uri string | string[] URI string or an array of segments
return string

base_url() public method

Returns base_url [. uri_string]
public base_url ( string | string[] $uri = '', string $protocol = NULL ) : string
$uri string | string[] URI string or an array of segments
$protocol string
return string

item() public method

Fetch a config file item
public item ( string $item, string $index = '' ) : string | null
$item string Config item name
$index string Index name
return string | null The configuration item or NULL if the item doesn't exist

load() public method

Load Config File
public load ( string $file = '', boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE ) : boolean
$file string Configuration file name
$use_sections boolean Whether configuration values should be loaded into their own section
$fail_gracefully boolean Whether to just return FALSE or display an error message
return boolean TRUE if the file was loaded correctly or FALSE on failure

set_item() public method

Set a config file item
public set_item ( string $item, string $value ) : void
$item string Config item key
$value string Config item value
return void

site_url() public method

Returns base_url . index_page [. uri_string]
public site_url ( string | string[] $uri = '', string $protocol = NULL ) : string
$uri string | string[] URI string or an array of segments
$protocol string
return string

slash_item() public method

Fetch a config file item with slash appended (if not empty)
public slash_item ( string $item ) : string | null
$item string Config item name
return string | null The configuration item or NULL if the item doesn't exist

system_url() public method

System URL
Deprecation: 3.0.0 Encourages insecure practices
public system_url ( ) : string
return string

Property Details

$_config_paths public_oe property

List of paths to search when trying to load a config file.
public array $_config_paths
return array

$config public_oe property

List of all loaded config values
public array $config
return array

$is_loaded public_oe property

List of all loaded config files
public array $is_loaded
return array