\Orpheus\ConfigAppConfig

The AppConfig class

Store application configuration in a file

Summary

Methods
Properties
Constants
asArray()
preset()
has()
get()
set()
remove()
loadSmartly()
load()
save()
instance()
getInstance()
getPath()
setPath()
getData()
setData()
No public properties found
No constants found
__construct()
$path
$data
$instance
N/A
No private methods found
No private properties found
N/A

Properties

$path

$path : string

The path to config file

Type

string

$data

$data : array

The config data

Type

array

Methods

asArray()

asArray() : array

Get it as array

Returns

array

preset()

preset(string  $key, mixed  $default) 

Set $key if not yet set

Parameters

string $key
mixed $default

has()

has(string  $key) 

Test if config has $key

Parameters

string $key

get()

get(string  $key, mixed  $default = null) 

Get value of $key or $default

Parameters

string $key
mixed $default

set()

set(string  $key, mixed  $value) 

Set the $value of $key

Parameters

string $key
mixed $value

remove()

remove(string  $key) 

Test if config has $key

Parameters

string $key

loadSmartly()

loadSmartly() 

Load config if it exists

load()

load() 

Load config from filesystem

Throws

\Exception

save()

save() : integer

Save config into the filesystem

Returns

integer

getPath()

getPath() : string

Get the path

Returns

string

setPath()

setPath(string  $path) : \Orpheus\Config\AppConfig

Set the path

Parameters

string $path

Returns

\Orpheus\Config\AppConfig

getData()

getData() : array

Get the data

Returns

array

setData()

setData(array  $data) : \Orpheus\Config\AppConfig

Set the data

Parameters

array $data

Returns

\Orpheus\Config\AppConfig

__construct()

__construct() 

Constructor