progphil1337 / php-config
Config interpreter
Installs: 130
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/progphil1337/php-config
Requires
- php: ^8.1
- ext-mbstring: *
- ext-yaml: *
README
Simple and fast configuration solution
Installation
Install with composer:
$ composer require progphil1337/php-config
Compatibility
ProgPhil1337\Config
requires PHP 8.1 (or better).
Usage
Basic example
app.php
use Progphil1337\Config\Config; $config = Config::create(__DIR__ . DIRECTORY_SEPARATOR . 'config.yaml'); $config->map(function (mixed $value): mixed { if (str_starts_with($value, '%m')) { return 'Modified value'; } return $value; }); $config->setHierarchyOperator('::'); // :: is default echo $config->get('HttpServer::ip');