\FW\ConfigBaseConfig

Abstract BaseConfig implementation Makes it simple to declare a new Config interface implementation

Summary

Methods
Properties
Constants
__construct()
get()
set()
replace()
has()
remove()
all()
isDefaultModule()
loadFile()
getDefaultModules()
No public properties found
No constants found
removeNumIndexes()
$values
N/A
No private methods found
$default_modules
N/A

Properties

$values

$values : array

Array of config values

Type

array

$default_modules

$default_modules : array

Default modules implementation array

Type

array

Methods

__construct()

__construct() 

Constructs an empty config

get()

get(string  $id,   $alt = null) : mixed

{@inheritdoc}

Parameters

string $id

key to get

$alt

Returns

mixed —

value if located, otherwise $alt

set()

set(string  $id, \FW\Config\value  $value, boolean  $merge = true, boolean  $assoc = false) : \FW\Config\PhpConfig

{@inheritdoc}

Parameters

string $id

key to set

\FW\Config\value $value

mixed value to set

boolean $merge

Whether or not to merge (if value is an array)

boolean $assoc

Whether or not the merged array is associative

Returns

\FW\Config\PhpConfig

replace()

replace(array  $arr, boolean  $merge = true) : \FW\Config\PhpConfig

{@inheritdoc}

Parameters

array $arr

array to merge or replace

boolean $merge

whether or not to merge

Returns

\FW\Config\PhpConfig

has()

has(string  $id) : boolean

{@inheritdoc}

Parameters

string $id

key to look up

Returns

boolean —

whether or not the key exists

remove()

remove(string  $id) : mixed

{@inheritdoc}

Parameters

string $id

key to remove

Returns

mixed —

object removed

all()

all() : array

Gets all the values from the array

Returns

array —

all the values

isDefaultModule()

isDefaultModule(string  $module) : boolean

Tells whether or not a given module implementation is the default implementation

Parameters

string $module

Module name

Returns

boolean —

whether or not it is the default

loadFile()

loadFile(string  $fileName, boolean  $merge = true) 

{@inheritdoc}

Parameters

string $fileName

The name of the file

boolean $merge

Whether or not to merge the data from the file with existing config data

getDefaultModules()

getDefaultModules() : array

Gets the default list of modules

Returns

array —

assoc. array of default modules indexed by module name

removeNumIndexes()

removeNumIndexes(array  $array) : array

Helper function

Parameters

array $array

array to strip numeric indexes from

Returns

array —

array less numeric indexes