ndybnov-hw03/cnf-read
最新稳定版本:1.1.0
Composer 安装命令:
composer require ndybnov-hw03/cnf-read
包简介
README 文档
README
describe
Reader Config file, e.g. .env
require
"require": {
"php": ">=7.4"
}
setup
composer require ndybnov-hw03/cnf-read
sample using
$fileConfig = new FileConfig(); $pathToFileConfig = __DIR__; $fileConfig->setFilePath($pathToFileConfig); $fileConfig->setFileName($fileNameConfig = '.env'); $pathFull = $fileConfig->getFullPath();
$readerConfig = new ReadConfig($pathFull); $readerConfig->read(); $arrayConfig = $readerConfig->toArray();
$storage = new Storage(); $storage->fromArray($arrayConfig);
class ConfigKeysDTO { public const KEY = 'KEY'; public const BKEY = 'BKEY'; }
echo $storage->get(ConfigKeysDTO::KEY); echo PHP_EOL; echo $storage->get(ConfigKeysDTO::BKEY) ? '+' : '-'; echo PHP_EOL;
Enjoy and to use ))
统计信息
- 总下载量: 60
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-08-15