alex014 / confy
Confy the configuration utility
1.1
2020-08-02 19:54 UTC
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2025-03-29 00:47:31 UTC
README
Instalation and usage
composer require alex014/confy
<?php
use \Confy\Confy;
Confy::load('config/database.ini');
echo Confy::get('login');
print_r(Confy::getAll());
Methods
Confy::load(string $filename)
load configuration file (ini, json, php, yaml formats are supported), many configuration files can be loadedConfy::get(string $name)
get configuration valueConfy::has(string $name)
check configuration key existanceConfy::set(string $name, $value)
set configuration valueConfy::unset(string $name)
delete configuration valueConfy::getAll()
Plugins
- All plugins are located in
/src/Parser
directory. - All plugins must be named by Capitalized file extension (Ini.php -> .ini).
- All plugin classes must implement
\Confy\Interfaces\Parser
interface
Run tests
- Install PHPUnit
wget -O phpunit https://phar.phpunit.de/phpunit-9.phar
andchmod +x phpunit
- Run tests
./phpunit ConfyTest.php
License
MIT license