PHP Class Habari\Config

Configuration registry class
显示文件 Open project: habari/system

Protected Properties

Property Type Description
$prefix
$registry Registry of configuration data

Public Methods

Method Description
clear ( string $key ) : void Unset data
exists ( string $key ) : boolean See if a key exists
get ( string $key, null $default = null ) : mixed Fetch data from registry
set ( string $key, mixed $val ) : boolean Set data in registry

Private Methods

Method Description
__construct ( ) Static; private constructor

Method Details

clear() public static method

Unset data
public static clear ( string $key ) : void
$key string key name
return void

exists() public static method

See if a key exists
public static exists ( string $key ) : boolean
$key string key name
return boolean

get() public static method

Fetch data from registry
public static get ( string $key, null $default = null ) : mixed
$key string key name
$default null
return mixed (empty object on invalid key)

set() public static method

Note: arrays become objects for easy fetching
public static set ( string $key, mixed $val ) : boolean
$key string key name
$val mixed value to store
return boolean true if new key, false if key already exists

Property Details

$prefix protected_oe static_oe property

protected static $prefix

$registry protected_oe static_oe property

Registry of configuration data
protected static $registry