MilkCore

Config
in package

Configuration data management class

Table of Contents

Methods

get()  : mixed
Returns a configuration value
get_all()  : array<string|int, mixed>
Returns all configuration values
set()  : void
Sets a configuration value
set_all()  : void
Sets all configuration values

Methods

get()

Returns a configuration value

public static get(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string

The configuration key to retrieve

$default : mixed = null

The default value if key doesn't exist

Return values
mixed

The configuration value or default if not found

get_all()

Returns all configuration values

public static get_all() : array<string|int, mixed>
Return values
array<string|int, mixed>

All configuration settings as an associative array

set()

Sets a configuration value

public static set(string $key, mixed $value) : void
Parameters
$key : string

The configuration key to set

$value : mixed

The value to assign to the key

set_all()

Sets all configuration values

public static set_all(array<string|int, mixed> $config) : void
Parameters
$config : array<string|int, mixed>

An associative array of configuration values


        
On this page

Search results