ndybnov-hw03 / cnf-read
There is no license information available for the latest version (1.1.0) of this package.
1.1.0
2023-08-21 21:17 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2024-10-21 23:50:07 UTC
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 ))