tres-framework / config
Easily load your configuration files.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/tres-framework/config
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ^4.7
This package is not auto-updated.
Last update: 2022-02-01 12:48:27 UTC
README
This package allows you to easily load your configuration files.
Installing
It's recommended to install by using Composer:
Using the terminal:
composer require tres-framework/config
Examples
$config = new Config(); $config->addFromArray([ 'cookie.lifetime_in_hours' => 48, 'database' => [ 'mysql.host' => '127.0.0.1', 'mysql.user' => 'bob', ], 'deeply.nested.array.with.zero' => 0, 'deeply.nested.array.with.a.null' => null, 'deeply.nested.array.with.a.false' => false, ]); $config->addFromFile(__DIR__.'/config/database.php'); echo 'Cookie lifetime: '.$config->get('cookie.lifetime_in_hours');
You should check out the unit tests for more examples.