vakata / config
A PHP config class (parses .env files)
Installs: 3 828
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.0
- vakata/kvstore: >=2.0.0
README
A PHP config class, which supports parsing .env files.
Install
Via Composer
$ composer require vakata/config
Usage
$config = new \vakata\config\Config([ 'key' => 'value' ]); $config->fromFile(__DIR__ . '/config.env'); $config->get('key'); // "value" $config->set('key', 2); // 2 $config->get('key'); // 2 $config->del('key'); // true $config->get('key'); // null $config->get('key', 'default'); // "default" $config->export(); // export all stored values to enviroment and $_SERVER $config->export(true); // same as above but overwrite existing values
Testing
$ phpunit --bootstrap ./vendor/autoload.php ./tests/
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.