simpl / config
Combines the simplicity of `.env` files with the flexibility of defining arrays of config values.
Requires
- php: ^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3
- dflydev/dot-access-data: ^3.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- phpunit/phpunit: ^9.6
- squizlabs/php_codesniffer: ^3.9
- symfony/var-dumper: ^5.4
This package is auto-updated.
Last update: 2024-11-21 05:18:24 UTC
README
Simple configuration provider based on PHP dotenv
Combines the simplicity of .env
files with the flexibility of defining arrays of config values.
Installation
composer require simpl/config
Basic Usage
<?php use Simpl\Config; $config = new Config(); var_dump($config->get('app.debug'));
See https://simpl-php.com/components/config for full documentation.
Testing
composer test
Coding Standards
This library uses PHP_CodeSniffer to ensure coding standards are followed.
I have adopted the PHP FIG PSR-2 Coding Standard EXCEPT for the tabs vs spaces for indentation rule. PSR-2 says 4 spaces. I use tabs. No discussion.
To support indenting with tabs, I've defined a custom PSR-2 ruleset that extends the standard PSR-2 ruleset used by PHP_CodeSniffer. You can find this ruleset in the root of this project at PSR2Tabs.xml
Codesniffer
composer codensiffer
Codefixer
composer codefixer