ConfigurationManager
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
Set the logger instance
Get the singleton instance
Initialize the configuration
Get a configuration value by its key
Get an entire configuration group
Whether the defaults file (config/settings.defaults.php) was successfully loaded.
Absolute path that initialize() probed for the defaults file.
Get all configuration settings
Details
void
setLogger(LoggerInterface $logger)
Set the logger instance
static ConfigurationManager
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.
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.
string
getDefaultsFilePath()
Absolute path that initialize() probed for the defaults file.
array
getAll()
Get all configuration settings