nschwab / configmgr
A PHP configuration manager.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nschwab/configmgr
Requires
- php: >=7.4.0
- ext-json: *
This package is auto-updated.
Last update: 2025-10-29 03:24:37 UTC
README
ConfigMGR is a Configuration Manager for PHP. It is meant to remove all these old config.php files in a simple and efficient way.
Install with Composer
You can install this library with Composer.
composer require nschwab/configmgr
Simple example
You can find a simple example in the /example/ directory.
String interpolation
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.
Example
{
"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}"
}
}
Features
- 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