ConfigMGR is a Configuration Manager for PHP. It is meant to remove all these old config.php
files in a simple and efficient way.
You can install this library with Composer.
composer require nschwab/configmgr
You can find a simple example in the /example/
directory.
String interpolation is possible within your config file. By using curly brackets "{ }", you can specify any variable or constants defined in your config. It will look for constants defined by the system before checking for configuration keys.
{
"constants": {
"DB_NAME": "testDb",
"SQL_USER": "root",
"SQL_HOST": "localhost",
"SQL_PASSWORD": "123456",
"CONNECTION_STRING": "Server={SQL_HOST}; Database={DB_NAME}; User Id={SQL_USER}; Password={SQL_PASSWORD}",
"VERSION": "v1.7.3-alpha {PHP_VERSION}"
}
}
- Loading configuration from JSON
- Creating variables from configuration
- Defining constants from configuration
- Format content of a configuration key with another
- Format content of multiple configuration keys with another
- Composer package
- Search to format content with already defined constants
- Custom markup
- Crawl recursively through tables to format content with configuration keys
- Crawl recursively through objects to format content with configuration keys
- Load tables from CSV
- Load objects from JSON
- Monolog integration