class ConfigurationManager implements ConfigurationInterface (View source)

Class ConfigurationManager

This class is responsible for loading and accessing configuration values. It layers config/settings.php (or PA_CONFIG_PATH) over config/settings.defaults.php. Legacy inc/config.inc.php support was removed in 4.1.0.

Methods

void
setLogger(LoggerInterface $logger)

Set the logger instance

getInstance()

Get the singleton instance

void
initialize()

Initialize the configuration

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

Get a configuration value by its key

array
getGroup(string $group)

Get an entire configuration group

bool
isDefaultsFileLoaded()

Whether the defaults file (config/settings.defaults.php) was successfully loaded.

string
getDefaultsFilePath()

Absolute path that initialize() probed for the defaults file.

array
getAll()

Get all configuration settings

Details

void setLogger(LoggerInterface $logger)

Set the logger instance

Parameters

LoggerInterface $logger

Return Value

void

static ConfigurationManager getInstance()

Get the singleton instance

Return Value

ConfigurationManager

void initialize()

Initialize the configuration

Return Value

void

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

Get a configuration value by its key

Parameters

string $group

Configuration group

string $key

Configuration key

mixed $default

Default value if not found

Return Value

mixed

Configuration value or default if not found

array getGroup(string $group)

Get an entire configuration group

Parameters

string $group

Configuration group

Return Value

array

Configuration group values

bool isDefaultsFileLoaded()

Whether the defaults file (config/settings.defaults.php) was successfully loaded.

When this returns false the in-memory settings only contain whatever the user's settings.php provides. Code-level fallbacks still keep the app running, but ConfigValidator will flag keys the installer expects defaults to fill in.

Return Value

bool

string getDefaultsFilePath()

Absolute path that initialize() probed for the defaults file.

Return Value

string

array getAll()

Get all configuration settings

Return Value

array

All settings