PHP Class Crunz\Configuration\Configuration

Inheritance: extends Crunz\Singleton
ファイルを表示 Open project: lavary/crunz Class Usage Examples

Protected Properties

Property Type Description
$instance The instance of the configuration class
$parameters array Store parameters

Public Methods

Method Description
all ( ) : array Return all the parameters as an array
get ( string $key, $default = null ) : string Return a parameter based on a key
has ( string $key ) : boolean Check if a parameter exist
set ( string $key, mixed $value ) : array Set a parameter

Protected Methods

Method Description
__construct ( ) Process the configuration file into an array
locateConfigFile ( ) : string Locate the right config file and return its name
parse ( $filename ) : array Load configuration files and parse them
process ( $filename ) : array Handle the configuration settings

Method Details

__construct() protected method

Process the configuration file into an array
protected __construct ( )

all() public method

Return all the parameters as an array
public all ( ) : array
return array

get() public method

Return a parameter based on a key
public get ( string $key, $default = null ) : string
$key string
return string

has() public method

Check if a parameter exist
public has ( string $key ) : boolean
$key string
return boolean

locateConfigFile() protected method

Locate the right config file and return its name
protected locateConfigFile ( ) : string
return string

parse() protected method

Load configuration files and parse them
protected parse ( $filename ) : array
return array

process() protected method

Handle the configuration settings
protected process ( $filename ) : array
return array

set() public method

Set a parameter
public set ( string $key, mixed $value ) : array
$key string
$value mixed
return array

Property Details

$instance protected_oe static_oe property

The instance of the configuration class
protected static $instance

$parameters protected_oe property

Store parameters
protected array $parameters
return array