progphil1337 / php-config
配置解释器
v1.0.1
2024-01-16 12:24 UTC
Requires
- php: ^8.1
- ext-mbstring: *
- ext-yaml: *
README
简单快速配置解决方案
安装
使用 composer 安装
$ composer require progphil1337/php-config
兼容性
ProgPhil1337\Config
需要 PHP 8.1(或更高版本)。
使用方法
基本示例
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');